コード例 #1
0
 /**
  * @see	Action::execute()
  */
 public function execute()
 {
     parent::execute();
     $this->sourceFileEditor->delete();
     $this->executed();
     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;
 }
コード例 #3
0
 /**
  * @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;
 }
コード例 #4
0
 /**
  * @see Action::execute()
  */
 public function execute()
 {
     parent::execute();
     // remove quotes
     MultiQuoteManager::removeQuote($this->quoteID);
     MultiQuoteManager::saveStorage();
     $this->executed();
 }
コード例 #5
0
 /**
  * @see Action::execute()
  */
 public function execute()
 {
     parent::execute();
     // remove quotes
     MultiQuoteManager::removeQuotes($this->objectID, $this->objectType);
     MultiQuoteManager::saveStorage();
     $this->executed();
 }
 /**
  * @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;
 }
コード例 #7
0
 /**
  * @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;
 }
コード例 #8
0
 /**
  * @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();
 }
コード例 #9
0
 /**
  * @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;
 }
コード例 #10
0
 /**
  * @see Action::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     if (isset($_REQUEST['ruleID'])) {
         $this->ruleID = intval($_REQUEST['ruleID']);
     }
     $this->rule = new PMRuleEditor($this->ruleID);
     if (!$this->rule->ruleID || !WCF::getUser()->userID || $this->rule->userID != WCF::getUser()->userID) {
         throw new IllegalLinkException();
     }
 }
コード例 #11
0
 /**
  * @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;
 }
コード例 #12
0
 /**
  * @see	Action::execute()
  */
 public function execute()
 {
     parent::execute();
     if (!file_exists($this->sourceFile->getPath())) {
         throw new SystemException("Requested file '" . $this->sourceFile->filename . "' for source identified by '" . $this->sourceFile->sourceID . "' is missing.");
     }
     @header('Content-Type: application/x-gzip');
     @header('Content-length: ' . filesize($this->sourceFile->getPath()));
     @header('Content-disposition: attachment; filename="' . $this->sourceFile->filename . '"');
     readfile($this->sourceFile->getPath());
     exit;
 }
コード例 #13
0
 /**
  * @see Action::execute()
  */
 public function execute()
 {
     parent::execute();
     // delete entry
     $this->entry->delete();
     $this->executed();
     // forward
     if (empty($_REQUEST['ajax'])) {
         HeaderUtil::redirect('index.php?page=ContestOverview' . SID_ARG_2ND_NOT_ENCODED);
     }
     exit;
 }
コード例 #14
0
 /**
  * @see	Action::execute()
  */
 public function execute()
 {
     parent::execute();
     $this->readCache();
     $this->resolveDependencies($this->hash);
     $packages = $this->buildPackageData();
     $resources = $this->getResources();
     // send JSON response
     $json = JSON::encode(array($packages, $resources));
     header('Content-type: application/json');
     echo $json;
     exit;
 }
コード例 #15
0
 /**
  * @see Action::execute()
  */
 public function execute()
 {
     parent::execute();
     // validate
     $this->validate();
     // do logout
     $this->doLogout();
     $this->executed();
     // forward to index page
     // warning: if doLogout() writes a cookie this is buggy in MS IIS
     HeaderUtil::redirect('index.php?packageID=' . PACKAGE_ID . SID_ARG_2ND_NOT_ENCODED);
     exit;
 }
