diff options
Diffstat (limited to 'html/app/models/admin')
| -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; |
