From: Tim Düsterhus Date: Sun, 12 Aug 2012 19:21:17 +0000 (+0200) Subject: Allows one to pass the user to UserGroup::isMember() X-Git-Tag: 2.0.0_Beta_1~887^2~3 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f406510e445642af5a9beed6672dc9ee6a859890;p=GitHub%2FWoltLab%2FWCF.git Allows one to pass the user to UserGroup::isMember() --- diff --git a/wcfsetup/install/files/lib/data/user/group/UserGroup.class.php b/wcfsetup/install/files/lib/data/user/group/UserGroup.class.php index 4c6ecc298c..95a72a7231 100644 --- a/wcfsetup/install/files/lib/data/user/group/UserGroup.class.php +++ b/wcfsetup/install/files/lib/data/user/group/UserGroup.class.php @@ -1,5 +1,6 @@ groupID, WCF::getUser()->getGroupIDs())) return true; + public function isMember(User $user = null) { + if ($user === null) $user = WCF::getUser(); + + if (in_array($this->groupID, $user->getGroupIDs())) return true; return false; }