From 4c4462e4e9a53552ac854e01b611020479e1bf09 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Fri, 6 Mar 2015 18:44:28 +0100 Subject: [PATCH] Include moderated groups in UserGroupCondition --- .../condition/UserGroupCondition.class.php | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) 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()); -- 2.20.1