From: Alexander Ebert Date: Sat, 28 Jun 2014 15:08:05 +0000 (+0200) Subject: Unified user creation and update, deprecating 'languages' in favor of 'languageIDs' X-Git-Tag: 2.1.0_Alpha_1~651 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7623b12fb243da5c72dd1d2e2fe5de9a825fa9a7;p=GitHub%2FWoltLab%2FWCF.git Unified user creation and update, deprecating 'languages' in favor of 'languageIDs' --- diff --git a/wcfsetup/install/files/lib/acp/form/UserAddForm.class.php b/wcfsetup/install/files/lib/acp/form/UserAddForm.class.php index a2644c9e63..367924b446 100644 --- a/wcfsetup/install/files/lib/acp/form/UserAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UserAddForm.class.php @@ -264,7 +264,7 @@ class UserAddForm extends UserOptionListForm { 'signatureEnableHtml' => $this->signatureEnableHtml )), 'groups' => $this->groupIDs, - 'languages' => $this->visibleLanguages, + 'languageIDs' => $this->visibleLanguages, 'options' => $saveOptions ); diff --git a/wcfsetup/install/files/lib/data/user/UserAction.class.php b/wcfsetup/install/files/lib/data/user/UserAction.class.php index c15355429b..18e9555a88 100644 --- a/wcfsetup/install/files/lib/data/user/UserAction.class.php +++ b/wcfsetup/install/files/lib/data/user/UserAction.class.php @@ -275,8 +275,11 @@ class UserAction extends AbstractDatabaseObjectAction implements IClipboardActio $userEditor->addToGroups($groupIDs, false, $addDefaultGroups); // insert visible languages - $languageIDs = (isset($this->parameters['languages'])) ? $this->parameters['languages'] : array(); - $userEditor->addToLanguages($languageIDs, false); + if (!isset($this->parameters['languageIDs'])) { + // using the 'languages' key is deprecated since WCF 2.1, please use 'languageIDs' instead + $this->parameters['languageIDs'] = (!empty($this->parameters['languages'])) ? $this->parameters['languages'] : array(); + } + $userEditor->addToLanguages($this->parameters['languageIDs'], false); if (PACKAGE_ID) { // set default notifications diff --git a/wcfsetup/install/files/lib/form/RegisterForm.class.php b/wcfsetup/install/files/lib/form/RegisterForm.class.php index 50523370d2..426efb68dc 100644 --- a/wcfsetup/install/files/lib/form/RegisterForm.class.php +++ b/wcfsetup/install/files/lib/form/RegisterForm.class.php @@ -438,7 +438,7 @@ class RegisterForm extends UserAddForm { 'password' => $this->password, )), 'groups' => $this->groupIDs, - 'languages' => $this->visibleLanguages, + 'languageIDs' => $this->visibleLanguages, 'options' => $saveOptions, 'addDefaultGroups' => $addDefaultGroups );