Ejemplo n.º 1
0
 /**
  * @see wcf\page\IPage::show()
  */
 public function show()
 {
     parent::show();
     // check master password
     WCFACP::checkMasterPassword();
     switch ($this->action) {
         case 'install':
         case 'update':
             if ($this->action == 'install') {
                 WCF::getSession()->checkPermissions(array('admin.system.package.canInstallPackage'));
             } else {
                 WCF::getSession()->checkPermissions(array('admin.system.package.canUpdatePackage'));
             }
             $queue = new PackageInstallationQueue($this->queueID);
             $dispatcher = new PackageInstallationDispatcher($queue);
             $dispatcher->beginInstallation();
             break;
         case 'rollback':
             // TODO
             die('ROLLBACK');
             //WCF::getSession()->checkPermissions(array('admin.system.package.canInstallPackage'));
             break;
         case 'openQueue':
             PackageInstallationDispatcher::openQueue($this->parentQueueID, $this->processNo);
             break;
         case 'startUninstall':
             WCF::getSession()->checkPermissions(array('admin.system.package.canUninstallPackage'));
             PackageUninstallationDispatcher::checkDependencies();
             break;
     }
 }
Ejemplo n.º 2
0
 /**
  * @see	\wcf\page\IPage::assignVariables()
  */
 public function assignVariables()
 {
     parent::assignVariables();
     // get phpinfo() output
     ob_start();
     phpinfo();
     $info = ob_get_contents();
     ob_end_clean();
     // parse output
     $info = preg_replace('%^.*<body>(.*)</body>.*$%s', '$1', $info);
     // style fixes
     // remove first table
     $info = preg_replace('%<table.*?</table>(<br />)?%s', '', $info, 1);
     // float logos
     $info = preg_replace('%<img([^>]*)>%s', '<img style="float:right" \\1>', $info, 1);
     // fix tables
     $info = preg_replace('%<h2>(.*?)</h2>\\s*<table( border="0" cellpadding="3" width="600")?>%', '<div class="tabularBox tabularBoxTitle marginTop"><header><h2>\\1</h2></header><table class="table" style="table-layout:fixed;">', $info);
     $info = preg_replace('%<table( border="0" cellpadding="3" width="600")?>%', '<div class="tabularBox marginTop"><table class="table" style="table-layout:fixed;">', $info);
     $info = preg_replace('%<tr><td class="e">(\\w+ )<\\/td><\\/tr>%', '<tr><td class="e">\\1</td><td></td></tr>', $info);
     $info = str_replace('</table>', '</table></div>', $info);
     // fix display of disable_functions & disable_classes
     $info = preg_replace_callback('%<td class="e">disable_(?P<t>functions|classes)</td><td class="v">(?P<l>.*?)</td><td class="v">(?P<m>.*?)</td>%s', function ($match) {
         $ret = '<td class="e">disable_' . $match['t'] . '</td>';
         $ret .= '<td class="v">' . str_replace(' ', ', ', rtrim(wordwrap(str_replace(',', ' ', $match['l'])))) . '</td>';
         $ret .= '<td class="v">' . str_replace(' ', ', ', rtrim(wordwrap(str_replace(',', ' ', $match['m'])))) . '</td>';
         return $ret;
     }, $info);
     WCF::getTPL()->assign(array('phpInfo' => $info));
 }
Ejemplo n.º 3
0
	/**
	 * @see	wcf\page\IPage::assignVariables()
	 */
	public function assignVariables() {
		parent::assignVariables();
		
		WCF::getTPL()->assign(array(
			'applicationList' => $this->applicationList
		));
	}