コード例 #16
0
 /**
  * @see Action::execute()
  */
 public function execute()
 {
     parent::execute();
     // get pm ids
     switch ($this->folderID) {
         // outbox
         case PMFolderList::FOLDER_OUTBOX:
             $sql = "SELECT\t\tpmID \n\t\t\t\t\tFROM \t\twcf" . WCF_N . "_pm\n\t\t\t\t\tWHERE \t\tuserID = " . WCF::getUser()->userID . "\n\t\t\t\t\t\t\tAND saveInOutbox = 1";
             break;
             // drafts
         // drafts
         case PMFolderList::FOLDER_DRAFTS:
             $sql = "SELECT\t\tpmID \n\t\t\t\t\tFROM \t\twcf" . WCF_N . "_pm\n\t\t\t\t\tWHERE \t\tuserID = " . WCF::getUser()->userID . "\n\t\t\t\t\t\t\tAND isDraft = 1";
             break;
             // trash
         // trash
         case PMFolderList::FOLDER_TRASH:
             $sql = "SELECT\t\tpmID\n\t\t\t\t\tFROM\t\twcf" . WCF_N . "_pm_to_user\n\t\t\t\t\tWHERE\t\trecipientID = " . WCF::getUser()->userID . "\n\t\t\t\t\t\t\tAND isDeleted = 1";
             break;
             // inbox & own folders
         // inbox & own folders
         default:
             $sql = "SELECT\t\tpmID\n\t\t\t\t\tFROM\t\twcf" . WCF_N . "_pm_to_user\n\t\t\t\t\tWHERE\t\trecipientID = " . WCF::getUser()->userID . "\n\t\t\t\t\t\t\tAND isDeleted = 0\n\t\t\t\t\t\t\tAND folderID = " . $this->folderID;
     }
     $pmIDArray = array();
     $result = WCF::getDB()->sendQuery($sql);
     while ($row = WCF::getDB()->fetchArray($result)) {
         $pmIDArray[] = $row['pmID'];
     }
     // update session
     $markedMessages = PMAction::getMarkedMessages();
     if ($markedMessages == null || !is_array($markedMessages)) {
         WCF::getSession()->register('markedPMs', $pmIDArray);
     } else {
         $update = false;
         foreach ($pmIDArray as $pmID) {
             if (!in_array($pmID, $markedMessages)) {
                 array_push($markedMessages, $pmID);
                 $update = true;
             }
         }
         if ($update) {
             WCF::getSession()->register('markedPMs', $markedMessages);
         }
     }
     WCF::getSession()->update();
     WCF::getSession()->disableUpdate(true);
     $this->executed();
     HeaderUtil::redirect('index.php?page=PMList&folderID=' . $this->folderID . SID_ARG_2ND_NOT_ENCODED);
     exit;
 }
コード例 #17
0
 /**
  * @see AbstractAction::execute()
  */
 public function execute()
 {
     parent::execute();
     $sql = 'DELETE FROM wcf' . WCF_N . '_' . $this->databaseTable . '
     		WHERE newsletterID = ' . $this->newsletterID;
     WCF::getDB()->sendQuery($sql);
     $this->executed();
     //resetting cache
     $cacheName = 'newsletter-' . PACKAGE_ID;
     $cacheResource = array('cache' => $cacheName, 'file' => WCF_DIR . 'cache/cache.' . $cacheName . '.php', 'className' => 'CacheBuilderNewsletter', 'classFile' => WCF_DIR . 'lib/system/cache/CacheBuilderNewsletter.class.php', 'minLifetime' => 0, 'maxLifetime' => 0);
     WCF::getCache()->rebuild($cacheResource);
     HeaderUtil::redirect('index.php?page=NewsletterList&result=success&packageID=' . PACKAGE_ID . SID_ARG_2ND_NOT_ENCODED);
     exit;
 }
 /**
  * @see Action::execute()
  */
 public function execute()
 {
     parent::execute();
     $subscriber = new NewsletterSubscriber($this->subscriberID);
     if ($subscriber->userID) {
         $user = new User($subscriber->userID);
         NewsletterUtil::sendUserValidationEmail($user);
     } else {
         NewsletterUtil::sendGuestValidationEmail($subscriber);
     }
     $this->executed();
     HeaderUtil::redirect('index.php?page=NewsletterSubscriberList&success=success&packageID=' . PACKAGE_ID . SID_ARG_2ND_NOT_ENCODED);
     exit;
 }
