From: Alexander Ebert Date: Wed, 25 Jan 2012 21:25:57 +0000 (+0100) Subject: User groups are now properly saved X-Git-Tag: 2.0.0_Beta_1~1388^2~7 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=60c22b37031085bc1eb4e0dfd693066f0dcddb3b;p=GitHub%2FWoltLab%2FWCF.git User groups are now properly saved --- diff --git a/wcfsetup/install/files/lib/acp/form/UserGroupAddForm.class.php b/wcfsetup/install/files/lib/acp/form/UserGroupAddForm.class.php index 246d531a45..e234d52798 100755 --- a/wcfsetup/install/files/lib/acp/form/UserGroupAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UserGroupAddForm.class.php @@ -84,6 +84,12 @@ class UserGroupAddForm extends AbstractOptionListForm { */ public $additionalFields = array(); + /** + * list of values of group 'Anyone' + * @var array + */ + public $defaultValues = array(); + /** * @see wcf\page\IPage::readParameters() */ diff --git a/wcfsetup/install/files/lib/acp/form/UserGroupEditForm.class.php b/wcfsetup/install/files/lib/acp/form/UserGroupEditForm.class.php index cfa9239b97..69f7c0c375 100755 --- a/wcfsetup/install/files/lib/acp/form/UserGroupEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UserGroupEditForm.class.php @@ -60,6 +60,7 @@ class UserGroupEditForm extends UserGroupAddForm { } $this->group = new UserGroupEditor($group); + $this->optionHandler->setUserGroup($group); } /** diff --git a/wcfsetup/install/files/lib/system/option/user/group/UserGroupOptionHandler.class.php b/wcfsetup/install/files/lib/system/option/user/group/UserGroupOptionHandler.class.php index 79b8904ca4..7b1dfbb647 100644 --- a/wcfsetup/install/files/lib/system/option/user/group/UserGroupOptionHandler.class.php +++ b/wcfsetup/install/files/lib/system/option/user/group/UserGroupOptionHandler.class.php @@ -1,5 +1,6 @@ group = $group; + } + /** * @see wcf\system\option\OptionHandler::getClassName() */ @@ -35,4 +51,22 @@ class UserGroupOptionHandler extends OptionHandler { return $className; } + + /** + * @see wcf\system\option\IOptionHandler::readData() + */ + public function readData() { + $defaultGroup = UserGroup::getGroupByType(UserGroup::EVERYONE); + foreach ($this->options as $option) { + $this->optionValues[$option->optionName] = $defaultGroup->getGroupOption($option->optionName); + + // use group values over default values + if ($this->group !== null) { + $groupValue = $this->group->getGroupOption($option->optionName); + if ($groupValue !== null) { + $this->optionValues[$option->optionName] = $groupValue; + } + } + } + } } \ No newline at end of file