/**
  * @see Page::readData()
  */
 public function readData()
 {
     parent::readData();
     // get available groups
     $this->groups = Group::getAccessibleGroups(array(), array(Group::GUESTS, Group::EVERYONE));
     if (!count($_POST)) {
         // default value
         $this->groupID = Group::getGroupIdByType(Group::USERS);
     }
 }
 /**
  * @see Page::readData()
  */
 public function readData()
 {
     parent::readData();
     $this->groups = Group::getAccessibleGroups(array(), array(Group::GUESTS, Group::EVERYONE));
 }
 /**
  * Get a list of available groups.
  */
 protected function readGroups()
 {
     $this->groups = Group::getAccessibleGroups(array(), array(Group::GUESTS, Group::EVERYONE, Group::USERS));
 }
 /**
  * @see Form::save()
  */
 public function save()
 {
     AbstractForm::save();
     // add default groups
     $defaultGroups = Group::getAccessibleGroups(array(Group::GUESTS, Group::EVERYONE, Group::USERS));
     $oldGroupIDArray = $this->user->getGroupIDs();
     foreach ($oldGroupIDArray as $oldGroupID) {
         if (isset($defaultGroups[$oldGroupID])) {
             $this->groupIDs[] = $oldGroupID;
         }
     }
     $this->groupIDs = array_unique($this->groupIDs);
     // save user
     $this->additionalFields['languageID'] = $this->languageID;
     $this->user->update($this->username, $this->email, $this->password, null, $this->activeOptions, $this->additionalFields, $this->visibleLanguages);
     $this->user->addToGroups($this->groupIDs, true, false);
     $this->saved();
     // reset password
     $this->password = $this->confirmPassword = '';
     // show success message
     WCF::getTPL()->assign('success', true);
 }
 /**
  * @see Page::readData()
  */
 public function readData()
 {
     parent::readData();
     // get available groups
     $this->groups = Group::getAccessibleGroups(array(), array(Group::GUESTS, Group::EVERYONE));
     if (!count($_POST)) {
         // default value
         $this->groupID = $this->avatar->groupID;
         $this->neededPoints = $this->avatar->neededPoints;
         $this->avatarCategoryID = $this->avatar->avatarCategoryID;
     }
 }
 /**
  * @see Page::assignVariables()
  */
 public function readData()
 {
     parent::readData();
     if (!count($_POST)) {
         // get marked user ids
         if (empty($this->action)) {
             $markedUsers = WCF::getSession()->getVar('markedUsers');
             if (is_array($markedUsers)) {
                 $this->userIDs = implode(',', $markedUsers);
             }
             if (empty($this->userIDs)) {
                 throw new IllegalLinkException();
             }
         }
     }
     if (!empty($this->userIDs)) {
         $this->users = User::getUsers($this->userIDs);
     }
     $this->groups = Group::getAccessibleGroups(array(), array(Group::GUESTS, Group::EVERYONE));
 }
 /**
  * @see Page::assignVariables()
  */
 public function readData()
 {
     parent::readData();
     if (!count($_POST)) {
         // get marked user ids
         if (empty($this->action)) {
             $markedUsers = WCF::getSession()->getVar('markedUsers');
             if (is_array($markedUsers)) {
                 $this->userIDs = implode(',', $markedUsers);
             }
             if (empty($this->userIDs)) {
                 throw new IllegalLinkException();
             }
         }
         if (MAIL_USE_FORMATTED_ADDRESS) {
             $this->from = MAIL_FROM_NAME . ' <' . MAIL_FROM_ADDRESS . '>';
         } else {
             $this->from = MAIL_FROM_ADDRESS;
         }
     }
     if (!empty($this->userIDs)) {
         $this->users = User::getUsers($this->userIDs);
     }
     $this->groups = Group::getAccessibleGroups(array(), array(Group::GUESTS, Group::EVERYONE));
 }
 /**
  * Returns a list of all available user groups.
  * 
  * @return	array
  */
 protected function getAvailableGroups()
 {
     require_once WCF_DIR . 'lib/data/user/group/Group.class.php';
     return Group::getAccessibleGroups(array(), array(Group::GUESTS, Group::EVERYONE, Group::USERS));
 }