コード例 #19
0
 /**
  * @see Action::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     if (isset($_POST['userIDs'])) {
         $this->userIDs = ArrayUtil::toIntegerArray($_POST['userIDs']);
     }
     if (isset($_POST['groupID'])) {
         $this->groupID = intval($_POST['groupID']);
     }
     $this->group = new Group($this->groupID);
     if (!$this->group->groupID) {
         throw new IllegalLinkException();
     }
 }
 /**
  * @see Action::execute()
  */
 public function execute()
 {
     parent::execute();
     // delete entries
     $sql = "UPDATE\twcf" . WCF_N . "_user_whitelist\n\t\t\tSET\tnotified = 1\n\t\t\tWHERE\twhiteUserID = " . WCF::getUser()->userID . "\n\t\t\t\tAND confirmed = 0";
     WCF::getDB()->sendQuery($sql);
     // update session
     WCF::getSession()->resetUserData();
     $this->executed();
     // forward
     if (!isset($_REQUEST['ajax'])) {
         HeaderUtil::redirect('index.php?form=WhiteListEdit' . SID_ARG_2ND_NOT_ENCODED);
     }
     exit;
 }
 /**
  * @see Action::execute()
  */
 public function execute()
 {
     parent::execute();
     // check permissions
     if (!WCF::getUser()->userID) {
         throw new IllegalLinkException();
     }
     // decline all invitations
     $sql = "DELETE FROM\twcf" . WCF_N . "_user_whitelist\n\t\t\tWHERE\t\twhiteUserID = " . WCF::getUser()->userID . "\n\t\t\t\t\tAND confirmed = 0";
     WCF::getDB()->sendQuery($sql);
     $this->executed();
     // forward
     HeaderUtil::redirect('index.php?form=WhiteListEdit' . SID_ARG_2ND_NOT_ENCODED);
     exit;
 }
コード例 #22
0
 /**
  * @see	Action::execute()
  */
 public function execute()
 {
     parent::execute();
     $packages = array();
     $sql = "SELECT\thash, version, directory\r\n\t\t\tFROM\tpb" . PB_N . "_source_package\r\n\t\t\tWHERE\tpackageName = '" . escapeString($this->packageName) . "'";
     $result = WCF::getDB()->sendQuery($sql);
     while ($row = WCF::getDB()->fetchArray($result)) {
         $packages[] = $row;
     }
     $packages = self::orderVersions($packages);
     $json = JSON::encode($packages);
     // send JSON response
     header('Content-type: application/json');
     echo $json;
     exit;
 }
コード例 #23
0
 /**
  * @see Action::execute()
  */
 public function execute()
 {
     parent::execute();
     switch ($this->contestAction) {
         case 'add':
             $participantID = 0;
             $interest = ContestPriceInterestEditor::add($this->priceID, $participantID);
             break;
         case 'delete':
             $interest = new ContestPriceInterestEditor($this->interestID);
             $interest->delete();
             break;
     }
     // redirect
     HeaderUtil::redirect('index.php?page=ContestPrice' . '&priceID=' . $this->priceID . SID_ARG_2ND_NOT_ENCODED);
     $this->executed();
 }
