diff options
| author | George Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2023-04-09 04:50:17 +0300 |
|---|---|---|
| committer | George Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2023-04-09 04:50:17 +0300 |
| commit | a584bf73b6d64dad98f150caba0f25e790cde010 (patch) | |
| tree | 76c47f080248ebc97f6ae14fdaa364c2f1750b8d /html/app/models | |
| parent | 45d853b343b485bff7e6089e2689dba5f7d901cf (diff) | |
| download | classroom-a584bf73b6d64dad98f150caba0f25e790cde010.tar.gz classroom-a584bf73b6d64dad98f150caba0f25e790cde010.tar.bz2 classroom-a584bf73b6d64dad98f150caba0f25e790cde010.zip | |
user registration and login scenarios
Diffstat (limited to 'html/app/models')
| -rw-r--r-- | html/app/models/admin/User_model.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/html/app/models/admin/User_model.php b/html/app/models/admin/User_model.php index 187da2d..397f198 100644 --- a/html/app/models/admin/User_model.php +++ b/html/app/models/admin/User_model.php @@ -188,6 +188,14 @@ class User_model } + /** activate + * + * check if activation code is valid; + * if valid, set account active; + * + * @param $ticket (hex/MD5): activation code; + * + */ public static function activate($ticket) { $user = Registry::use('database')->query( @@ -201,13 +209,13 @@ class User_model // remove activation code from user record Registry::use('database')->runQuery( "UPDATE user - SET activated = 1, `activation` = NULL + SET active = 1, `activation` = NULL WHERE activation = :ticket", [ 'ticket' => $ticket ] ); // update history - History::trackUserAccess($new_user_id, TRACK_ACCOUNT, 'User Account Activated'); + History::trackUserAccess($user['id'], TRACK_ACCOUNT, 'User Account Activated'); return true; |
