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 +++++++++++++++++++++++++++ public/app/extends/App_user.php | 121 +++++++++++++++++++++++++++++++ public/app/extends/Classroom_manager.php | 106 --------------------------- public/app/extends/Classroom_user.php | 121 ------------------------------- 4 files changed, 227 insertions(+), 227 deletions(-) create mode 100644 public/app/extends/App_manager.php create mode 100644 public/app/extends/App_user.php delete mode 100644 public/app/extends/Classroom_manager.php delete mode 100644 public/app/extends/Classroom_user.php (limited to 'public/app/extends') 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 diff --git a/public/app/extends/App_user.php b/public/app/extends/App_user.php new file mode 100644 index 0000000..9aed489 --- /dev/null +++ b/public/app/extends/App_user.php @@ -0,0 +1,121 @@ +id; + } + + /** setID() + * + * @param int : user id + * + * @return User + */ + public function setID(int $id): self + { + $this->id = $id; + return $this; + } + + + // name + // --- -- -- - - - + + /** getName + * @return int + */ + public function getName(): string + { + return $this->name; + } + + /** setName() + * + * @param string : user's full name + * + * @return User + */ + public function setName(string $name): self + { + $this->name = $name; + return $this; + } + + + // privileges + // --- -- -- - - - + + /** getPrivileges + * + * @return privileges (array) + */ + public function getPrivileges(): array + { + return $this->privileges; + } + + + /** setPrivileges() + * + * @param array $privileges + * + * @return User + */ + public function setPrivileges(array $privileges): self + { + $this->privileges = $privileges; + return $this; + } + + +} \ No newline at end of file diff --git a/public/app/extends/Classroom_manager.php b/public/app/extends/Classroom_manager.php deleted file mode 100644 index ea2e891..0000000 --- a/public/app/extends/Classroom_manager.php +++ /dev/null @@ -1,106 +0,0 @@ -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 diff --git a/public/app/extends/Classroom_user.php b/public/app/extends/Classroom_user.php deleted file mode 100644 index c27c4bf..0000000 --- a/public/app/extends/Classroom_user.php +++ /dev/null @@ -1,121 +0,0 @@ -id; - } - - /** setID() - * - * @param int : user id - * - * @return User - */ - public function setID(int $id): self - { - $this->id = $id; - return $this; - } - - - // name - // --- -- -- - - - - - /** getName - * @return int - */ - public function getName(): string - { - return $this->name; - } - - /** setName() - * - * @param string : user's full name - * - * @return User - */ - public function setName(string $name): self - { - $this->name = $name; - return $this; - } - - - // privileges - // --- -- -- - - - - - /** getPrivileges - * - * @return privileges (array) - */ - public function getPrivileges(): array - { - return $this->privileges; - } - - - /** setPrivileges() - * - * @param array $privileges - * - * @return User - */ - public function setPrivileges(array $privileges): self - { - $this->privileges = $privileges; - return $this; - } - - -} \ No newline at end of file -- cgit v1.2.3