From 5ce005a4f120c7470cd84c1af306b64c52e3dbfc Mon Sep 17 00:00:00 2001 From: George Halkiadakis Date: Tue, 28 Mar 2023 03:38:35 +0300 Subject: custom user manager extended class (work in progress) --- html/app/extends/Classroom_user.php | 108 ++++++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 html/app/extends/Classroom_user.php (limited to 'html/app/extends') diff --git a/html/app/extends/Classroom_user.php b/html/app/extends/Classroom_user.php new file mode 100644 index 0000000..b451114 --- /dev/null +++ b/html/app/extends/Classroom_user.php @@ -0,0 +1,108 @@ +POST + * + */ + public function register_user() + { + $req = Registry::get('REQUEST'); + $register = User_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); + User_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