Ejemplo n.º 4
0
	/**
	 * @see	wcf\page\IPage::assignVariables()
	 */
	public function assignVariables() {
		parent::assignVariables();
		
		WCF::getTPL()->assign(array(
			'footerItems' => $this->footerItems,
			'headerItems' => $this->headerItems
		));
	}
 /**
  * @see wcf\page\IPage::show()
  */
 public function show()
 {
     // set active menu item
     ACPMenu::getInstance()->setActiveMenuItem('wcf.acp.menu.link.package.autoupdate');
     // check master password
     WCFACP::checkMasterPassword();
     parent::show();
 }
 /**
  * @see	\wcf\page\IPage::assignVariables()
  */
 public function assignVariables()
 {
     parent::assignVariables();
     $lastEventTime = $this->eventList->getLastEventTime();
     // removes orphaned and non-accessable events
     UserActivityEventHandler::validateEvents($this->eventList);
     DashboardHandler::getInstance()->loadBoxes('com.woltlab.wcf.user.MembersListPage', $this);
     WCF::getTPL()->assign(array('eventList' => $this->eventList, 'lastEventTime' => $lastEventTime, 'sidebarCollapsed' => UserCollapsibleContentHandler::getInstance()->isCollapsed('com.woltlab.wcf.collapsibleSidebar', 'com.woltlab.wcf.user.MembersListPage'), 'sidebarName' => 'com.woltlab.wcf.user.MembersListPage', 'allowSpidersToIndexThisPage' => true));
 }
 /**
  * @see	\wcf\page\IPage::assignVariables()
  */
 public function readData()
 {
     parent::readData();
     foreach (static::$providerLocales as $locale) {
         $languageCode = substr($locale, 0, 2);
         if (\wcf\system\language\LanguageFactory::getInstance()->getLanguageByCode($languageCode)) {
             $this->availableLocales[$locale] = \wcf\system\WCF::getLanguage()->get('wcf.acp.faker.locale.' . $locale);
         }
     }
 }
Ejemplo n.º 8
0
 /**
  * @see	\wcf\page\IPage::checkPermissions()
  */
 public function checkPermissions()
 {
     AbstractPage::checkPermissions();
     if ($this->attachment->tmpHash) {
         throw new PermissionDeniedException();
     }
     // check private status of attachment's object type
     $objectType = ObjectTypeCache::getInstance()->getObjectType($this->attachment->objectTypeID);
     if ($objectType->private) {
         throw new PermissionDeniedException();
     }
 }
 /**
  * @see wcf\page\IPage::assignVariables()
  */
 public function assignVariables()
 {
     parent::assignVariables();
     $periodform = $this->buildFilterHtml();
     $results = '';
     if (isset($_POST) && !empty($_POST)) {
         $url = 'http://api.schloebe.de/brunzenbaer/api.php?action=get&year=' . $_POST['yearPeriod'] . '&month=' . $_POST['monthPeriod'] . '';
         $json = file_get_contents($url);
         $json = json_decode($json);
         $results = $this->buildResultsHtml($json);
     }
     WCF::getTPL()->assign(array('periodform' => $periodform, 'results' => $results));
 }
Ejemplo n.º 10
0
 /**
  * @see wcf\page\IPage::show()
  */
 public function show()
 {
     // use detailed view if accessing WCF ACP directly
     if (PACKAGE_ID == 1) {
         // base tag is determined on runtime
         $host = RouteHandler::getHost();
         $path = RouteHandler::getPath();
         HeaderUtil::redirect($host . $path . 'index.php/PackageListDetailed/' . SID_ARG_1ST, false);
         exit;
     }
     // enable menu item
     ACPMenu::getInstance()->setActiveMenuItem('wcf.acp.menu.link.package.list');
     parent::show();
 }
Ejemplo n.º 11
0
 /**
  * @see	\wcf\page\IPage::show()
  */
 public function show()
 {
     // check package installation queue
     if ($this->action == 'WCFSetup') {
         $queueID = PackageInstallationDispatcher::checkPackageInstallationQueue();
         if ($queueID) {
             WCF::getTPL()->assign(array('queueID' => $queueID));
             WCF::getTPL()->display('packageInstallationSetup');
             exit;
         }
     }
     // show page
     parent::show();
 }
Ejemplo n.º 12
0
 /**
  * @see	\wcf\page\AbstractPage::assignVariables()
  */
 public function assignVariables()
 {
     parent::assignVariables();
     WCF::getTPL()->assign(array('endDate' => $this->endDate, 'startDate' => $this->startDate, 'availableObjectTypes' => $this->availableObjectTypes));
 }
Ejemplo n.º 13
0
 /**
  * @see	\wcf\page\IPage::assignVariables()
  */
 public function assignVariables()
 {
     parent::assignVariables();
     // assign default variables
     WCF::getTPL()->assign(array('activeTabMenuItem' => $this->activeTabMenuItem, 'errorField' => $this->errorField, 'errorType' => $this->errorType));
 }
Ejemplo n.º 14
0
 /**
  * @see	\wcf\page\IPage::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     // check security token
     $this->checkSecurityToken();
 }
Ejemplo n.º 15
0
 /**
  * @see	\wcf\page\IPage::show()
  */
 public function show()
 {
     parent::show();
     if (!$this->tiny && !$this->thumbnail) {
         // update download count
         $editor = new AttachmentEditor($this->attachment);
         $editor->update(array('downloads' => $this->attachment->downloads + 1, 'lastDownloadTime' => TIME_NOW));
     }
     // send file to client
     $this->fileReader->send();
     exit;
 }
