コード例 #1
0
 /**
  * @see wcf\page\IPage::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     if (isset($_REQUEST['cleared'])) {
         $this->cleared = intval($_REQUEST['cleared']);
     }
 }
コード例 #2
0
ファイル: PackagePage.class.php プロジェクト: 0xLeon/WCF
	/**
	 * @see	wcf\page\IPage::readParameters()
	 */
	public function readParameters() {
		parent::readParameters();
		
		if (isset($_REQUEST['id'])) $this->packageID = intval($_REQUEST['id']);
		$this->package = new Package($this->packageID);
		if (!$this->package->packageID) {
			throw new IllegalLinkException();
		}
	}
コード例 #3
0
	/**
	 * @see	wcf\page\IPage::readParameters()
	 */
	public function readParameters() {
		parent::readParameters();
		
		if (isset($_REQUEST['queueID'])) $this->queueID = intval($_REQUEST['queueID']);
		$this->queue = new PackageInstallationQueue($this->queueID);
		if (!$this->queue->queueID || $this->queue->done) {
			throw new IllegalLinkException();
		}
	}
コード例 #4
0
 /**
  * @see	\wcf\page\IPage::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     if (isset($_REQUEST['oldID'])) {
         $this->oldID = intval($_REQUEST['oldID']);
         $this->old = new EditHistoryEntry($this->oldID);
         if (!$this->old->entryID) {
             throw new IllegalLinkException();
         }
         if (isset($_REQUEST['newID']) && $_REQUEST['newID'] !== 'current') {
             $this->newID = intval($_REQUEST['newID']);
             $this->new = new EditHistoryEntry($this->newID);
             if (!$this->new->entryID) {
                 throw new IllegalLinkException();
             }
         }
         // if new version isn't 'current' check whether they are comparable
         if ($this->new) {
             // different objectTypes cannot be compared
             if ($this->old->objectTypeID != $this->new->objectTypeID) {
                 throw new IllegalLinkException();
             }
             // different items cannot be compared
             if ($this->old->objectID != $this->new->objectID) {
                 throw new IllegalLinkException();
             }
         }
         $this->objectID = $this->old->objectID;
         $this->objectType = ObjectTypeCache::getInstance()->getObjectType($this->old->objectTypeID);
     } else {
         if (isset($_REQUEST['objectID']) && isset($_REQUEST['objectType'])) {
             $this->objectID = intval($_REQUEST['objectID']);
             $this->objectType = ObjectTypeCache::getInstance()->getObjectTypeByName('com.woltlab.wcf.edit.historySavingObject', $_REQUEST['objectType']);
         } else {
             throw new IllegalLinkException();
         }
     }
     if (!$this->objectType) {
         throw new IllegalLinkException();
     }
     $processor = $this->objectType->getProcessor();
     $this->object = $processor->getObjectByID($this->objectID);
     if (!$this->object->getObjectID()) {
         throw new IllegalLinkException();
     }
     $processor->checkPermissions($this->object);
     $this->activeMenuItem = $processor->getActivePageMenuItem();
     $this->object->addBreadcrumbs();
     if (isset($_REQUEST['newID']) && !$this->new) {
         $this->new = $this->object;
         $this->newID = 'current';
     }
     if (!empty($_POST)) {
         HeaderUtil::redirect(LinkHandler::getInstance()->getLink('EditHistory', array('objectID' => $this->objectID, 'objectType' => $this->objectType->objectType, 'newID' => $this->newID, 'oldID' => $this->oldID)));
         exit;
     }
 }
コード例 #5
0
 /**
  * @see wcf\page\IPage::assignVariables()
  */
 public function readParameters()
 {
     parent::readParameters();
     if (!count($_POST)) {
         // refresh package database
         PackageUpdateDispatcher::refreshPackageDatabase();
     }
     // get updatable packages
     $this->availableUpdates = PackageUpdateDispatcher::getAvailableUpdates();
 }
