/**
  * @see WCF::initTPL()
  */
 protected function initTPL()
 {
     // init style to get template pack id
     $this->initStyle();
     global $packageDirs;
     require_once WCF_DIR . 'lib/system/template/StructuredTemplate.class.php';
     self::$tplObj = new StructuredTemplate(self::getStyle()->templatePackID, self::getLanguage()->getLanguageID(), ArrayUtil::appendSuffix($packageDirs, 'templates/'));
     $this->assignDefaultTemplateVariables();
     // init cronjobs
     $this->initCronjobs();
     // check offline mode
     if (OFFLINE && !self::getUser()->getPermission('user.board.canViewBoardOffline')) {
         $showOfflineError = true;
         foreach (self::$availablePagesDuringOfflineMode as $type => $names) {
             if (isset($_REQUEST[$type])) {
                 foreach ($names as $name) {
                     if ($_REQUEST[$type] == $name) {
                         $showOfflineError = false;
                         break 2;
                     }
                 }
                 break;
             }
         }
         if ($showOfflineError) {
             self::getTPL()->display('offline');
             exit;
         }
     }
     // user ban
     if (self::getUser()->banned && (!isset($_REQUEST['page']) || $_REQUEST['page'] != 'LegalNotice')) {
         throw new NamedUserException(WCF::getLanguage()->getDynamicVariable('wcf.user.banned'));
     }
 }
 /**
  * @see WCF::initTPL()
  */
 protected function initTPL()
 {
     // init style to get template pack id
     $this->initStyle();
     // little dirty fix for XSLT mode
     if (XSLT) {
         ob_start(array('CMSCore', 'editSourceOutput'));
     }
     global $packageDirs;
     require_once WCF_DIR . 'lib/system/template/StructuredTemplate.class.php';
     self::$tplObj = new StructuredTemplate(self::getStyle()->templatePackID, self::getLanguage()->getLanguageID(), ArrayUtil::appendSuffix($packageDirs, 'templates/'));
     $this->assignDefaultTemplateVariables();
     // init cronjobs
     $this->initCronjobs();
     // check offline mode
     if (OFFLINE && !self::getUser()->getPermission('user.cms.canViewCMSOffline')) {
         $showOfflineError = true;
         foreach (self::$availablePagesDuringOfflineMode as $type => $names) {
             if (isset($_REQUEST[$type])) {
                 foreach ($names as $name) {
                     if ($_REQUEST[$type] == $name) {
                         $showOfflineError = false;
                         break 2;
                     }
                 }
             }
             break;
         }
         if ($showOfflineError) {
             self::getTPL()->display('offline');
             exit;
         }
     }
     // user ban
     if (self::getUser()->banned && (!isset($_REQUEST['page']) || $_REQUEST['page'] != 'LegalNotice')) {
         require_once WCF_DIR . 'lib/system/exception/PermissionDeniedException.class.php';
         throw new PermissionDeniedException();
     }
 }
 /**
  * @see Page::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     if (isset($_REQUEST['htUsername'])) {
         $this->htUsername = $_REQUEST['htUsername'];
     }
     if (isset($_REQUEST['htPassword'])) {
         $this->htPassword = $_REQUEST['htPassword'];
     }
     if (isset($_REQUEST['saveAuthData'])) {
         $this->saveAuthData = intval($_REQUEST['saveAuthData']);
     }
     if (isset($_REQUEST['packageUpdateServerID'])) {
         $this->packageUpdateServerID = intval($_REQUEST['packageUpdateServerID']);
     }
     if (!empty($_REQUEST['requestedPage']) || !empty($_REQUEST['requestedForm']) || !empty($_REQUEST['requestedAction'])) {
         // get update server
         require_once WCF_DIR . 'lib/acp/package/update/UpdateServerEditor.class.php';
         $updateServer = new UpdateServerEditor($this->packageUpdateServerID);
         if (!$updateServer->packageUpdateServerID) {
             throw new IllegalLinkException();
         }
         // update update server
         if ($this->saveAuthData) {
             $updateServer->update($updateServer->server, $this->htUsername, $this->htPassword);
         }
         // save auth data in session
         $authData = array('authType' => 'Basic', 'htUsername' => $this->htUsername, 'htPassword' => $this->htPassword);
         // session data
         $packageUpdateAuthData = WCF::getSession()->getVar('packageUpdateAuthData');
         if ($packageUpdateAuthData === null) {
             $packageUpdateAuthData = array();
         }
         $packageUpdateAuthData[$this->packageUpdateServerID] = $authData;
         WCF::getSession()->register('packageUpdateAuthData', $packageUpdateAuthData);
         // remove form=PackageUpdateAuth
         unset($_REQUEST['form'], $_GET['form'], $_POST['form']);
         // set page/form/action
         if (!empty($_REQUEST['requestedPage'])) {
             $_POST['page'] = $_REQUEST['requestedPage'];
         } else {
             if (!empty($_REQUEST['requestedForm'])) {
                 $_POST['form'] = $_REQUEST['requestedForm'];
             } else {
                 $_POST['action'] = $_REQUEST['requestedAction'];
             }
         }
         // remove requestedPage...
         unset($_REQUEST['requestedPage'], $_REQUEST['requestedForm'], $_REQUEST['requestedAction']);
         // start request handler
         global $packageDirs;
         RequestHandler::handle(ArrayUtil::appendSuffix(!empty($packageDirs) ? $packageDirs : array(WCF_DIR), 'lib/acp/'));
         exit;
     }
 }
 /**
  * Initialises the template engine.
  */
 protected function initTPL()
 {
     global $packageDirs;
     self::$tplObj = new ACPTemplate(self::getLanguage()->getLanguageID(), ArrayUtil::appendSuffix($packageDirs, 'acp/templates/'));
     $this->assignDefaultTemplateVariables();
 }
Exemple #5
0
<?php

require_once './global.php';
RequestHandler::handle(ArrayUtil::appendSuffix($packageDirs, 'lib/'));