From: Matthias Schmidt Date: Fri, 6 Mar 2015 17:44:28 +0000 (+0100) Subject: Include moderated groups in UserGroupCondition X-Git-Tag: 2.1.2~88^2^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4c4462e4e9a53552ac854e01b611020479e1bf09;p=GitHub%2FWoltLab%2FWCF.git Include moderated groups in UserGroupCondition --- diff --git a/wcfsetup/install/files/lib/system/condition/UserGroupCondition.class.php b/wcfsetup/install/files/lib/system/condition/UserGroupCondition.class.php index 531d57388a..8a50bbddb7 100644 --- a/wcfsetup/install/files/lib/system/condition/UserGroupCondition.class.php +++ b/wcfsetup/install/files/lib/system/condition/UserGroupCondition.class.php @@ -150,17 +150,15 @@ HTML; */ protected function getUserGroups() { if ($this->userGroups == null) { - $groupTypes = array(UserGroup::OTHER); - if ($this->includeguests) { - $groupTypes[] = UserGroup::GUESTS; + $invalidGroupTypes = array( + UserGroup::EVERYONE, + UserGroup::USERS + ); + if (!$this->includeguests) { + $invalidGroupTypes[] = UserGroup::GUESTS; } - $this->userGroups = UserGroup::getGroupsByType($groupTypes); - foreach ($this->userGroups as $key => $userGroup) { - if (!$userGroup->isAccessible()) { - unset($this->userGroups[$key]); - } - } + $this->userGroups = UserGroup::getAccessibleGroups(array(), $invalidGroupTypes); uasort($this->userGroups, function(UserGroup $groupA, UserGroup $groupB) { return strcmp($groupA->getName(), $groupB->getName());