Fixes UserAssignToGroupForm
authorMatthias Schmidt <gravatronics@live.com>
Wed, 9 Jan 2013 10:26:34 +0000 (11:26 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Wed, 9 Jan 2013 10:26:34 +0000 (11:26 +0100)
wcfsetup/install/files/lib/acp/form/UserAssignToGroupForm.class.php

index 30385223867b61ef227ad1c38feb764b77cc47ee..ec3c10b2e671c5a9970dd633f13b325dceabae49 100755 (executable)
@@ -59,10 +59,10 @@ class UserAssignToGroupForm extends AbstractForm {
        public $groups = array();
        
        /**
-        * clipboard item type id
+        * id of the user clipboard item object type
         * @var integer
         */
-       protected $typeID = null;
+       protected $objectTypeID = null;
        
        /**
         * @see wcf\page\IPage::readParameters()
@@ -70,19 +70,19 @@ class UserAssignToGroupForm extends AbstractForm {
        public function readParameters() {
                parent::readParameters();
                
-               // get type id
-               $this->typeID = ClipboardHandler::getInstance()->getObjectTypeID('com.woltlab.wcf.user');
-               if ($this->typeID === null) {
+               // get object type id
+               $this->objectTypeID = ClipboardHandler::getInstance()->getObjectTypeID('com.woltlab.wcf.user');
+               if ($this->objectTypeID === null) {
                        throw new SystemException("clipboard item type 'com.woltlab.wcf.user' is unknown.");
                }
                
-               // get user ids
-               $users = ClipboardHandler::getInstance()->getMarkedItems($this->typeID);
-               if (!isset($users['com.woltlab.wcf.user']) || empty($users['com.woltlab.wcf.user'])) throw new IllegalLinkException();
+               // get user
+               $this->users = ClipboardHandler::getInstance()->getMarkedItems($this->objectTypeID);
+               if (empty($this->users)) {
+                       throw new IllegalLinkException();
+               }
                
-               // load users
-               $this->userIDs = array_keys($users['com.woltlab.wcf.user']);
-               $this->users = $users['com.woltlab.wcf.user'];
+               $this->userIDs = array_keys($this->users);
        }
        
        /**
@@ -144,7 +144,7 @@ class UserAssignToGroupForm extends AbstractForm {
                        $userEditor->addToGroups($groupsIDs, true, false);
                }
                
-               ClipboardHandler::getInstance()->removeItems($this->typeID);
+               ClipboardHandler::getInstance()->removeItems($this->objectTypeID);
                SessionHandler::resetSessions($this->userIDs);
                
                $this->saved();