Ejemplo n.º 16
0
	/**
	 * @see	wcf\page\IPage::readData()
	 */
	public function readData() {
		$this->objectType = CategoryHandler::getInstance()->getObjectTypeByName($this->objectTypeName);
		if ($this->objectType === null) {
			throw new SystemException("Unknown category object type with name '".$this->objectTypeName."'");
		}
		
		// check permissions
		$this->checkCategoryPermissions();
		
		$this->readCategories();
		
		// note that the implementation of wcf\system\category\ICategoryType
		// needs to support a object type of the pseudo definition
		// 'com.woltlab.wcf.collapsibleContent.acp' which has to be registered
		// during package installation as a 'com.woltlab.wcf.collapsibleContent'
		// object type if you want to support collapsible categories in the
		// acp; the pseudo object type is used to distinguish between
		// collapsible categories in the frontend and the acp
		$collapsibleObjectTypeName = $this->objectType->getProcessor()->getObjectTypeName('com.woltlab.wcf.collapsibleContent.acp');
		if ($collapsibleObjectTypeName) {
			$this->collapsibleObjectTypeID = UserCollapsibleContentHandler::getInstance()->getObjectTypeID($collapsibleObjectTypeName);
			// get ids of collapsed category
			if ($this->collapsibleObjectTypeID !== null) {
				$this->collapsedCategoryIDs = UserCollapsibleContentHandler::getInstance()->getCollapsedContent($this->collapsibleObjectTypeID);
				$this->collapsedCategoryIDs = array_flip($this->collapsedCategoryIDs);
			}
		}
		
		parent::readData();
	}
Ejemplo n.º 17
0
 /**
  * @see	\wcf\page\IPage::assignVariables()
  */
 public function assignVariables()
 {
     parent::assignVariables();
     WCF::getTPL()->assign(array('hasMarkedItems' => ClipboardHandler::getInstance()->hasMarkedItems(ClipboardHandler::getInstance()->getObjectTypeID('de.codequake.cms.page')), 'objectTypeList' => $this->objectTypeList, 'pageList' => $this->pageList));
 }
Ejemplo n.º 18
0
	/**
	 * @see	wcf\page\IPage::assignVariables()
	 */
	public function assignVariables() {
		parent::assignVariables();
		
		WCF::getTPL()->assign('package', $this->package);
	}
 /**
  * @see	\wcf\page\IPage::assignVariables()
  */
 public function assignVariables()
 {
     parent::assignVariables();
     WCF::getTPL()->assign(array('categoryID' => $this->categoryID, 'categoryList' => $this->categoryList, 'pictures' => $this->categoryID ? $this->pictureList->getObjects() : array()));
 }
Ejemplo n.º 20
0
 /**
  * @see	\wcf\page\IPage::assignVariables()
  */
 public function assignVariables()
 {
     parent::assignVariables();
     WCF::getTPL()->assign(array('objectTypes' => $this->objectTypes));
 }
Ejemplo n.º 21
0
 /**
  * @see	\wcf\page\IPage::assignVariables()
  */
 public function assignVariables()
 {
     parent::assignVariables();
     WCF::getTPL()->assign('items', $this->items);
 }
Ejemplo n.º 22
0
 /**
  * @see	\wcf\page\IPage::assignVariables()
  */
 public function assignVariables()
 {
     parent::assignVariables();
     WCF::getTPL()->assign(array('objectTypes' => $this->objectTypes, 'showInnoDBWarning' => $this->showInnoDBWarning));
 }
 /**
  * @see	\wcf\page\IPage::assignVariables()
  */
 public function assignVariables()
 {
     parent::assignVariables();
     WCF::getTPL()->assign(array('categoryList' => $this->categoryList, 'stats' => $this->stats, 'featuredEntryList' => $this->featuredEntryList, 'allowSpidersToIndexThisPage' => true));
 }
