Exemplo n.º 1
0
 /**
  * @see wcf\page\IPage::assignVariables()
  */
 public function assignVariables()
 {
     parent::assignVariables();
     $useRequestData = count($_POST) ? true : false;
     I18nHandler::getInstance()->assignVariables($useRequestData);
     WCF::getTPL()->assign(array('groupID' => $this->group->groupID, 'action' => 'edit'));
     // add warning when the initiator is in the group
     if ($this->group->isMember($this->groupID)) {
         WCF::getTPL()->assign('warningSelfEdit', true);
     }
 }
Exemplo n.º 2
0
 /**
  * Tears down the fixture, for example, closes a network connection.
  * This method is called after a test is executed.
  */
 protected function tearDown()
 {
     foreach ($this->deleteArray as $delete) {
         if (class_exists('UserEditor') && $delete instanceof User) {
             UserEditor::deleteUsers(array($delete->userID));
         } else {
             if (class_exists('GroupEditor') && $delete instanceof Group) {
                 GroupEditor::deleteGroups(array($delete->groupID));
             } else {
                 $delete->delete();
             }
         }
     }
     chdir($this->returndir);
 }
Exemplo n.º 3
0
 /**
  * @see Form::save()
  */
 public function save()
 {
     parent::save();
     // create
     require_once WCF_DIR . 'lib/data/user/group/GroupEditor.class.php';
     $this->group = GroupEditor::create($this->groupName, $this->activeOptions, $this->additionalFields);
     $this->saved();
     // show empty add form
     WCF::getTPL()->assign(array('success' => true, 'newGroup' => $this->group));
     // reset values
     $this->groupName = '';
     foreach ($this->activeOptions as $key => $option) {
         unset($this->activeOptions[$key]['optionValue']);
     }
 }
 /**
  * Gets a list of all global permissions.
  */
 protected function loadGlobalPermissions()
 {
     $this->globalPermissions = array('canViewBoard' => $this->group->getGroupOption('user.board.canViewBoard'), 'canEnterBoard' => $this->group->getGroupOption('user.board.canEnterBoard'), 'canReadThread' => $this->group->getGroupOption('user.board.canReadThread'), 'canReadOwnThread' => $this->group->getGroupOption('user.board.canReadOwnThread'), 'canStartThread' => $this->group->getGroupOption('user.board.canStartThread'), 'canReplyThread' => $this->group->getGroupOption('user.board.canReplyThread'), 'canReplyOwnThread' => $this->group->getGroupOption('user.board.canReplyOwnThread'), 'canStartThreadWithoutModeration' => $this->group->getGroupOption('user.board.canStartThreadWithoutModeration'), 'canReplyThreadWithoutModeration' => $this->group->getGroupOption('user.board.canReplyThreadWithoutModeration'), 'canRateThread' => $this->group->getGroupOption('user.board.canRateThread'), 'canUsePrefix' => $this->group->getGroupOption('user.board.canUsePrefix'), 'canDeleteOwnPost' => $this->group->getGroupOption('user.board.canDeleteOwnPost'), 'canEditOwnPost' => $this->group->getGroupOption('user.board.canEditOwnPost'));
     if (MODULE_THREAD_MARKING_AS_DONE) {
         $this->globalPermissions['canMarkAsDoneOwnThread'] = $this->group->getGroupOption('user.board.canMarkAsDoneOwnThread');
     }
     if (MODULE_TAGGING) {
         $this->globalPermissions['canSetTags'] = $this->group->getGroupOption('user.board.canSetTags');
     }
     if (MODULE_ATTACHMENT) {
         $this->globalPermissions['canUploadAttachment'] = $this->group->getGroupOption('user.board.canUploadAttachment');
         $this->globalPermissions['canDownloadAttachment'] = $this->group->getGroupOption('user.board.canDownloadAttachment');
         $this->globalPermissions['canViewAttachmentPreview'] = $this->group->getGroupOption('user.board.canViewAttachmentPreview');
     }
     if (MODULE_POLL) {
         $this->globalPermissions['canStartPoll'] = $this->group->getGroupOption('user.board.canStartPoll');
         $this->globalPermissions['canVotePoll'] = $this->group->getGroupOption('user.board.canVotePoll');
     }
 }
 /**
  * @see Action::execute()
  */
 public function execute()
 {
     parent::execute();
     // check permission
     WCF::getUser()->checkPermission('admin.user.canDeleteGroup');
     require_once WCF_DIR . 'lib/data/user/group/GroupEditor.class.php';
     if ($this->groupID !== 0) {
         $this->groupIDs[] = $this->groupID;
     }
     // check permission
     if (!Group::isAccessibleGroup($this->groupIDs)) {
         throw new PermissionDeniedException();
     }
     // check master password
     WCFACP::checkMasterPassword();
     $deletedGroups = GroupEditor::deleteGroups($this->groupIDs);
     $this->executed();
     HeaderUtil::redirect('index.php?page=GroupList&deletedGroups=' . $deletedGroups . '&packageID=' . PACKAGE_ID . SID_ARG_2ND_NOT_ENCODED);
     exit;
 }
Exemplo n.º 6
0
 /**
  * Clears the cache of all groups.
  */
 public static function clearCache()
 {
     self::$cache = null;
     WCF::getCache()->clear(WCF_DIR . 'cache', 'cache.groups*.php', true);
 }