summaryrefslogtreecommitdiff
path: root/html/app/controllers
diff options
context:
space:
mode:
authorGeorge Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2023-04-09 04:50:17 +0300
committerGeorge Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2023-04-09 04:50:17 +0300
commita584bf73b6d64dad98f150caba0f25e790cde010 (patch)
tree76c47f080248ebc97f6ae14fdaa364c2f1750b8d /html/app/controllers
parent45d853b343b485bff7e6089e2689dba5f7d901cf (diff)
downloadclassroom-a584bf73b6d64dad98f150caba0f25e790cde010.tar.gz
classroom-a584bf73b6d64dad98f150caba0f25e790cde010.tar.bz2
classroom-a584bf73b6d64dad98f150caba0f25e790cde010.zip
user registration and login scenarios
Diffstat (limited to 'html/app/controllers')
-rw-r--r--html/app/controllers/Auth.php25
1 files changed, 20 insertions, 5 deletions
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'
];
- }
-
-
+ }
}