コード例 #6
0
 /**
  * @see	\wcf\page\IPage::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     if (isset($_REQUEST['id'])) {
         $this->logID = intval($_REQUEST['id']);
     }
     $this->log = new PaidSubscriptionTransactionLog($this->logID);
     if (!$this->log->logID) {
         throw new IllegalLinkException();
     }
 }
コード例 #7
0
 /**
  * @see	\wcf\page\IPage::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     if (isset($_REQUEST['pageID'])) {
         $this->pageID = intval($_REQUEST['pageID']);
     }
     $this->page = PageCache::getInstance()->getPage($this->pageID);
     if ($this->page === null) {
         throw new IllegalLinkException();
     }
 }
コード例 #8
0
 /**
  * @see	\wcf\page\IPage::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     $this->products = WCF::getSession()->getVar('__pluginStoreProducts');
     if (empty($this->products)) {
         throw new IllegalLinkException();
     }
     $this->wcfMajorReleases = WCF::getSession()->getVar('__pluginStoreWcfMajorReleases');
     if (empty($this->wcfMajorReleases)) {
         throw new IllegalLinkException();
     }
 }
コード例 #9
0
 /**
  * @see	\wcf\page\IPage::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     if (isset($_REQUEST['id'])) {
         $this->fileID = intval($_REQUEST['id']);
     }
     $this->file = new EntryFile($this->fileID);
     if (!$this->file->fileID) {
         throw new IllegalLinkException();
     }
     $this->entry = $this->file->getEntry();
 }
コード例 #10
0
ファイル: PackagePage.class.php プロジェクト: ZerGabriel/WCF
 /**
  * @see wcf\page\IPage::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     if (isset($_REQUEST['parentQueueID'])) {
         $this->parentQueueID = intval($_REQUEST['parentQueueID']);
     }
     if (isset($_REQUEST['processNo'])) {
         $this->processNo = intval($_REQUEST['processNo']);
     }
     if (isset($_REQUEST['queueID'])) {
         $this->queueID = intval($_REQUEST['queueID']);
     }
 }
コード例 #11
0
 public function readParameters()
 {
     parent::readParameters();
     if (!empty($_REQUEST['id'])) {
         $this->entryID = intval($_REQUEST['id']);
     }
     $this->entry = ViewableEntry::getEntry($this->entryID);
     if ($this->entry === null) {
         throw new IllegalLinkException();
     }
     // check permissions
     if (!$this->entry->canRead()) {
         throw new PermissionDeniedException();
     }
 }
コード例 #12
0
 /**
  * @see	\wcf\page\IPage::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     if (isset($_REQUEST['id'])) {
         $this->fileID = intval($_REQUEST['id']);
     }
     $this->file = FileCache::getInstance()->getFile($this->fileID);
     if ($this->file === null) {
         throw new IllegalLinkException();
     }
     // check if image file is in cache
     if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && @strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) == $this->file->uploadTime && in_array($this->file->fileType, self::$inlineMimeTypes)) {
         // send 304
         header("HTTP/1.1 304 Not Modified");
         exit;
     }
 }
コード例 #13
0
ファイル: UserPage.class.php プロジェクト: nick-strohm/WCF
 /**
  * @see	\wcf\page\IPage::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     if (isset($_REQUEST['id'])) {
         $this->userID = intval($_REQUEST['id']);
     }
     $this->user = UserProfile::getUserProfile($this->userID);
     if ($this->user === null) {
         throw new IllegalLinkException();
     }
     if ($this->user->userID != WCF::getUser()->userID && !WCF::getSession()->getPermission('user.profile.canViewUserProfile')) {
         throw new PermissionDeniedException();
     }
     if (isset($_REQUEST['editOnInit'])) {
         $this->editOnInit = true;
     }
     $this->canonicalURL = LinkHandler::getInstance()->getLink('User', array('object' => $this->user));
 }
コード例 #14
0
 /**
  * @see	\wcf\page\IPage::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     if (isset($_REQUEST['queueID'])) {
         $this->queueID = intval($_REQUEST['queueID']);
     }
     $this->queue = new PackageInstallationQueue($this->queueID);
     if (!$this->queue->queueID || $this->queue->done) {
         throw new IllegalLinkException();
     }
     if ($this->queue->action == 'install') {
         WCF::getSession()->checkPermissions(array('admin.system.package.canInstallPackage'));
     } else {
         WCF::getSession()->checkPermissions(array('admin.system.package.canUpdatePackage'));
     }
     $this->installingImportedStyle = WCF::getSession()->getVar('stylePackageImportLocation') !== null;
     if ($this->installingImportedStyle) {
         WCF::getSession()->unregister('stylePackageImportLocation');
     }
 }
コード例 #15
0
 /**
  * @see	\wcf\page\IPage::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     if (isset($_REQUEST['id'])) {
         $this->templateID = intval($_REQUEST['id']);
     }
     $this->template = new Template($this->templateID);
     if (!$this->template->templateID) {
         throw new IllegalLinkException();
     }
     if (isset($_REQUEST['parentID'])) {
         $this->parentID = intval($_REQUEST['parentID']);
     }
     $this->parent = new Template($this->parentID);
     if ($this->parent->templateID) {
         if ($this->parent->templateName != $this->template->templateName || $this->parent->application != $this->template->application) {
             throw new IllegalLinkException();
         }
     }
 }
コード例 #16
0
ファイル: PagePage.class.php プロジェクト: knzo/Fireball
 /**
  * @see	\wcf\page\IPage::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     // alias for indicating the requested page
     if (isset($_REQUEST['alias'])) {
         $alias = $_REQUEST['alias'];
         $this->pageID = PageCache::getInstance()->getIDByAlias($alias);
     } else {
         if (isset($_REQUEST['id'])) {
             $this->pageID = intval($_REQUEST['id']);
         } else {
             // landing page of the cms
             $page = PageCache::getInstance()->getHomePage();
             if ($page !== null) {
                 $this->pageID = $page->pageID;
             } else {
                 // redirect to system's landing page
                 HeaderUtil::redirect(Linkhandler::getInstance()->getLink(), true);
                 exit;
             }
         }
     }
     $this->page = PageCache::getInstance()->getPage($this->pageID);
     if ($this->page === null) {
         throw new IllegalLinkException();
     }
     // check if offline and view page or exit
     // @see	\wcf\system\request\RequestHandler
     if (OFFLINE) {
         if (!WCF::getSession()->getPermission('admin.general.canViewPageDuringOfflineMode') && !$this->page->availableDuringOfflineMode) {
             @header('HTTP/1.1 503 Service Unavailable');
             WCF::getTPL()->assign(array('templateName' => 'offline'));
             WCF::getTPL()->display('offline');
             exit;
         }
     }
     // check permissions
     if (!$this->page->canRead()) {
         throw new PermissionDeniedException();
     }
 }
コード例 #17
0
 /**
  * @see	\wcf\page\IPage::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     if (isset($_REQUEST['id'])) {
         $this->attachmentID = intval($_REQUEST['id']);
     }
     $this->attachment = new Attachment($this->attachmentID);
     if (!$this->attachment->attachmentID) {
         throw new IllegalLinkException();
     }
     $parameters = array('object' => $this->attachment);
     if (isset($_REQUEST['tiny']) && $this->attachment->tinyThumbnailType) {
         $this->tiny = intval($_REQUEST['tiny']);
         $parameters['tiny'] = $this->tiny;
     }
     if (isset($_REQUEST['thumbnail']) && $this->attachment->thumbnailType) {
         $this->thumbnail = intval($_REQUEST['thumbnail']);
         $parameters['thumbnail'] = $this->thumbnail;
     }
     $this->canonicalURL = LinkHandler::getInstance()->getLink('Attachment', $parameters);
 }
コード例 #18
0
 public function readParameters()
 {
     parent::readParameters();
     if (isset($_REQUEST['id'])) {
         $this->newsID = intval($_REQUEST['id']);
     } else {
         throw new IllegalLinkException();
     }
     if (!isset($this->newsID) || $this->newsID == 0) {
         throw new IllegalLinkException();
     }
     $this->news = ViewableNews::getNews($this->newsID);
     if ($this->news === null) {
         throw new IllegalLinkException();
     }
     foreach ($this->news->getCategories() as $category) {
         if (!$category->getPermission('canViewNews')) {
             throw new PermissionDeniedException();
         }
     }
 }
コード例 #19
0
 /**
  * @see	\wcf\page\IPage::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     $categories = CategoryHandler::getInstance()->getCategories('de.voolia.news.picture.category');
     if (isset($_REQUEST['id'])) {
         $this->categoryID = intval($_REQUEST['id']);
         $this->category = CategoryHandler::getInstance()->getCategory($this->categoryID);
     } else {
         while (!empty($categories) && !$this->categoryID) {
             $category = array_shift($categories);
             if ($category->parentCategoryID == 0) {
                 $this->categoryID = $category->categoryID;
                 $this->category = $category;
             }
         }
     }
     // check category
     if (!empty($categories) && ($this->category === null || $this->category->parentCategoryID != 0)) {
         throw new IllegalLinkException();
     }
 }
コード例 #20
0
 /**
  * @see	\wcf\page\IPage::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     if (isset($_REQUEST['id'])) {
         $this->languageID = intval($_REQUEST['id']);
     }
     if (isset($_REQUEST['languageCategoryID'])) {
         $this->languageCategoryID = intval($_REQUEST['languageCategoryID']);
     }
     if (isset($_REQUEST['languageItem'])) {
         $this->languageItem = StringUtil::trim($_REQUEST['languageItem']);
     }
     if (isset($_REQUEST['languageItemValue'])) {
         $this->languageItemValue = $_REQUEST['languageItemValue'];
     }
     if (!empty($_REQUEST['hasCustomValue'])) {
         $this->hasCustomValue = 1;
     }
     if (isset($_REQUEST['pageNo'])) {
         $this->pageNo = intval($_REQUEST['pageNo']);
     }
 }
コード例 #21
0
 /**
  * @see	\wcf\page\IPage::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     // check security token
     $this->checkSecurityToken();
 }
コード例 #22
0
 /**
  * @see	\wcf\page\IPage::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     if (isset($_REQUEST['id'])) {
         $this->newsID = intval($_REQUEST['id']);
     }
     $this->news = ViewableNews::getViewableNews($this->newsID);
     if ($this->news === null) {
         throw new IllegalLinkException();
     }
     // check permission for the news
     if (!$this->news->canRead()) {
         throw new PermissionDeniedException();
     }
 }
コード例 #23
0
 /**
  * @see	\wcf\page\IPage::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     // read page number parameter
     if (isset($_REQUEST['pageNo'])) {
         $this->pageNo = intval($_REQUEST['pageNo']);
     }
 }
コード例 #24
0
 /**
  * @see Page::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     // http/-s + mibbit-URL
     if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') {
         $this->mibbit_url = self::MIBBIT_HTTPS;
     } else {
         $this->mibbit_url = self::MIBBIT_HTTP;
     }
     // Server
     if (MIBBIT_SERVER_SELECT == "custom") {
         $this->mibbit_url .= "?server=" . rawurlencode(MIBBIT_SERVER);
     } else {
         $server = explode("!", MIBBIT_SERVER_SELECT);
         $this->mibbit_url .= "?server=" . rawurlencode(implode(":", $server));
     }
     // Channels
     $channels = explode("\n", MIBBIT_CHANNELS);
     $channelString = "";
     foreach ($channels as $channel) {
         $channelString .= (empty($channelString) ? '' : ',') . trim($channel);
     }
     $this->mibbit_url .= "&channel=" . rawurlencode($channelString);
     // Nick
     if (WCF::getUser()->userID != 0) {
         // prefix nick if prefix is given
         if (MIBBIT_NICKPREFIX != "") {
             // we do this before romanizing the name, so we can catch some "adminerrors" ;)
             $username = MIBBIT_NICKPREFIX . WCF::getUser()->username;
         } else {
             $username = WCF::getUser()->username;
         }
         // normalize nick for IRC
         $nick = $this->romanize($username);
         $nick = str_replace($this->replace_table, '_', $nick);
         $nick = preg_replace(array('!^_!', '!_$!', '!__+!'), array('', '', '_'), $nick);
         $this->mibbit_url .= "&nick=" . rawurlencode($nick);
     } else {
         if (MIBBIT_GUESTNICK != "") {
             $this->mibbit_url .= "&nick=" . rawurlencode(MIBBIT_GUESTNICK);
         }
     }
     // Autoconnect
     if (MIBBIT_AUTOCONNECT) {
         $this->mibbit_url .= "&autoConnect=true";
     } else {
         $this->mibbit_url .= "&autoConnect=false";
     }
     // Charset
     if (MIBBIT_CHARSET == 'auto') {
         $this->mibbit_url .= "&charset=UTF-8";
     } else {
         $this->mibbit_url .= "&charset=" . MIBBIT_CHARSET;
     }
     // Auth method
     if (MIBBIT_AUTHMETHOD == 'pass') {
         $this->mibbit_url .= "&authmethod=pass";
     }
     // Prompt for password
     if (MIBBIT_PROMPTPASS) {
         $this->mibbit_url .= "&promptPass=true";
     }
     // Welcome message
     if (MIBBIT_WELCOMEMESSAGE != "") {
         $this->mibbit_url .= "&customprompt=" . rawurlencode(WCF::getLanguage()->get(MIBBIT_WELCOMEMESSAGE));
     }
     // Loading message
     if (MIBBIT_LOADINGMESSAGE) {
         $this->mibbit_url .= "&customloading=" . rawurlencode(WCF::getLanguage()->get(MIBBIT_LOADINGMESSAGE));
     }
     // Settings ID
     if (MIBBIT_SETTINGSID != "") {
         $this->mibbit_url .= "&settings=" . MIBBIT_SETTINGSID;
     }
     // Show MOTD
     if (!MIBBIT_SHOWMOTD) {
         $this->mibbit_url .= "&noServerMotd=true";
     }
     // Show server notices
     if (!MIBBIT_SHOWSERVERNOTICES) {
         $this->mibbit_url .= "&noServerNotices=true";
     }
     // Show servertab
     if (MIBBIT_SHOWSERVERTAB) {
         $this->mibbit_url .= "&noServerTab=false";
     }
     // Show debug tab
     if (MIBBIT_DEBUG) {
         $this->mibbit_url .= "&debug=true";
     }
 }