From a584bf73b6d64dad98f150caba0f25e790cde010 Mon Sep 17 00:00:00 2001 From: George Halkiadakis Date: Sun, 9 Apr 2023 04:50:17 +0300 Subject: user registration and login scenarios --- html/app/controllers/Auth.php | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'html/app/controllers/Auth.php') diff --git a/html/app/controllers/Auth.php b/html/app/controllers/Auth.php index 50f8fe4..6555f1c 100644 --- a/html/app/controllers/Auth.php +++ b/html/app/controllers/Auth.php @@ -2,6 +2,7 @@ namespace app\controllers; use Registry; +use Render; // user classes and models use app\extends\Classroom_user; @@ -56,13 +57,29 @@ class Auth { } - + /** activate + * resolves a call like: /account/activate?ticket=ca42d68cfba5fbbafeacc010b8e3a551 + */ public static function activate() { $req = Registry::get('REQUEST'); // get the record of the target user - $record = User_model::activate($req->GET['ticket']); + $check = User_model::activate($req->GET['ticket']); + + if ($check == true) { + Render::view('/error/general', [ + 'title' => ACCOUNT_ACTIVATED_TITLE, + 'message' => ACCOUNT_ACTIVATED_MESSAGE + ]); + + } else { + Render::view('/error/general', [ + 'title' => NOT_VALID_ACTIVATION_TITLE, + 'message' => NOT_VALID_ACTIVATION_MESSAGE + ]); + } + } /** register @@ -118,9 +135,7 @@ class Auth { 'success' => false, 'message' => 'error on sending email' ]; - } - - + } } -- cgit v1.2.3