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) { } }