UserAction::update() now takes care of language ids
authorAlexander Ebert <ebert@woltlab.com>
Tue, 15 May 2012 19:10:30 +0000 (21:10 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 15 May 2012 19:10:30 +0000 (21:10 +0200)
Fixes #581

wcfsetup/install/files/lib/data/user/UserAction.class.php

index b5fcd3d5d7235fafc7598396bdb7f0d958ca57f2..ab6bb82e18b45148d3e67c9cf1b0d96927462eec 100644 (file)
@@ -12,7 +12,7 @@ use wcf\util\StringUtil;
  * Executes user-related actions.
  * 
  * @author     Alexander Ebert
- * @copyright  2001-2011 WoltLab GmbH
+ * @copyright  2001-2012 WoltLab GmbH
  * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @package    com.woltlab.wcf
  * @subpackage data.user
@@ -159,6 +159,7 @@ class UserAction extends AbstractDatabaseObjectAction {
                }
                
                $groupIDs = (isset($this->parameters['groups'])) ? $this->parameters['groups'] : array();
+               $languageIDs = (isset($this->parameters['languageIDs'])) ? $this->parameters['languageIDs'] : array();
                $removeGroups = (isset($this->parameters['removeGroups'])) ? $this->parameters['removeGroups'] : array();
                $userOptions = (isset($this->parameters['options'])) ? $this->parameters['options'] : array();
                
@@ -174,6 +175,10 @@ class UserAction extends AbstractDatabaseObjectAction {
                        if (!empty($userOptions)) {
                                $userEditor->updateUserOptions($userOptions);
                        }
+                       
+                       if (!empty($languageIDs)) {
+                               $userEditor->addToLanguages($languageIDs);
+                       }
                }
        }