/** * @see Page::show() */ public function show() { parent::show(); if (in_array($this->action, self::$validFunctions)) { $threadAction = new ThreadAction($this->board, $this->thread, null, $this->threadID, $this->topic, $this->prefix, $this->url, $this->reason); $threadAction->{$this->action}(); } }
/** * @see Page::show() */ public function show() { parent::show(); if (in_array($this->action, self::$validFunctions)) { $postAction = new PostAction($this->board, $this->thread, $this->post, $this->postID, $this->topic, $this->url, $this->reason); $postAction->{$this->action}(); } }
/** * @see Page::show() */ public function show() { if (!WCF::getUser()->userID) { throw new PermissionDeniedException(); } parent::show(); switch ($this->action) { case 'mark': case 'unmark': if (!is_array($this->threadID)) { $this->threadID = array($this->threadID); } foreach ($this->threadID as $threadID) { $thread = new SubscribedThread($threadID); if ($thread->threadID) { $thread->{$this->action}(); } } break; case 'unmarkAll': SubscribedThread::unmarkAll(); break; case 'unsubscribeThread': $thread = new SubscribedThread($this->threadID); if ($thread->threadID) { $thread->unsubscribe(); } $thread->unmark(); if (!empty($this->url)) { HeaderUtil::redirect($this->url); } else { HeaderUtil::redirect('index.php?page=SubscriptionsList' . SID_ARG_2ND_NOT_ENCODED); } exit; case 'unsubscribeMarkedThreads': SubscribedThread::unsubscribeMarked(); SubscribedThread::unmarkAll(); if (!empty($this->url)) { HeaderUtil::redirect($this->url); } else { HeaderUtil::redirect('index.php?page=SubscriptionsList' . SID_ARG_2ND_NOT_ENCODED); } exit; case 'unsubscribeThreads': SubscribedThread::unsubscribeAll(); SubscribedThread::unmarkAll(); if (!empty($this->url)) { HeaderUtil::redirect($this->url); } else { HeaderUtil::redirect('index.php?page=SubscriptionsList' . SID_ARG_2ND_NOT_ENCODED); } exit; case 'unsubscribeBoard': // remove subscriptions $sql = "DELETE FROM\twbb" . WBB_N . "_board_subscription\n\t\t\t\t\tWHERE\t\tuserID = " . WCF::getUser()->userID . "\n\t\t\t\t\t\t\tAND boardID = " . $this->boardID; WCF::getDB()->sendQuery($sql); // reset user data WCF::getSession()->resetUserData(); WCF::getSession()->unregister('hasSubscriptions'); HeaderUtil::redirect('index.php?page=SubscriptionsList' . SID_ARG_2ND_NOT_ENCODED); exit; case 'unsubscribeBoards': // remove subscriptions $sql = "DELETE FROM\twbb" . WBB_N . "_board_subscription\n\t\t\t\t\tWHERE\t\tuserID = " . WCF::getUser()->userID; WCF::getDB()->sendQuery($sql); // reset user data WCF::getSession()->resetUserData(); WCF::getSession()->unregister('hasSubscriptions'); HeaderUtil::redirect('index.php?page=SubscriptionsList' . SID_ARG_2ND_NOT_ENCODED); exit; default: throw new IllegalLinkException(); } }
/** * @see Page::show() */ public function show() { if (!MODULE_PM) { throw new IllegalLinkException(); } // check permission WCF::getUser()->checkPermission('user.pm.canUsePm'); if (!WCF::getUser()->userID) { throw new PermissionDeniedException(); } parent::show(); // handle action request switch ($this->action) { // mark/unmark pm case 'mark': case 'unmark': if ($this->pmID) { require_once WCF_DIR . 'lib/data/message/pm/PMAction.class.php'; $a = $this->action; PMAction::$a($this->pmID); } break; // disable notifications // disable notifications case 'disableNotifications': require_once WCF_DIR . 'lib/data/message/pm/PM.class.php'; PM::disableNotifications(); if (!isset($_REQUEST['ajax'])) { HeaderUtil::redirect('index.php' . SID_ARG_1ST); exit; } break; // unmark all // unmark all case 'unmarkAll': require_once WCF_DIR . 'lib/data/message/pm/PMAction.class.php'; PMAction::unmarkAll(); break; // empty recycle bin // empty recycle bin case 'emptyRecycleBin': require_once WCF_DIR . 'lib/data/message/pm/PMAction.class.php'; PMAction::emptyRecycleBin(); break; // delete // edit unread // cancel // recover // download // mark as read/unread // delete // edit unread // cancel // recover // download // mark as read/unread case 'delete': case 'edit': case 'cancel': case 'recover': case 'download': case 'markAsRead': case 'markAsUnread': require_once WCF_DIR . 'lib/data/message/pm/PMAction.class.php'; $action = new PMAction($this->pmID, $this->folderID); $action->{$this->action}(); break; // move to // move to case 'moveTo': require_once WCF_DIR . 'lib/data/message/pm/PMAction.class.php'; $action = new PMAction($this->pmID); $action->moveTo($this->folderID); break; // move marked to // move marked to case 'moveMarkedTo': require_once WCF_DIR . 'lib/data/message/pm/PMAction.class.php'; PMAction::moveMarkedTo($this->folderID); break; // download marked // delete marked // cancel marked // download marked // delete marked // cancel marked case 'downloadMarked': case 'deleteMarked': case 'cancelMarked': require_once WCF_DIR . 'lib/data/message/pm/PMAction.class.php'; $a = $this->action; PMAction::$a($this->folderID); break; } }