/**
  * @see Page::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     if (isset($_REQUEST['highlight'])) {
         $this->highlight = $_REQUEST['highlight'];
     }
 }
 /**
  * @see Page::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     // category id
     if (isset($_REQUEST['avatarCategoryID'])) {
         $this->avatarCategoryID = intval($_REQUEST['avatarCategoryID']);
     } else {
         if ($this->avatarID > 0) {
             $avatar = new Avatar($this->avatarID);
             $this->avatarCategoryID = $avatar->avatarCategoryID;
         }
     }
     if ($this->avatarCategoryID) {
         $this->avatarCategory = new AvatarCategory($this->avatarCategoryID);
         if ($this->avatarCategory->groupID && !in_array($this->avatarCategory->groupID, WCF::getUser()->getGroupIDs()) || $this->avatarCategory->neededPoints > WCF::getUser()->activityPoints) {
             $this->avatarCategory = null;
             $this->avatarCategoryID = 0;
         }
     }
     $this->sqlConditions = "avatarCategoryID = " . $this->avatarCategoryID . " AND " . $this->sqlConditions;
     // find page of the selected avatar
     if ($this->pageNo == 0 && $this->avatarID > 0) {
         $sql = "SELECT\tCOUNT(*) AS count\n\t\t\t\tFROM\twcf" . WCF_N . "_avatar\n\t\t\t\tWHERE\t(" . $this->sqlConditions . ")\n\t\t\t\t\tAND (\n\t\t\t\t\t\tavatarName < (SELECT avatarName FROM wcf" . WCF_N . "_avatar WHERE avatarID = " . $this->avatarID . ")\n\t\t\t\t\t\tOR (\n\t\t\t\t\t\t\tavatarName = (SELECT avatarName FROM wcf" . WCF_N . "_avatar WHERE avatarID = " . $this->avatarID . ")\n\t\t\t\t\t\t\tAND avatarID < " . $this->avatarID . "\n\t\t\t\t\t\t)\n\t\t\t\t\t)";
         $row = WCF::getDB()->getFirstRow($sql);
         $position = $row['count'] + 1;
         $this->pageNo = ceil($position / $this->itemsPerPage);
     }
 }
 /**
  * @see Page::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     if (WCF::getUser()->postsPerPage) {
         $this->itemsPerPage = WCF::getUser()->postsPerPage;
     }
 }
 /**
  * @see Page::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     if (isset($_REQUEST['sortField'])) {
         $this->sortField = $_REQUEST['sortField'];
     }
     if (isset($_REQUEST['sortOrder'])) {
         $this->sortOrder = $_REQUEST['sortOrder'];
     }
 }
 /**
  * @see Page::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     if (isset($_REQUEST['entryID'])) {
         $this->entryID = intval($_REQUEST['entryID']);
     }
     $this->frame = new UserProfileFrame($this);
     if (WCF::getUser()->guestbookEntriesPerPage) {
         $this->itemsPerPage = WCF::getUser()->guestbookEntriesPerPage;
     }
 }
 /**
  * @see	Page::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     // read query arguments
     if (isset($_REQUEST['hostID'])) {
         $this->hostID = intval($_REQUEST['hostID']);
     }
     // read host
     $this->host = new Host($this->hostID);
     // validate host
     if (!$this->host->hostID) {
         throw new IllegalLinkException();
     }
 }
 /**
  * @see Form::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     // get entry
     if (isset($_REQUEST['contestID'])) {
         $this->contestID = intval($_REQUEST['contestID']);
     }
     $this->entry = new ViewableContest($this->contestID);
     if (!$this->entry->contestID) {
         throw new IllegalLinkException();
     }
     // init solution list
     $this->solutionList = new ContestSolutionList();
     $this->solutionList->sqlConditions .= 'contest_solution.contestID = ' . $this->contestID;
 }
 /**
  * @see Form::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     // get entry
     if (isset($_REQUEST['contestID'])) {
         $this->contestID = intval($_REQUEST['contestID']);
     }
     $this->entry = new ViewableContest($this->contestID);
     if (!$this->entry->contestID) {
         throw new IllegalLinkException();
     }
     // init participant list
     $this->participantList = new ContestParticipantList();
     $this->participantList->sqlConditions .= 'contest_participant.contestID = ' . $this->contestID;
     $this->participantList->sqlOrderBy = 'contest_participant.time DESC';
 }
 /**
  * @see Form::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     // get entry
     if (isset($_REQUEST['contestID'])) {
         $this->contestID = intval($_REQUEST['contestID']);
     }
     $this->entry = new ViewableContest($this->contestID);
     if (!$this->entry->contestID || !$this->entry->isSponsortalkable()) {
         throw new IllegalLinkException();
     }
     // init sponsortalk list
     $this->sponsortalkList = new ContestSponsortalkList();
     $this->sponsortalkList->sqlConditions .= 'contest_sponsortalk.contestID = ' . $this->contestID;
     $this->sponsortalkList->sqlOrderBy = 'contest_sponsortalk.time DESC';
 }
 /**
  * @see Page::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     // get entry
     if (isset($_REQUEST['contestID'])) {
         $this->contestID = intval($_REQUEST['contestID']);
     }
     $this->entry = new ViewableContest($this->contestID);
     if (!$this->entry->isViewable()) {
         throw new IllegalLinkException();
     }
     // validation
     if ($this->entry->enableInteraction == 0) {
         throw new Exception('invalid contest type');
     }
     // init price list
     $this->interactionList = new ContestInteractionList($this->entry);
 }
 /**
  * @see Page::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     if (isset($_REQUEST['userID'])) {
         $this->userID = intval($_REQUEST['userID']);
     }
     require_once WCF_DIR . 'lib/data/user/UserProfile.class.php';
     $this->user = new UserProfile($this->userID, null, null, null);
     if (!$this->user->userID) {
         require_once WCF_DIR . 'lib/system/exception/IllegalLinkException.class.php';
         throw new IllegalLinkException();
     }
     // Gästebuch deaktiviert?
     if ($this->user->userID != WCF::getUser()->userID && !$this->user->userGuestbook_enable || !WCF::getUser()->getPermission('user.guestbook.canRead') || $this->user->userID == WCF::getUser()->userID && !WCF::getUser()->getPermission('user.guestbook.canUseOwn')) {
         require_once WCF_DIR . 'lib/system/exception/PermissionDeniedException.class.php';
         throw new PermissionDeniedException();
     }
 }
 /**
  * @see Page::readParameters();
  */
 public function readParameters()
 {
     parent::readParameters();
     if (isset($_REQUEST['tagID'])) {
         $this->tagID = intval($_REQUEST['tagID']);
     }
     if (isset($_REQUEST['tag'])) {
         $this->tag = StringUtil::trim($_REQUEST['tag']);
     }
     if (isset($_REQUEST['taggableID'])) {
         $this->taggableID = intval($_REQUEST['taggableID']);
     }
     // get tag object
     if ($this->tagID != 0) {
         $this->tagObj = TagEngine::getInstance()->getTagByID($this->tagID);
         if ($this->tagObj === null) {
             throw new IllegalLinkException();
         }
         $this->tagID = $this->tagObj->getID();
     } else {
         if (!empty($this->tag)) {
             $this->tagObj = TagEngine::getInstance()->getTagByName($this->tag, WCF::getSession()->getVisibleLanguageIDArray());
             if ($this->tagObj === null) {
                 throw new IllegalLinkException();
             }
             $this->tagID = $this->tagObj->getID();
         }
     }
     // get taggable
     if ($this->taggableID != 0) {
         $this->taggable = TagEngine::getInstance()->getTaggableByID($this->taggableID);
         if ($this->taggable === null) {
             throw new IllegalLinkException();
         }
     }
     // get available taggables
     if ($this->tagObj) {
         $this->availableTaggables = TagEngine::getInstance()->getTaggablesByTagID($this->tagObj->getID());
         if (count($this->availableTaggables) == 1) {
             $this->taggableID = $this->availableTaggables[0]->getTaggableID();
             $this->taggable = $this->availableTaggables[0];
         }
     }
 }
 /**
  * @see Page::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     if (isset($_REQUEST['searchID'])) {
         $this->searchID = intval($_REQUEST['searchID']);
     }
     // get search
     $sql = "SELECT \t*\n\t\t\tFROM\twcf" . WCF_N . "_search\n\t\t\tWHERE\tsearchID = " . $this->searchID . "\n\t\t\t\tAND userID = " . WCF::getUser()->userID;
     $search = WCF::getDB()->getFirstRow($sql);
     if (empty($search['searchID']) || $search['userID'] && $search['userID'] != WCF::getUser()->userID) {
         throw new IllegalLinkException();
     }
     // get search data
     $search = unserialize($search['searchData']);
     $this->query = $search['query'];
     $this->result = $search['result'];
     // get highlight string
     if (isset($_REQUEST['highlight'])) {
         $this->highlight = $_REQUEST['highlight'];
     }
 }
 /**
  * @see Page::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     // get tag
     if (isset($_REQUEST['tagID'])) {
         $this->tagID = intval($_REQUEST['tagID']);
     }
     // get juryID
     if (isset($_REQUEST['juryID'])) {
         $this->juryID = intval($_REQUEST['juryID']);
     }
     // get participantID
     if (isset($_REQUEST['participantID'])) {
         $this->participantID = intval($_REQUEST['participantID']);
     }
     // get classID
     if (isset($_REQUEST['classID'])) {
         $this->classID = intval($_REQUEST['classID']);
     }
     // init entry list
     if (MODULE_TAGGING && $this->tagID) {
         require_once WCF_DIR . 'lib/data/tag/TagEngine.class.php';
         $this->tag = TagEngine::getInstance()->getTagByID($this->tagID);
         if ($this->tag === null) {
             throw new IllegalLinkException();
         }
         require_once WCF_DIR . 'lib/data/contest/TaggedContestOverviewList.class.php';
         $this->entryList = new TaggedContestOverviewList($this->tagID);
     } else {
         if ($this->juryID) {
             require_once WCF_DIR . 'lib/data/contest/ContestOverviewList.class.php';
             $this->entryList = new ContestOverviewList();
             $this->entryList->sqlConditions .= 'contest_jury.juryID = ' . intval($this->juryID);
             $this->entryList->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_contest_jury contest_jury ON (contest_jury.contestID = contest.contestID) ";
         } else {
             if ($this->participantID) {
                 require_once WCF_DIR . 'lib/data/contest/ContestOverviewList.class.php';
                 $this->entryList = new ContestOverviewList();
                 $this->entryList->sqlConditions .= 'contest_participant.participantID = ' . intval($this->participantID);
                 $this->entryList->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_contest_participant contest_participant ON (contest_participant.contestID = contest.contestID) ";
             } else {
                 if ($this->classID) {
                     require_once WCF_DIR . 'lib/data/contest/ContestOverviewList.class.php';
                     $this->entryList = new ContestOverviewList();
                     $this->entryList->sqlConditions .= 'contest_to_class.classID = ' . intval($this->classID);
                     $this->entryList->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_contest_to_class contest_to_class ON (contest_to_class.contestID = contest.contestID) ";
                 } else {
                     require_once WCF_DIR . 'lib/data/contest/ContestOverviewList.class.php';
                     $this->entryList = new ContestOverviewList();
                 }
             }
         }
     }
     // init tag list
     if (MODULE_TAGGING) {
         require_once WCF_DIR . 'lib/data/tag/TagList.class.php';
         $this->tagList = new TagList(array('de.easy-coding.wcf.contest.entry'), WCF::getSession()->getVisibleLanguageIDArray());
     }
 }
 /**
  * @see Page::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     // get entry
     if (isset($_REQUEST['contestID'])) {
         $this->contestID = intval($_REQUEST['contestID']);
     }
     $this->entry = new ViewableContest($this->contestID);
     if (!$this->entry->contestID) {
         throw new IllegalLinkException();
     }
     if (isset($_REQUEST['errorField'])) {
         $this->errorField = $_REQUEST['errorField'];
     }
     if (isset($_REQUEST['action'])) {
         $this->action = $_REQUEST['action'];
     }
     if (isset($_REQUEST['commentID'])) {
         $this->commentID = intval($_REQUEST['commentID']);
     }
     if ($this->commentID != 0) {
         $this->comment = new ContestComment($this->commentID);
         if (!$this->comment->commentID || $this->comment->contestID != $this->contestID) {
             throw new IllegalLinkException();
         }
         // check permissions
         if ($this->action == 'edit' && !$this->comment->isEditable()) {
             throw new PermissionDeniedException();
         }
         // get page number
         $pagennumber = new ContestEventMixList();
         $pagennumber->sqlConditions .= 'contestID = ' . intval($this->contestID);
         $pagennumber->sqlConditions .= ' AND time < ' . intval($this->comment->time);
         $count = $pagennumber->countObjects();
         $this->pageNo = $count > $this->itemsOnLandingpage ? 1 : 0;
         $this->pageNo += ceil(($count - $this->itemsOnLandingpage) / $this->itemsPerPage);
     }
     // init eventmix list
     $this->eventmixList = new ContestEventMixList();
     $this->eventmixList->sqlConditions .= 'contestID = ' . intval($this->contestID);
     $this->eventmixList->sqlOrderBy = 'contest_eventmix.time DESC';
 }
 public function readParameters()
 {
     parent::readParameters();
     // get profile frame
     $this->frame = new UserProfileFrame($this);
 }
 /**
  * @see Form::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     // any success action?
     if (isset($_REQUEST['success'])) {
         $this->success = $_REQUEST['success'];
     }
     // get entry
     if (isset($_REQUEST['contestID'])) {
         $this->contestID = intval($_REQUEST['contestID']);
     }
     $this->entry = new ViewableContest($this->contestID);
     if (!$this->entry->contestID) {
         throw new IllegalLinkException();
     }
     // init price list
     $this->priceList = new ContestPriceList();
     $this->priceList->sqlConditions .= 'contest_price.contestID = ' . intval($this->contestID);
 }
 /**
  * Reads the given parameters.
  */
 public function readParameters()
 {
     parent::readParameters();
     if (isset($_REQUEST['threadID'])) {
         $this->threadID = intval($_REQUEST['threadID']);
     } else {
         if (isset($_REQUEST['threadid'])) {
             $this->threadID = intval($_REQUEST['threadid']);
         }
     }
     // wbb2 style
     if (isset($_REQUEST['messageID'])) {
         $this->postID = intval($_REQUEST['messageID']);
     } else {
         if (isset($_REQUEST['postID'])) {
             $this->postID = intval($_REQUEST['postID']);
         } else {
             if (isset($_REQUEST['postid'])) {
                 $this->postID = intval($_REQUEST['postid']);
             }
         }
     }
     // wbb2 style
     if (isset($_REQUEST['action'])) {
         $this->action = $_REQUEST['action'];
     }
     if (isset($_REQUEST['highlight'])) {
         $this->highlight = $_REQUEST['highlight'];
     }
     // get thread
     $this->thread = new ViewableThread($this->threadID, null, $this->postID);
     $this->threadID = $this->thread->threadID;
     // get board
     $this->board = Board::getBoard($this->thread->boardID);
     if ($this->board->postSortOrder) {
         $this->sortOrder = $this->board->postSortOrder;
     }
     if ($this->board->enableRating != -1) {
         $this->enableRating = $this->board->enableRating;
     }
     // posts per page
     if ($this->board->postsPerPage) {
         $this->itemsPerPage = $this->board->postsPerPage;
     }
     if (WCF::getUser()->postsPerPage) {
         $this->itemsPerPage = WCF::getUser()->postsPerPage;
     }
     // enter thread
     $this->thread->enter($this->board);
     // init post list
     $this->postList = new ThreadPostList($this->thread, $this->board);
     $this->postList->sqlOrderBy = 'post.time ' . $this->sortOrder;
     // handle jump to
     if ($this->action == 'lastPost') {
         $this->goToLastPost();
     }
     if ($this->action == 'firstNew') {
         $this->goToFirstNewPost();
     }
     if ($this->postID) {
         $this->goToPost();
     }
     // handle subscriptions
     if (WCF::getUser()->userID) {
         $this->thread->updateSubscription();
         if ($this->thread->subscribed) {
             WCF::getSession()->unregister('lastSubscriptionsStatusUpdateTime');
         }
     }
     // handle parameters and special actions
     $this->handleRating();
 }
 /**
  * @see Page::readParameters()
  */
 public function readParameters()
 {
     $this->wbbExists = AttachmentManager::wbbExists();
     parent::readParameters();
     if (!WCF::getUser()->userID) {
         require_once WCF_DIR . 'lib/system/exception/PermissionDeniedException.class.php';
         throw new PermissionDeniedException();
     }
     $this->am = new AttachmentManager();
     if (isset($_REQUEST['sortField'])) {
         $this->sortField = $_REQUEST['sortField'];
     }
     if (isset($_REQUEST['sortOrder'])) {
         $this->sortOrder = $_REQUEST['sortOrder'];
     }
     if (isset($_REQUEST['userID'])) {
         $this->userID = $_REQUEST['userID'];
     }
     if (isset($_POST['username'])) {
         $this->username = $_POST['username'];
     }
     if (isset($_REQUEST['showOnlyMessageType'])) {
         $this->showOnlyMessageType = $_REQUEST['showOnlyMessageType'];
     } else {
         if (WCF::getSession()->getVar('showOnlyMessageType')) {
             $this->showOnlyMessageType = WCF::getSession()->getVar('showOnlyMessageType');
         }
     }
     if (isset($_REQUEST['showOnlyFileType'])) {
         $this->showOnlyFileType = $_REQUEST['showOnlyFileType'];
     } else {
         if (WCF::getSession()->getVar('showOnlyFileType')) {
             $this->showOnlyFileType = WCF::getSession()->getVar('showOnlyFileType');
         }
     }
     if (isset($_REQUEST['showOnlyImages'])) {
         $this->showOnlyImages = $_REQUEST['showOnlyImages'];
     } else {
         if (WCF::getSession()->getVar('showOnlyImages')) {
             $this->showOnlyImages = WCF::getSession()->getVar('showOnlyImages');
         }
     }
     if ($this->wbbExists && isset($_REQUEST['showThumbnails'])) {
         $this->showThumbnails = $_REQUEST['showThumbnails'];
     } else {
         if ($this->wbbExists && WCF::getSession()->getVar('showThumbnails')) {
             $this->showThumbnails = WCF::getSession()->getVar('showThumbnails');
         }
     }
     if (isset($_POST['fDo'])) {
         if ($_POST['fDo'] == 'delete' && isset($_POST['delAttachment']) && is_array($_POST['delAttachment'])) {
             WCF::getUser()->checkPermission('admin.general.attachmentManager.canDelete');
             $ret = $this->am->deleteAttachments($this->userID, $_POST['delAttachment']);
             if ($ret['CODE'] == RET_ERROR) {
                 $this->tplError = '<p class="error">' . $ret['MSG'] . '</p>';
             } else {
                 if ($ret['CODE'] == RET_WARNING) {
                     $this->tplWarning = '<p class="warning">' . $ret['MSG'] . '</p>';
                 } else {
                     if ($ret['CODE'] == RET_INFO) {
                         $this->tplInfo = '<p class="success">' . $ret['MSG'] . '</p>';
                     }
                 }
             }
         } else {
             if ($_POST['fDo'] == 'setFilter') {
                 if (empty($_POST['showOnlyImages'])) {
                     $this->showOnlyImages = 0;
                 } else {
                     $this->showOnlyImages = 1;
                 }
                 if (!empty($this->username)) {
                     $tmp = $this->am->getUserByName($this->username);
                     if (!empty($tmp['userID'])) {
                         $this->userID = $tmp['userID'];
                         $this->username = $tmp['username'];
                     } else {
                         $this->userID = 0;
                         $this->username = '';
                     }
                 } else {
                     $this->userID = 0;
                     $this->username = '';
                 }
             } else {
                 if ($_POST['fDo'] == 'switchThumbnails') {
                     if (empty($_POST['showThumbnails'])) {
                         $this->showThumbnails = 0;
                     } else {
                         $this->showThumbnails = 1;
                     }
                 }
             }
         }
     }
     if (!empty($this->userID)) {
         $tmp = $this->am->getUserById($this->userID);
         if (!empty($tmp['userID'])) {
             $this->userID = $tmp['userID'];
             $this->username = $tmp['username'];
         }
     }
 }
 /**
  * @see Form::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     // get entry
     if (isset($_REQUEST['contestID'])) {
         $this->contestID = intval($_REQUEST['contestID']);
     }
     $this->entry = new ViewableContest($this->contestID);
     if (!$this->entry->contestID) {
         throw new IllegalLinkException();
     }
     // get entry
     if (isset($_REQUEST['solutionID'])) {
         $this->solutionID = intval($_REQUEST['solutionID']);
     }
     $this->solutionObj = new ViewableContestSolution($this->solutionID);
     if (!$this->solutionObj->solutionID) {
         throw new IllegalLinkException();
     }
     if (isset($_REQUEST['sendPickNotification'])) {
         $this->sendPickNotification = true;
     }
     // init comment list
     $this->commentList = new ContestSolutionCommentList();
     $this->commentList->sqlConditions .= 'contest_solution_comment.solutionID = ' . intval($this->solutionID);
     $this->commentList->sqlOrderBy = 'contest_solution_comment.time DESC';
     // init rating list
     $this->ratingList = new ContestSolutionRatingSummaryList();
     $this->ratingList->sqlConditions .= 'contest_solution_rating.solutionID = ' . intval($this->solutionID);
     $classIDs = array_keys($this->entry->getClasses());
     $ratingoptionIDs = array_keys(ContestRatingoption::getByClassIDs($classIDs));
     $this->ratingList->sqlConditionsClasses = implode(',', $ratingoptionIDs);
 }