diff options
Diffstat (limited to 'code/user.inc.php')
-rw-r--r-- | code/user.inc.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/code/user.inc.php b/code/user.inc.php index 7c9b907..cc04268 100644 --- a/code/user.inc.php +++ b/code/user.inc.php @@ -73,13 +73,18 @@ } function IsAdmin($id = -1) { - if($id < 0) return ($this->uid != 0 && $this->gid == 0); + if($id < 0) return ($this->gid == -1); - return ($id != 0 && $this->GetGid($id) == 0); + return ($this->GetGid($id) == -1); + } + + function GetUid() { + return $this->uid; } function GetGid($id = -1) { if($id < 0) return $this->gid; + if($id == 0) return 0; $res = $GLOBALS['db']->Execute('SELECT gid FROM users WHERE id = ?', $id); |