From 0435e6923dcca697c2fa2b8f5965434608bae3d8 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Fri, 18 Jul 2014 22:38:15 +0200 Subject: [PATCH] Fixed editing a user group option as admin --- .../files/lib/acp/form/UserGroupOptionForm.class.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/acp/form/UserGroupOptionForm.class.php b/wcfsetup/install/files/lib/acp/form/UserGroupOptionForm.class.php index f980054a1c..d4619872df 100644 --- a/wcfsetup/install/files/lib/acp/form/UserGroupOptionForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UserGroupOptionForm.class.php @@ -149,6 +149,14 @@ class UserGroupOptionForm extends AbstractForm { public function validate() { parent::validate(); + $isAdmin = false; + foreach (WCF::getUser()->getGroupIDs() as $groupID) { + if (UserGroup::getGroupByID($groupID)->isAdminGroup()) { + $isAdmin = true; + break; + } + } + // validate option values foreach ($this->values as $groupID => &$optionValue) { if (!isset($this->groups[$groupID])) { @@ -164,7 +172,7 @@ class UserGroupOptionForm extends AbstractForm { $this->errorType[$e->getField()] = $e->getType(); } - if ($this->optionType->compare($optionValue, WCF::getSession()->getPermission($this->userGroupOption->optionName)) == 1) { + if (!$isAdmin && $this->optionType->compare($optionValue, WCF::getSession()->getPermission($this->userGroupOption->optionName)) == 1) { $this->errorType[$groupID] = 'exceedsOwnPermission'; } } -- 2.20.1