コード例 #24
0
 /**
  * @see Action::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     // check module
     if (MODULE_AVATAR != 1) {
         throw new IllegalLinkException();
     }
     // check permission
     WCF::getUser()->checkPermission('admin.user.canEditUser');
     // get user
     if (isset($_REQUEST['userID'])) {
         $this->userID = intval($_REQUEST['userID']);
     }
     $this->user = new UserEditor($this->userID);
     if (!$this->user->userID) {
         throw new IllegalLinkException();
     }
 }
 /**
  * @see Action::execute()
  */
 public function execute()
 {
     parent::execute();
     // check permission
     if (!WCF::getUser()->userID) {
         throw new PermissionDeniedException();
     }
     if (MODULE_MODERATED_USER_GROUP != 1) {
         throw new IllegalLinkException();
     }
     // delete applications
     if (count($this->applicationIDs)) {
         $sql = "DELETE FROM\twcf" . WCF_N . "_group_application\n\t\t\t\tWHERE\t\tapplicationID IN (" . implode(',', $this->applicationIDs) . ")\n\t\t\t\t\t\tAND groupID IN (\n\t\t\t\t\t\t\tSELECT\tgroupID\n\t\t\t\t\t\t\tFROM\twcf" . WCF_N . "_group_leader\n\t\t\t\t\t\t\tWHERE\tleaderUserID = " . WCF::getUser()->userID . "\n\t\t\t\t\t\t\t\tOR leaderGroupID IN (" . implode(',', WCF::getUser()->getGroupIDs()) . ")\n\t\t\t\t\t\t)";
         WCF::getDB()->sendQuery($sql);
     }
     $this->executed();
     HeaderUtil::redirect('index.php?page=UserGroupLeader' . SID_ARG_2ND_NOT_ENCODED);
     exit;
 }
コード例 #26
0
 /**
  * @see Action::execute()
  */
 public function execute()
 {
     parent::execute();
     // delete old user avatar if necessary
     if ($this->avatarType == 'user') {
         $this->avatar->delete();
         $this->avatar = null;
     }
     // update user
     $sql = "UPDATE\twcf" . WCF_N . "_user\n\t\t\tSET\tavatarID = 0,\n\t\t\t\tgravatar = ''\n\t\t\tWHERE\tuserID = " . WCF::getUser()->userID;
     WCF::getDB()->sendQuery($sql);
     // reset session
     WCF::getSession()->resetUserData();
     // forward
     if (empty($_REQUEST['ajax'])) {
         HeaderUtil::redirect('index.php?form=AvatarEdit' . SID_ARG_2ND_NOT_ENCODED);
         exit;
     }
 }
コード例 #27
0
 /**
  * @see Action::execute()
  */
 public function execute()
 {
     parent::execute();
     // save pm
     $sql = "INSERT INTO\twcf" . WCF_N . "_pm\n\t\t\t\t\t(userID, username, subject, message, time)\n\t\t\tVALUES\t\t(" . WCF::getUser()->userID . ", '" . escapeString(WCF::getUser()->username) . "', '" . escapeString($this->subject) . "', '" . escapeString($this->text) . "', " . TIME_NOW . ")";
     WCF::getDB()->sendQuery($sql);
     $pmID = WCF::getDB()->getInsertID("wcf" . WCF_N . "_pm", 'pmID');
     // save recipients
     $sql = "INSERT INTO\twcf" . WCF_N . "_pm_to_user\n\t\t\t\t\t(pmID, recipientID, recipient, isBlindCopy)\n\t\t\tSELECT\t\t" . $pmID . ", user_to_groups.userID, user_table.username, 1\n\t\t\tFROM\t\twcf" . WCF_N . "_user_to_groups user_to_groups\n\t\t\tLEFT JOIN\twcf" . WCF_N . "_user user_table\n\t\t\tON\t\t(user_table.userID = user_to_groups.userID)\n\t\t\tWHERE\t\tuser_to_groups.groupID = " . $this->groupID;
     WCF::getDB()->sendQuery($sql);
     // update counters
     $sql = "UPDATE\twcf" . WCF_N . "_user\n\t\t\tSET\tpmUnreadCount = pmUnreadCount + 1,\n\t\t\t\tpmOutstandingNotifications = pmOutstandingNotifications + 1\n\t\t\tWHERE\tuserID IN (\n\t\t\t\t\tSELECT\tuserID\n\t\t\t\t\tFROM\twcf" . WCF_N . "_user_to_groups\n\t\t\t\t\tWHERE\tgroupID = " . $this->groupID . "\n\t\t\t\t)";
     WCF::getDB()->sendQuery($sql);
     // reset sessions
     Session::resetSessions(array(), true, false);
     $this->executed();
     HeaderUtil::redirect('index.php?form=UserGroupAdministrate&groupID=' . $this->groupID . '&pmSuccess=1' . SID_ARG_2ND_NOT_ENCODED);
     exit;
 }
