summaryrefslogtreecommitdiff
path: root/public/app/models
diff options
context:
space:
mode:
authorGeorge Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2023-06-02 03:31:32 +0300
committerGeorge Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2023-06-02 03:31:32 +0300
commit48632666db08ccb58291b34e693280bf15d44fdf (patch)
tree0a738d62f1ede9066e57acbec984b1e3314f6ec0 /public/app/models
parenta8429525dfcfa7d5ca60fd98a240e2b5c92c5edf (diff)
downloadgyraf1gov-48632666db08ccb58291b34e693280bf15d44fdf.tar.gz
gyraf1gov-48632666db08ccb58291b34e693280bf15d44fdf.tar.bz2
gyraf1gov-48632666db08ccb58291b34e693280bf15d44fdf.zip
Auth class cleaned; hot session reset
Diffstat (limited to 'public/app/models')
-rw-r--r--public/app/models/Access_model.php22
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'
);
}