/**
  * @see AbstractAction::executed()
  */
 protected function executed()
 {
     parent::executed();
     // forward to list page
     HeaderUtil::redirect('index.php?page=BBCodeList&packageID=' . PACKAGE_ID . SID_ARG_2ND_NOT_ENCODED);
     exit;
 }
 /**
  * @see AbstractAction::executed()
  */
 protected function executed()
 {
     AbstractAction::executed();
     // forward to list page
     HeaderUtil::redirect('index.php?page=BBCodeList&deletedBBCodeID=' . $this->bbcodeID . '&packageID=' . PACKAGE_ID . SID_ARG_2ND_NOT_ENCODED);
     exit;
 }
 /**
  * @see Action::execute();
  */
 public function execute()
 {
     parent::execute();
     SpiderEditor::synchronize();
     HeaderUtil::redirect('index.php?page=AdminToolsSpiderList&packageID=' . PACKAGE_ID . SID_ARG_2ND_NOT_ENCODED);
     exit;
 }
 /**
  * @see AbstractAction::execute()
  */
 public function execute()
 {
     parent::execute();
     $subscriber = new NewsletterSubscriber($this->subscriberID);
     //deletes user subscribers
     $sql = 'DELETE FROM wcf' . WCF_N . '_' . $this->activationTable . '
     		WHERE userID = ' . intval($subscriber->userID);
     WCF::getDB()->sendQuery($sql);
     //resets user setting
     $user = new UserEditor($subscriber->userID);
     $options = array('acceptNewsletter' => 0);
     $user->updateOptions($options);
     //deletes guest subscribers
     $sql = 'DELETE FROM wcf' . WCF_N . '_' . $this->guestActivationTable . '
     		WHERE subscriberID = ' . $this->subscriberID;
     WCF::getDB()->sendQuery($sql);
     //deletes unsubscribe tokens
     $sql = 'DELETE FROM wcf' . WCF_N . '_' . $this->unsubscriptionTable . '
             WHERE subscriberID = ' . $this->subscriberID;
     WCF::getDB()->sendQuery($sql);
     $sql = 'DELETE FROM wcf' . WCF_N . '_' . $this->subscriberTable . '
     		WHERE subscriberID = ' . $this->subscriberID;
     WCF::getDB()->sendQuery($sql);
     $this->executed();
     //clear cache
     $cacheName = 'newsletter-subscriber-' . PACKAGE_ID;
     WCF::getCache()->clear(WCF_DIR . 'cache/', 'cache.' . $cacheName . '.php');
     HeaderUtil::redirect('index.php?page=NewsletterSubscriberList&result=success&packageID=' . PACKAGE_ID . SID_ARG_2ND_NOT_ENCODED);
     exit;
 }
 /**
  * @see Action::execute()
  */
 public function execute()
 {
     parent::execute();
     WCF::getUser()->checkPermission('admin.user.canDeleteUser');
     require_once WCF_DIR . 'lib/data/user/UserEditor.class.php';
     require_once WCF_DIR . 'lib/data/user/group/Group.class.php';
     if ($this->userID !== 0) {
         $this->userIDs[] = $this->userID;
     }
     // active user can't delete himself
     $activeUserID = WCF::getSession()->getUser()->userID;
     $this->userIDs = array_diff($this->userIDs, array($activeUserID));
     // check permission
     if (count($this->userIDs) > 0) {
         $sql = "SELECT\tDISTINCT groupID\n\t\t\t\tFROM\twcf" . WCF_N . "_user_to_groups\n\t\t\t\tWHERE\tuserID IN (" . implode(',', $this->userIDs) . ")";
         $result = WCF::getDB()->sendQuery($sql);
         while ($row = WCF::getDB()->fetchArray($result)) {
             if (!Group::isAccessibleGroup($row['groupID'])) {
                 throw new PermissionDeniedException();
             }
         }
     }
     $deletedUsers = UserEditor::deleteUsers($this->userIDs);
     $this->executed();
     if (!empty($this->url) && (strpos($this->url, 'searchID=0') !== false || strpos($this->url, 'searchID=') === false)) {
         HeaderUtil::redirect($this->url);
     } else {
         HeaderUtil::redirect('index.php?form=UserSearch&deletedUsers=' . $deletedUsers . '&packageID=' . PACKAGE_ID . SID_ARG_2ND_NOT_ENCODED);
     }
     exit;
 }
 /**
  * @see Action::execute()
  */
 public function execute()
 {
     parent::execute();
     // check permission
     WCF::getUser()->checkPermission('admin.template.canDeleteTemplate');
     if (!count($this->templateID)) {
         throw new IllegalLinkException();
     }
     // delete templates (files)
     $templateIDs = '';
     require_once WCF_DIR . 'lib/data/template/TemplateEditor.class.php';
     $sql = "SELECT\t\ttemplate.*, pack.templatePackFolderName, package.packageDir\n\t\t\tFROM\t\twcf" . WCF_N . "_template template\n\t\t\tLEFT JOIN\twcf" . WCF_N . "_template_pack pack\n\t\t\tON\t\t(pack.templatePackID = template.templatePackID)\n\t\t\tLEFT JOIN\twcf" . WCF_N . "_package package\n\t\t\tON\t\t(package.packageID = template.packageID)\n\t\t\tWHERE\t\ttemplate.templateID IN (" . implode(',', $this->templateID) . ")\n\t\t\t\t\tAND template.templatePackID > 0";
     $result = WCF::getDB()->sendQuery($sql);
     while ($row = WCF::getDB()->fetchArray($result)) {
         if (!empty($templateIDs)) {
             $templateIDs .= ',';
         }
         $templateIDs .= $row['templateID'];
         $template = new TemplateEditor(null, $row);
         if ($template->templateID) {
             $template->deleteFile();
         }
     }
     // delete database entries
     if (!empty($templateIDs)) {
         TemplateEditor::deleteAll($templateIDs);
     }
     // reset cache
     WCF::getCache()->clear(WCF_DIR . 'cache', 'cache.templates-*.php');
     $this->executed();
     // forward to list page
     HeaderUtil::redirect('index.php?page=TemplateList&deletedTemplates=' . count($this->templateID) . '&templatePackID=' . $this->templatePackID . '&packageID=' . PACKAGE_ID . SID_ARG_2ND_NOT_ENCODED);
     exit;
 }
 /**
  * @see	Action::execute()
  */
 public function execute()
 {
     parent::execute();
     // remove entries
     DynamicPageEditor::remove($this->pageID);
     $this->page->moduleManager->remove();
     // clear cache
     DynamicPageEditor::clearCache($this->pageID, $this->page->hostID);
     // page menu entry
     if ($this->page->menuItemID) {
         require_once WCF_DIR . 'lib/data/page/menu/PageMenuItemEditor.class.php';
         // create editor object
         $menuItem = new PageMenuItemEditor($this->page->menuItemID);
         // remove item
         $menuItem->remove();
         // clear cache
         PageMenuItemEditor::clearCache();
     }
     // send redirect headers
     if (!isset($_REQUEST['ajax'])) {
         HeaderUtil::redirect('index.php?page=DynamicPageList&hostID=' . $this->page->hostID . '&packageID=' . PACKAGE_ID . SID_ARG_2ND_NOT_ENCODED);
     }
     // call event
     $this->executed();
 }
 /**
  * @see Action::execute()
  */
 public function execute()
 {
     AbstractAction::execute();
     // check permission
     WCF::getUser()->checkPermission('admin.user.canBanUser');
     if (count($this->userIDs) > 0) {
         // check permission
         $sql = "SELECT\tDISTINCT groupID\n\t\t\t\tFROM\twcf" . WCF_N . "_user_to_groups\n\t\t\t\tWHERE\tuserID IN (" . implode(',', $this->userIDs) . ")";
         $result = WCF::getDB()->sendQuery($sql);
         while ($row = WCF::getDB()->fetchArray($result)) {
             if (!Group::isAccessibleGroup($row['groupID'])) {
                 throw new PermissionDeniedException();
             }
         }
         // update user
         $sql = "UPDATE\twcf" . WCF_N . "_user\n\t\t\t\tSET\tbanned = 0\n\t\t\t\tWHERE\tuserID IN (" . implode(',', $this->userIDs) . ")";
         WCF::getDB()->sendQuery($sql);
         // unmark users
         UserEditor::unmarkAll();
         // reset sessions
         Session::resetSessions($this->userIDs);
     }
     $this->executed();
     if (!empty($this->url)) {
         HeaderUtil::redirect($this->url);
     } else {
         // set active menu item
         WCFACP::getMenu()->setActiveMenuItem('wcf.acp.menu.link.user.management');
         // show succes message
         WCF::getTPL()->assign('message', 'wcf.acp.user.unban.success');
         WCF::getTPL()->display('success');
     }
     exit;
 }
 /**
  * @see Action::execute()
  */
 protected function executed()
 {
     parent::executed();
     // forward
     HeaderUtil::redirect('index.php?page=AdminToolsCronjobsList&deleteJob=' . $this->cronjobID . '&packageID=' . PACKAGE_ID . SID_ARG_2ND_NOT_ENCODED);
     exit;
 }
 /**
  * @see AbstractAction::executed()
  */
 protected function executed()
 {
     parent::executed();
     if (empty($_REQUEST['ajax'])) {
         HeaderUtil::redirect('index.php?page=Board&boardID=' . $this->boardID . SID_ARG_2ND_NOT_ENCODED);
     }
     exit;
 }
 /**
  * @see Form::save()
  */
 public function save()
 {
     MessageForm::save();
     //$this->entry->update()
     $this->saved();
     HeaderUtil::redirect('index.php?page=CheatDatabaseEntry&entryID=' . $this->entry->entryID . SID_ARG_2ND_NOT_ENCODED);
     exit;
 }
 /**
  * @see Action::execute()
  */
 public function execute()
 {
     $sql = "UPDATE\twcf" . WCF_N . "_user_guestbook\n\t\t\tSET\tcommentIsDeleted = 1,\n\t\t\t\tcommentDeleteTime = " . TIME_NOW . ",\n\t\t\t\tcommentDeletedBy = '" . escapeString(WCF::getUser()->username) . "',\n\t\t\t\tcommentDeletedByID = " . WCF::getUser()->userID . "\n\t\t\tWHERE\tentryID = " . $this->entry->entryID;
     WCF::getDB()->sendQuery($sql);
     $this->executed();
     HeaderUtil::redirect('index.php?page=UserGuestbook&userID=' . $this->entry->ownerID . '&entryID=' . $this->entry->entryID . SID_ARG_2ND_NOT_ENCODED . '#entry' . $this->entry->entryID);
     exit;
 }
 /**
  * Sets the global board last visit timestamp.
  */
 public function setLastVisitTime($timestamp)
 {
     $this->lastVisitTime = $timestamp;
     // cookie
     HeaderUtil::setCookie('boardLastVisitTime', $this->lastVisitTime, TIME_NOW + 365 * 24 * 3600);
     // session
     SessionFactory::getActiveSession()->register('boardLastVisitTime', $this->lastVisitTime);
 }
 /**
  * @see Action::execute()
  */
 public function execute()
 {
     parent::execute();
     WCF::getUser()->checkPermission('mod.cheatDatabase.canDeleteEntry');
     $this->entry->delete();
     $this->executed();
     HeaderUtil::redirect('index.php?page=CheatDatabaseEntryList&deletedEntryID=' . $this->entryID . SID_ARG_2ND_NOT_ENCODED);
     exit;
 }
 /**
  * @see Action::execute()
  */
 public function execute()
 {
     parent::execute();
     // delete participant
     $this->participant->delete();
     $this->executed();
     // forward
     HeaderUtil::redirect('index.php?page=ContestParticipant&contestID=' . $this->participant->contestID . SID_ARG_2ND_NOT_ENCODED);
     exit;
 }
 /**
  * @see Form::save()
  */
 public function save()
 {
     parent::save();
     // save price
     ContestPriceEditor::updatePositions($this->pricePositionPositions);
     $this->saved();
     // forward
     HeaderUtil::redirect('index.php?page=ContestPrice&contestID=' . $this->contest->contestID . SID_ARG_2ND_NOT_ENCODED);
     exit;
 }
 /**
  * @see Action::execute()
  */
 public function execute()
 {
     parent::execute();
     // enable signature
     $this->user->updateFields(array('disableSignature' => 0));
     $this->executed();
     // forward
     HeaderUtil::redirect('index.php?page=User&userID=' . $this->userID . SID_ARG_2ND_NOT_ENCODED);
     exit;
 }
 /**
  * @see Form::save()
  */
 public function save()
 {
     AbstractForm::save();
     // save sponsortalk
     $this->entry->update($this->message);
     $this->saved();
     // forward
     HeaderUtil::redirect('index.php?page=ContestSponsortalk&contestID=' . $this->entry->contestID . '&sponsortalkID=' . $this->entry->sponsortalkID . SID_ARG_2ND_NOT_ENCODED . '#sponsortalk' . $this->entry->sponsortalkID);
     exit;
 }
 /**
  * @see Form::save()
  */
 public function save()
 {
     parent::save();
     // save rating
     ContestSolutionRatingEditor::updateRatings($this->solutionObj->solutionID, WCF::getUser()->userID, $this->optionIDs);
     $this->saved();
     // forward
     HeaderUtil::redirect('index.php?page=ContestSolutionEntry&contestID=' . $this->solutionObj->contestID . '&solutionID=' . $this->solutionObj->solutionID);
     exit;
 }
 /**
  * @see Action::execute()
  */
 public function execute()
 {
     parent::execute();
     // enable rule
     $this->rule->enable();
     $this->executed();
     // forward
     HeaderUtil::redirect('index.php?page=PMRuleList' . SID_ARG_2ND_NOT_ENCODED);
     exit;
 }
 /**
  * @see Form::save()
  */
 public function save()
 {
     AbstractForm::save();
     // save entry
     $this->entry->update($this->entry->contestID, $this->entry->userID, $this->entry->groupID, $this->state);
     $this->saved();
     // forward
     HeaderUtil::redirect('index.php?page=ContestSponsor&contestID=' . $this->entry->contestID . SID_ARG_2ND_NOT_ENCODED . '#entry' . $this->entry->sponsorID);
     exit;
 }
 /**
  * @see Form::save()
  */
 public function save()
 {
     AbstractForm::save();
     // save price
     $this->entry->update($this->subject, $this->text, $this->secretMessage, $this->state, $this->attachmentListEditor);
     $this->saved();
     // forward
     HeaderUtil::redirect('index.php?page=ContestPrice&contestID=' . $this->entry->contestID . '&priceID=' . $this->entry->priceID . SID_ARG_2ND_NOT_ENCODED . '#priceObj' . $this->entry->priceID);
     exit;
 }
 /**
  * @see Action::execute()
  */
 public function execute()
 {
     parent::execute();
     // remember
     $interaction = new ContestInteraction($this->contest);
     $interaction->close();
     // redirect
     HeaderUtil::redirect('index.php?page=Contest' . '&contestID=' . $this->contestID . SID_ARG_2ND_NOT_ENCODED);
     $this->executed();
 }
 /**
  * @see Action::execute()
  */
 public function execute()
 {
     parent::execute();
     // delete jurytalk
     $this->jurytalk->delete();
     $this->executed();
     // forward
     HeaderUtil::redirect('index.php?page=ContestJurytalk&contestID=' . $this->jurytalk->contestID . SID_ARG_2ND_NOT_ENCODED);
     exit;
 }
 /**
  * @see Form::save()
  */
 public function save()
 {
     CaptchaForm::save();
     // save solution
     $this->entry->update($this->solution);
     $this->saved();
     // forward
     HeaderUtil::redirect('index.php?page=Contest&contestID=' . $this->entry->contestID . '&solutionID=' . $this->entry->solutionID . SID_ARG_2ND_NOT_ENCODED . '#solution' . $this->entry->solutionID);
     exit;
 }
 /**
  * @see Form::save()
  */
 public function save()
 {
     parent::save();
     // save jurytalk
     $jurytalk = ContestJurytalkEditor::create($this->contest->contestID, $this->message, WCF::getUser()->userID, WCF::getUser()->username);
     $this->saved();
     // forward
     HeaderUtil::redirect('index.php?page=ContestJurytalk&contestID=' . $this->contest->contestID . '&jurytalkID=' . $jurytalk->jurytalkID . SID_ARG_2ND_NOT_ENCODED . '#jurytalk' . $jurytalk->jurytalkID);
     exit;
 }
 /**
  * @see Form::save()
  */
 public function save()
 {
     MessageForm::save();
     // save solution
     $this->entry->update($this->text, $this->state, $this->getOptions(), $this->attachmentListEditor);
     $this->saved();
     // forward
     HeaderUtil::redirect('index.php?page=ContestSolutionEntry' . '&contestID=' . $this->entry->contestID . '&solutionID=' . $this->entry->solutionID . SID_ARG_2ND_NOT_ENCODED . '#solution' . $this->entry->solutionID);
     exit;
 }
 /**
  * @see Action::execute()
  */
 public function execute()
 {
     parent::execute();
     // delete entries
     $sql = "DELETE FROM\twcf" . WCF_N . "_user_blacklist\n\t\t\tWHERE\t\tuserID = " . WCF::getUser()->userID;
     WCF::getDB()->sendQuery($sql);
     $this->executed();
     // forward
     HeaderUtil::redirect('index.php?form=BlackListEdit' . SID_ARG_2ND_NOT_ENCODED);
     exit;
 }
Ejemplo n.º 29
0
 /**
  * Does the user authentication.
  */
 protected function initAuth()
 {
     if ((!isset($_REQUEST['page']) || $_REQUEST['page'] != 'Logout' && $_REQUEST['page'] != 'ACPCaptcha') && (isset($_REQUEST['page']) || !isset($_REQUEST['form']) || $_REQUEST['form'] != 'Login')) {
         if (WCF::getUser()->userID == 0) {
             HeaderUtil::redirect('index.php?form=Login&packageID=' . PACKAGE_ID . SID_ARG_2ND_NOT_ENCODED);
             exit;
         } else {
             WCF::getUser()->checkPermission('admin.general.canUseAcp');
         }
     }
 }
 /**
  * @see LogoutAction::doLogout()
  */
 protected function doLogout()
 {
     parent::doLogout();
     // remove cookies
     if (isset($_COOKIE[COOKIE_PREFIX . 'userID'])) {
         HeaderUtil::setCookie('userID', 0);
     }
     if (isset($_COOKIE[COOKIE_PREFIX . 'password'])) {
         HeaderUtil::setCookie('password', '');
     }
 }