summaryrefslogtreecommitdiff
path: root/html/app/controllers
diff options
context:
space:
mode:
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'
];
- }
-
-
+ }
}