From 2b4ed611e7e001ad8ea93ef3e8cdce35bc56dc07 Mon Sep 17 00:00:00 2001 From: George Halkiadakis Date: Mon, 1 May 2023 04:33:06 +0300 Subject: form designer; setup main forms of the application --- public/app/extends/App_manager.php | 106 +++++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 public/app/extends/App_manager.php (limited to 'public/app/extends/App_manager.php') diff --git a/public/app/extends/App_manager.php b/public/app/extends/App_manager.php new file mode 100644 index 0000000..8e6ce95 --- /dev/null +++ b/public/app/extends/App_manager.php @@ -0,0 +1,106 @@ +POST + * + */ + public function register_user() + { + $req = Registry::get('REQUEST'); + $register = Access_model::registerUser($req->POST); + + if ($register['success']) { + + //create OTP; + $otp = $this->create_OPT($register['id']); + + // send for account confirmation + + + } else { + print_r($register); + } + + } + + + public function login_user() + { + + } + + + /** forgot password + * + * send an otp + * (then verify) + * + */ + public function forgot_password() + { + + } + + + /** create OTP + * + * create a random OTP + * keep it into User's database Table + * + * @param $id (int): user id + * + */ + public function create_OTP($id) + { + $otp = rand(100000,999999); + Access_model::set_OTP($id, $otp); + + return true; + } + + + /** Verify Account + * + * check if posted OTP matched the one sent to the user + * + * @param $identity (array): pair of [index_key => identity_value] + * example: [ 'email' => 'geo@roptron.gr' ] + * + */ + public function verify_otp($identity, $otp) + { + + } + + +} \ No newline at end of file -- cgit v1.2.3