From f406510e445642af5a9beed6672dc9ee6a859890 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Sun, 12 Aug 2012 21:21:17 +0200 Subject: [PATCH] Allows one to pass the user to UserGroup::isMember() --- .../files/lib/data/user/group/UserGroup.class.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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; } -- 2.20.1