コード例 #28
0
 /**
  * @see Action::execute()
  */
 public function execute()
 {
     parent::execute();
     // check permission
     if (!WCF::getUser()->userID || $this->group->groupType != 5 || in_array($this->group->groupID, WCF::getUser()->getGroupIDs())) {
         throw new PermissionDeniedException();
     }
     if (MODULE_MODERATED_USER_GROUP != 1) {
         throw new IllegalLinkException();
     }
     // add user
     $editor = WCF::getUser()->getEditor();
     $editor->addToGroup($this->group->groupID);
     // reset session
     WCF::getSession()->resetUserData();
     $this->executed();
     HeaderUtil::redirect('index.php?page=UserGroups' . SID_ARG_2ND_NOT_ENCODED);
     exit;
 }
コード例 #29
0
 /**
  * @see	Action::execute()
  */
 public function execute()
 {
     parent::execute();
     $response = array();
     // validate profile name
     $sql = "SELECT\tCOUNT(*) AS count\r\n\t\t\tFROM\tpb" . PB_N . "_build_profile\r\n\t\t\tWHERE\tprofileName = '" . escapeString($this->profileName) . "'";
     $row = WCF::getDB()->getFirstRow($sql);
     if ($row['count'] == 0) {
         // create new profile
         $sql = "INSERT INTO\tpb" . PB_N . "_build_profile\r\n\t\t\t\t\t\t(packages, packageHash, packageName, profileHash, profileName, resource)\r\n\t\t\t\tVALUES\t\t('" . escapeString(serialize($this->packages)) . "',\r\n\t\t\t\t\t\t'" . escapeString($this->packageHash) . "',\r\n\t\t\t\t\t\t'" . escapeString($this->packageName) . "',\r\n\t\t\t\t\t\t'" . escapeString(StringUtil::getRandomID()) . "',\r\n\t\t\t\t\t\t'" . escapeString($this->profileName) . "',\r\n\t\t\t\t\t\t'" . escapeString($this->resource) . "')";
         WCF::getDB()->sendQuery($sql);
         // clear cache
         WCF::getCache()->clear(PB_DIR . 'cache/', 'cache.build-profiles.php');
         // call executed event
         $this->executed();
         // send notification
         $this->sendResponse('pb.build.profile.success');
     } else {
         // profile is not unique
         $this->sendResponse('pb.build.profile.error.notUnique', true);
     }
 }
コード例 #30
0
 /**
  * @see Action::execute()
  */
 public function execute()
 {
     parent::execute();
     // remember
     ContestPromotionUtil::updateList($this->contestID);
     $this->executed();
     switch ($this->contestAction) {
         case 'participate':
             if (WCF::getUser()->userID == 0) {
                 // forward
                 HeaderUtil::redirect('index.php?page=Contest' . '&contestID=' . $this->contestID . SID_ARG_2ND_NOT_ENCODED);
             } else {
                 $state = $this->contest->enableParticipantCheck ? 'applied' : 'accepted';
                 // add participant
                 require_once WCF_DIR . 'lib/data/contest/participant/ContestParticipantEditor.class.php';
                 $participant = ContestParticipantEditor::create($this->contestID, WCF::getUser()->userID, 0, $state);
                 // forward
                 HeaderUtil::redirect('index.php?page=ContestParticipant' . '&contestID=' . $this->contestID . '&participantID=' . $participant->participantID . SID_ARG_2ND_NOT_ENCODED . '#participant' . $participant->participantID);
             }
             break;
     }
 }