diff options
Diffstat (limited to 'classes/User.php')
-rw-r--r-- | classes/User.php | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/classes/User.php b/classes/User.php index 92ff8776b..51e23fccf 100644 --- a/classes/User.php +++ b/classes/User.php @@ -492,4 +492,32 @@ class User extends Memcached_DataObject return true; } + function isMember($group) + { + $mem = new Group_member(); + + $mem->group_id = $group->id; + $mem->profile_id = $this->id; + + if ($mem->find()) { + return true; + } else { + return false; + } + } + + function isAdmin($group) + { + $mem = new Group_member(); + + $mem->group_id = $group->id; + $mem->profile_id = $this->id; + $mem->is_admin = 1; + + if ($mem->find()) { + return true; + } else { + return false; + } + } } |