summaryrefslogtreecommitdiff
path: root/app/Model
diff options
context:
space:
mode:
Diffstat (limited to 'app/Model')
-rw-r--r--app/Model/UserModel.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/Model/UserModel.php b/app/Model/UserModel.php
index c44fd3e7..d8db3270 100644
--- a/app/Model/UserModel.php
+++ b/app/Model/UserModel.php
@@ -29,6 +29,15 @@ class UserModel extends Base
*/
const EVERYBODY_ID = -1;
+ public function isValidSession($userID, $sessionRole)
+ {
+ return $this->db->table(self::TABLE)
+ ->eq('id', $userID)
+ ->eq('is_active', 1)
+ ->eq('role', $sessionRole)
+ ->exists();
+ }
+
/**
* Return true if the user exists
*