From: Alexander Ebert Date: Fri, 18 Jul 2014 20:38:15 +0000 (+0200) Subject: Fixed editing a user group option as admin X-Git-Tag: 2.1.0_Alpha_1~554 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0435e6923dcca697c2fa2b8f5965434608bae3d8;p=GitHub%2FWoltLab%2FWCF.git Fixed editing a user group option as admin --- 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'; } }