From: Alexander Ebert Date: Thu, 23 Jun 2016 16:03:07 +0000 (+0200) Subject: Fixed editing simple ACLs X-Git-Tag: 3.0.0_Beta_1~1370 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e5dc9c47025542115fdd4c205125a8b4daa1e3eb;p=GitHub%2FWoltLab%2FWCF.git Fixed editing simple ACLs --- diff --git a/wcfsetup/install/files/lib/acp/form/PageAddForm.class.php b/wcfsetup/install/files/lib/acp/form/PageAddForm.class.php index 95770c5343..c5dcc8c852 100644 --- a/wcfsetup/install/files/lib/acp/form/PageAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/PageAddForm.class.php @@ -443,7 +443,7 @@ class PageAddForm extends AbstractForm { } // save acl - SimpleAclHandler::getInstance()->setValues('com.woltlab.wcf.page', $page->pageID, $_POST); + SimpleAclHandler::getInstance()->setValues('com.woltlab.wcf.page', $page->pageID, $this->aclValues); // call saved event $this->saved(); diff --git a/wcfsetup/install/files/lib/system/acl/simple/SimpleAclHandler.class.php b/wcfsetup/install/files/lib/system/acl/simple/SimpleAclHandler.class.php index 001524eb6c..3d4c4896eb 100644 --- a/wcfsetup/install/files/lib/system/acl/simple/SimpleAclHandler.class.php +++ b/wcfsetup/install/files/lib/system/acl/simple/SimpleAclHandler.class.php @@ -3,6 +3,7 @@ namespace wcf\system\acl\simple; use wcf\data\object\type\ObjectType; use wcf\data\object\type\ObjectTypeCache; use wcf\data\user\group\UserGroup; +use wcf\data\user\User; use wcf\system\cache\runtime\UserRuntimeCache; use wcf\system\exception\SystemException; use wcf\system\SingletonFactory; @@ -201,11 +202,23 @@ class SimpleAclHandler extends SingletonFactory { if (isset($rawValues['allowAll']) && $rawValues['allowAll'] == 0) { if (!empty($rawValues['user'])) { - $aclValues['user'] = UserRuntimeCache::getInstance()->getObjects($rawValues['user']); + $first = current($rawValues['user']); + if ($first instanceof User) { + $aclValues['user'] = $rawValues['user']; + } + else { + $aclValues['user'] = UserRuntimeCache::getInstance()->getObjects($rawValues['user']); + } } if (!empty($rawValues['group'])) { - $aclValues['group'] = UserGroup::getGroupsByIDs($rawValues['group']); + $first = current($rawValues['group']); + if ($first instanceof UserGroup) { + $aclValues['group'] = $rawValues['group']; + } + else { + $aclValues['group'] = UserGroup::getGroupsByIDs($rawValues['group']); + } } if (!empty($aclValues['user']) || !empty($aclValues['group'])) {