/** * @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; }
/** * @see Action::execute() */ public function execute() { parent::execute(); // remove quotes MultiQuoteManager::removeQuote($this->quoteID); MultiQuoteManager::saveStorage(); $this->executed(); }
/** * @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; }
/** * @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 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 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; }
/** * @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; }
/** * @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; }
/** * @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; }
/** * @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; }
/** * @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; }
/** * @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; }
/** * @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; }
/** * @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; }
/** * @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(); }
/** * @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; } }
/** * @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; }
/** * @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; }
/** * @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; }
/** * @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); } }
/** * @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; } }
/** * @see Action::execute() */ public function execute() { parent::execute(); // set last mark as read time WCF::getUser()->setLastMarkAllAsReadTime(TIME_NOW); // update subscriptions if (WCF::getUser()->userID) { require_once WBB_DIR . 'lib/data/thread/SubscribedThread.class.php'; SubscribedThread::clearSubscriptions(); $sql = "UPDATE\twbb" . WBB_N . "_board_subscription\n\t\t\t\tSET\temails = 0\n\t\t\t\tWHERE\tuserID = " . WCF::getUser()->userID; WCF::getDB()->registerShutdownUpdate($sql); $sql = "UPDATE\twbb" . WBB_N . "_thread_subscription\n\t\t\t\tSET\temails = 0\n\t\t\t\tWHERE\tuserID = " . WCF::getUser()->userID; WCF::getDB()->registerShutdownUpdate($sql); } // reset session WCF::getSession()->resetUserData(); WCF::getSession()->unregister('lastSubscriptionsStatusUpdateTime'); $this->executed(); if (empty($_REQUEST['ajax'])) { HeaderUtil::redirect('index.php' . SID_ARG_1ST); } exit; }
/** * @see Action::execute() */ public function execute() { parent::execute(); // check permissions $boardIDs = Board::getModeratedBoards('canDeleteThreadCompletely'); if (empty($boardIDs)) { throw new PermissionDeniedException(); } // delete threads $threadIDArray = array(); $sql = "SELECT\tthreadID\n\t\t\tFROM\twbb" . WBB_N . "_thread\n\t\t\tWHERE\tisDeleted = 1\n\t\t\t\tAND boardID IN (" . $boardIDs . ")"; $result = WCF::getDB()->sendQuery($sql); while ($row = WCF::getDB()->fetchArray($result)) { $threadIDArray[] = $row['threadID']; } if (count($threadIDArray)) { ThreadEditor::deleteAllCompletely(implode(',', $threadIDArray)); } $this->executed(); // forward HeaderUtil::redirect('index.php?page=ModerationDeletedThreads' . SID_ARG_2ND_NOT_ENCODED); exit; }
/** * @see Action::execute() */ public function execute() { parent::execute(); switch ($this->packageHash) { case '': WCF::getCache()->addResource('build-profiles', PB_DIR . 'cache/cache.build-profiles.php', PB_DIR . 'lib/system/cache/CacheBuilderBuildProfiles.class.php'); $cache = WCF::getCache()->get('build-profiles'); $profiles = array(); if (isset($cache[$this->packageName])) { $profiles = $cache[$this->packageName]; } $json = JSON::encode($profiles); break; default: $sql = "SELECT\tpackages, resource\r\n\t\t\t\t\tFROM\tpb" . PB_N . "_build_profile\r\n\t\t\t\t\tWHERE\tpackageName = '" . escapeString($this->packageName) . "'\r\n\t\t\t\t\t\tAND packageHash = '" . escapeString($this->packageHash) . "'"; $row = WCF::getDB()->sendQuery($sql); $json = JSON::encode(array(unserialize($row['packages']), $row['resource'])); break; } // send JSON response header('Content-type: application/json'); echo $json; exit; }
/** * @see Action::execute() */ public function execute() { parent::execute(); // add edit note $postData = array(); if (!$this->board->getPermission('canHideEditNote') && (WCF::getUser()->userID != $this->post->userID || $this->post->time <= TIME_NOW - POST_EDIT_HIDE_EDIT_NOTE_PERIOD * 60)) { $postData['editor'] = WCF::getUser()->username; $postData['editorID'] = WCF::getUser()->userID; $postData['lastEditTime'] = TIME_NOW; $postData['editCount'] = $this->post->editCount + 1; $postData['editReason'] = ''; } // update message $this->post->updateMessage($this->text, $postData); if ($this->thread->firstPostID == $this->post->postID) { // update first post preview $this->post->updateFirstPostPreview($this->post->threadID, $this->post->postID, $this->text, array('enableSmilies' => $this->post->enableSmilies, 'enableHtml' => $this->post->enableHtml, 'enableBBCodes' => $this->post->enableBBCodes)); } $this->executed(); // get new formatted message and return it $postList = new PostList(); $postList->sqlConditions = 'post.postID = ' . $this->postID; $postList->readPosts(); $post = reset($postList->posts); HeaderUtil::sendHeaders(); echo $post->getFormattedMessage(); }