diff options
Diffstat (limited to 'public/app/models/Access_model.php')
| -rw-r--r-- | public/app/models/Access_model.php | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/public/app/models/Access_model.php b/public/app/models/Access_model.php index 5c9f991..2d36285 100644 --- a/public/app/models/Access_model.php +++ b/public/app/models/Access_model.php @@ -33,6 +33,22 @@ class Access_model } + /** get user by id + * + */ + public static function getUser_byID($uid) + { + $user = Registry::use('database')->query( + "SELECT * FROM user WHERE id = :uid AND active = 1", + [ ':uid' => $uid ] + )->getFirst(); + + // if no user, return false + if ($user === false) return false; + + return $user; + } + /** getUserByInvitation * * @param string $invitation @@ -173,7 +189,7 @@ class Access_model * @param array $post; * @param int $id: user id */ - public static function update_user($post, $id) + public static function update_user($post, $uid) { // Update and set activate = true $rowCount = Registry::use('database')->query( @@ -201,14 +217,14 @@ class Access_model ':position' => $post['position'], ':phone' => $post['phone'], ':active' => 1, - ':id' => $id + ':id' => $uid ] )->rowCount(); // update history if ($rowCount != 0) { History_model::trackUserAccess( - $id, TRACK_ACCOUNT, 'User properties changed' + $uid, TRACK_ACCOUNT, 'User properties changed' ); } |