Ejemplo n.º 24
0
 public function assignVariables()
 {
     parent::assignVariables();
     DashboardHandler::getInstance()->loadBoxes('de.codequake.cms.news.news', $this);
     WCF::getTPL()->assign(array('newsID' => $this->newsID, 'news' => $this->news, 'likeData' => MODULE_LIKE && $this->commentList ? $this->commentList->getLikeData() : array(), 'newsLikeData' => $this->likeData, 'commentCanAdd' => WCF::getUser()->userID && WCF::getSession()->getPermission('user.cms.news.canAddComment'), 'commentList' => $this->commentList, 'commentObjectTypeID' => $this->commentObjectTypeID, 'tags' => $this->tags, 'lastCommentTime' => $this->commentList ? $this->commentList->getMinCommentTime() : 0, 'attachmentList' => $this->news->getAttachments(), 'allowSpidersToIndexThisPage' => true, 'sidebarCollapsed' => UserCollapsibleContentHandler::getInstance()->isCollapsed('com.woltlab.wcf.collapsibleSidebar', 'de.codequake.cms.news.news'), 'sidebarName' => 'de.codequake.cms.news.news'));
 }
 /**
  * @see	\wcf\page\AbstractPage::assignVariables()
  */
 public function assignVariables()
 {
     parent::assignVariables();
     MessageQuoteManager::getInstance()->assignVariables();
     WCF::getTPL()->assign(array('allowSpidersToIndexThisPage' => true, 'attachmentList' => $this->entry->getAttachments(), 'commentCanAdd' => WCF::getSession()->getPermission('user.news.canWriteComment'), 'commentList' => $this->commentList, 'commentObjectTypeID' => $this->objectTypeID, 'lastCommentTime' => $this->commentList->getMinCommentTime(), 'likeData' => MODULE_LIKE ? $this->commentList->getLikeData() : array(), 'entry' => $this->entry, 'entryLikeData' => $this->entryLikeData, 'sidebarCollapsed' => UserCollapsibleContentHandler::getInstance()->isCollapsed('com.woltlab.wcf.collapsibleSidebar', 'de.incendium.cms.NewsEntryPage'), 'sidebarName' => 'de.incendium.cms.NewsPage', 'tags' => $this->tags, 'moreEntryList' => $this->moreEntryList));
 }
	/**
	 * @see	wcf\page\IPage::show()
	 */
	public function show() {
		// check master password
		WCFACP::checkMasterPassword();
		
		if ($this->action == 'install') {
			WCF::getSession()->checkPermissions(array('admin.system.package.canInstallPackage'));
		}
		else {
			WCF::getSession()->checkPermissions(array('admin.system.package.canUpdatePackage'));
		}
		
		parent::show();
	}
Ejemplo n.º 27
0
 /**
  * @see wcf\page\IPage::show()
  */
 public function show()
 {
     // enable menu item
     ACPMenu::getInstance()->setActiveMenuItem('wcf.acp.menu.link.package');
     parent::show();
 }
 /**
  * @see	\wcf\page\IPage::show()
  */
 public function show()
 {
     parent::show();
     // update download counter
     if (!WCF::getUser()->userID || WCF::getUser()->userID != $this->entry->userID) {
         $editor = new EntryEditor($this->entry);
         $editor->updateCounters(array('downloads' => 1));
         $editor = new EntryFileEditor($this->file);
         $editor->updateCounters(array('downloads' => 1));
     }
     // send file to client
     $this->fileReader->send();
     exit;
 }
Ejemplo n.º 29
0
 /**
  * @see	\wcf\page\IPage::show()
  */
 public function show()
 {
     // update profile hits
     if ($this->user->userID != WCF::getUser()->userID && !WCF::getSession()->spiderID && !$this->user->isProtected()) {
         $editor = new UserEditor($this->user->getDecoratedObject());
         $editor->updateCounters(array('profileHits' => 1));
         // save visitor
         if (PROFILE_ENABLE_VISITORS && WCF::getUser()->userID && !WCF::getUser()->canViewOnlineStatus) {
             if (($visitor = UserProfileVisitor::getObject($this->user->userID, WCF::getUser()->userID)) !== null) {
                 $editor = new UserProfileVisitorEditor($visitor);
                 $editor->update(array('time' => TIME_NOW));
             } else {
                 UserProfileVisitorEditor::create(array('ownerID' => $this->user->userID, 'userID' => WCF::getUser()->userID, 'time' => TIME_NOW));
             }
         }
     }
     parent::show();
 }
Ejemplo n.º 30
0
 /**
  * @see	\wcf\page\IPage::assignVariables()
  */
 public function assignVariables()
 {
     parent::assignVariables();
     // assign page parameters
     WCF::getTPL()->assign(array('pageNo' => $this->pageNo, 'pages' => $this->pages, 'items' => $this->items, 'itemsPerPage' => $this->itemsPerPage, 'startIndex' => $this->startIndex, 'endIndex' => $this->endIndex, 'objects' => $this->objectList));
 }