diff options
Diffstat (limited to 'html/app/models')
| -rw-r--r-- | html/app/models/admin/User_model.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/html/app/models/admin/User_model.php b/html/app/models/admin/User_model.php index d0def1b..bfed5c5 100644 --- a/html/app/models/admin/User_model.php +++ b/html/app/models/admin/User_model.php @@ -188,6 +188,25 @@ class User_model } + public static fuunction activate($ticket) + { + $user = Registry::use('database')->query( + "SELECT * FROM user WHERE activation = :ticket", + [ 'ticket' => $ticket] + )->getFirst(); + + // if no user with this activation code, return false + if ($user === false) return false; + + Registry::use('database')->runQuery( + "UPDATE user SET activated = 1 WHERE activation = :ticket", + [ 'ticket' => $ticket] + ); + + return true; + + } + /** inherited privileges * |
