public function readParameters()
 {
     parent::readParameters();
     if (isset($_REQUEST['classID'])) {
         $this->contestClass = new ContestClass(intval($_REQUEST['classID']));
     }
 }
 /**
  * @see Page::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     if (!empty($_REQUEST['show'])) {
         $this->show = $_REQUEST['show'];
     }
     if ($this->show == 'downloadFile' && !empty($_REQUEST['fileName'])) {
         WCF::getUser()->checkPermission('admin.system.adminTools.canView');
         $fileName = basename($_REQUEST['fileName']);
         if (!@is_file(WCF_DIR . 'acp/backup/' . $fileName)) {
             WCFACP::getMenu()->setActiveMenuItem('wcf.acp.menu.link.adminTools');
             require_once WCF_DIR . 'lib/system/exception/IllegalLinkException.class.php';
             throw new IllegalLinkException();
         }
         // file type
         header('Content-Type: application/octet-stream');
         // file name
         header('Content-Disposition: attachment; filename="' . $fileName . '"');
         // send file size
         header('Content-Length: ' . filesize(WCF_DIR . 'acp/backup/' . $fileName));
         // no cache headers
         header('Pragma: no-cache');
         header('Expires: 0');
         // send file
         readfile(WCF_DIR . 'acp/backup/' . $fileName);
         exit;
     }
 }
 /**
  * @see Page::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     if (file_exists(WCF_DIR . 'acp/masterPassword.inc.php')) {
         require_once WCF_DIR . 'acp/masterPassword.inc.php';
     }
 }
 /**
  * @see Page::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     // permission
     WCF::getUser()->checkPermission('admin.system.adminTools.canView');
     $this->atSettings = AdminTools::getSettings();
     foreach ($this->atSettings as $k => $val) {
         if (isset($this->{$k})) {
             $this->{$k} = $val;
         }
     }
     // execute cron job
     if (!empty($_REQUEST['cRun'])) {
         if ($_REQUEST['cRun'] == 'journal' && (isset($_REQUEST['log']) || isset($_REQUEST['stat']))) {
             AdminTools::cronRunJournal(0, isset($_REQUEST['log']) ? $_REQUEST['log'] : 0, isset($_REQUEST['stat']) ? $_REQUEST['stat'] : 0, isset($_REQUEST['adminMail']) ? $_REQUEST['adminMail'] : 0);
         } else {
             if ($_REQUEST['cRun'] == 'db' && (isset($_REQUEST['analyze']) || isset($_REQUEST['optimize']) || isset($_REQUEST['backup']))) {
                 AdminTools::cronRunDB(isset($_REQUEST['analyze']) ? $_REQUEST['analyze'] : 0, isset($_REQUEST['optimize']) ? $_REQUEST['optimize'] : 0, isset($_REQUEST['backup']) ? $_REQUEST['backup'] : 0);
             } else {
                 if ($_REQUEST['cRun'] == 'subscriptions') {
                     $cnt = AdminTools::cronCleanUpSubscriptions(false);
                     $this->subscriptionsMsg = WCF::getLanguage()->get('wcf.acp.adminTools.cron.cronCleanUpSubscriptions.cleaned', array('$cnt' => $cnt));
                 }
             }
         }
     }
 }
 /**
  * @see Page::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     if (isset($_POST['updates']) && is_array($_POST['updates'])) {
         $this->updates = $_POST['updates'];
     }
 }
 /**
  * @see Page::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     if (file_exists(WCF_DIR . 'acp/masterPassword.inc.php')) {
         require_once WCF_DIR . 'acp/masterPassword.inc.php';
     } else {
         throw new IllegalLinkException();
     }
 }
 /**
  * @see Page::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     if (isset($_GET['templatePackID'])) {
         $this->templatePackID = intval($_GET['templatePackID']);
     }
     // get available template packs
     $this->templatePacks = TemplatePackEditor::getTemplatePacks();
 }
 public function readParameters()
 {
     parent::readParameters();
     if (isset($_REQUEST['optionID'])) {
         $this->contestRatingoption = new ContestRatingoption(intval($_REQUEST['optionID']));
     }
     if (isset($_REQUEST['classID'])) {
         $this->classID = intval($_REQUEST['classID']);
     }
 }
 /**
  * @see Page::readParameters()
  */
 public function readParameters()
 {
     ACPForm::readParameters();
     if (file_exists(WCF_DIR . 'acp/masterPassword.inc.php')) {
         require_once WCF_DIR . 'acp/masterPassword.inc.php';
     }
     if (defined('MASTER_PASSWORD') && defined('MASTER_PASSWORD_SALT')) {
         throw new IllegalLinkException();
     }
 }
Ejemplo n.º 10
0
 /**
  * @see Page::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     // get types
     $sql = "SELECT\t\t*\n\t\t\tFROM\t\twcf" . WCF_N . "_stat_type\n\t\t\tWHERE\t\tpackageID IN (\n\t\t\t\t\t\tSELECT\tdependency\n\t\t\t\t\t\tFROM\twcf" . WCF_N . "_package_dependency\n\t\t\t\t\t\tWHERE\tpackageID = " . PACKAGE_ID . "\n\t\t\t\t\t)\n\t\t\tORDER BY\ttypeName";
     $result = WCF::getDB()->sendQuery($sql);
     while ($row = WCF::getDB()->fetchArray($result)) {
         $this->types[$row['typeName']] = new DatabaseObject($row);
     }
 }
 /**
  * @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;
     }
 }
 /**
  * @see Page::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     if (isset($_REQUEST['userSuspensionID'])) {
         $this->userSuspensionID = intval($_REQUEST['userSuspensionID']);
     }
     $this->userSuspension = new UserSuspensionEditor($this->userSuspensionID);
     if (!$this->userSuspension->userSuspensionID) {
         throw new IllegalLinkException();
     }
 }
 /**
  * @see Page::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     if (isset($_REQUEST['styleID'])) {
         $this->styleID = intval($_REQUEST['styleID']);
     }
     $this->style = new StyleEditor($this->styleID);
     if (!$this->style->styleID) {
         throw new IllegalLinkException();
     }
 }
 /**
  * @see Page::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     if (isset($_REQUEST['avatarID'])) {
         $this->avatarID = intval($_REQUEST['avatarID']);
     }
     $this->avatar = new AvatarEditor($this->avatarID);
     if (!$this->avatar->avatarID || $this->avatar->userID) {
         throw new IllegalLinkException();
     }
 }
 /**
  * @see Page::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     // get language
     if (isset($_REQUEST['languageID'])) {
         $this->languageID = intval($_REQUEST['languageID']);
     }
     $this->language = new LanguageEditor($this->languageID);
     if (!$this->language->getLanguageID()) {
         throw new IllegalLinkException();
     }
 }
 /**
  * @see Page::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     // permission
     WCF::getUser()->checkPermission('admin.system.adminTools.canView');
     if (isset($_REQUEST['cacheDel'])) {
         $this->cacheDel = $_REQUEST['cacheDel'];
     }
     if (isset($_REQUEST['cacheTpl'])) {
         $this->cacheTpl = $_REQUEST['cacheTpl'];
     }
     if (isset($_REQUEST['cacheLang'])) {
         $this->cacheLang = $_REQUEST['cacheLang'];
     }
     if (isset($_REQUEST['cacheOpt'])) {
         $this->cacheOpt = $_REQUEST['cacheOpt'];
     }
     if (isset($_REQUEST['cacheRSS'])) {
         $this->cacheRSS = $_REQUEST['cacheRSS'];
     }
     $this->spiderCur['spiderIdentifier'] = empty($_POST['spiderIdentifier']) ? '' : $_POST['spiderIdentifier'];
     $this->spiderCur['spiderName'] = empty($_POST['spiderName']) ? '' : $_POST['spiderName'];
     $this->spiderCur['spiderUrl'] = empty($_POST['spiderUrl']) ? '' : $_POST['spiderUrl'];
     $this->spiderID = empty($_POST['spiderID']) ? 0 : $_POST['spiderID'];
     // execute
     if (!empty($_REQUEST['cRun'])) {
         if ($_REQUEST['cRun'] == 'cache' && (!empty($this->cacheDel) || !empty($this->cacheTpl) || !empty($this->cacheLang) || !empty($this->cacheOpt) || !empty($this->cacheRSS))) {
             $ret = AdminTools::cacheDel($this->cacheDel, $this->cacheTpl, $this->cacheLang, $this->cacheOpt, $this->cacheRSS);
             $cntCache = $cntTpl = $cntLang = $cntOpt = $cntRSS = 0;
             if (isset($ret['cacheDel'])) {
                 $cntCache = $ret['cacheDel'];
             }
             if (isset($ret['cacheTpl'])) {
                 $cntTpl = $ret['cacheTpl'];
             }
             if (isset($ret['cacheLang'])) {
                 $cntLang = $ret['cacheLang'];
             }
             if (isset($ret['cacheOpt'])) {
                 $cntOpt = $ret['cacheOpt'];
             }
             if (isset($ret['cacheRSS'])) {
                 $cntRSS = $ret['cacheRSS'];
             }
             if (empty($cntCache) && empty($cntTpl) && empty($cntLang) && empty($cntOpt) && empty($cntRSS)) {
                 $this->errMsg = WCF::getLanguage()->get('wcf.acp.adminTools.error.cache');
             } else {
                 $this->sucMsg = WCF::getLanguage()->get('wcf.acp.adminTools.success.cache', array('$cacheDel' => $cntCache, '$cacheTpl' => $cntTpl, '$cacheLang' => $cntLang, '$cacheOpt' => $cntOpt, '$cacheRSS' => $cntRSS));
             }
         }
     }
 }
 /**
  * @see Page::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     // permission
     WCF::getUser()->checkPermission('admin.system.adminTools.canView');
     if (!empty($_REQUEST['menuItemID'])) {
         $this->menuItemID = $_REQUEST['menuItemID'];
     }
     $this->linkCur['menuItem'] = empty($_POST['menuItem']) ? '' : $_POST['menuItem'];
     $this->linkCur['menuItemLink'] = $this->linkCur['url'] = empty($_POST['menuItemLink']) ? '' : $_POST['menuItemLink'];
     $this->linkCur['showOrder'] = !isset($_POST['showOrder']) ? 0 : $_POST['showOrder'];
     $this->linkCur['linkTarget'] = $this->linkCur['target'] = empty($_POST['linkTarget']) ? '' : $_POST['linkTarget'];
 }
 /**
  * @see Form::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     if (isset($_REQUEST['activePackageID'])) {
         $this->packageID = intval($_REQUEST['activePackageID']);
         if ($this->packageID != 0) {
             try {
                 require_once WCF_DIR . 'lib/acp/package/Package.class.php';
                 $this->package = new Package($this->packageID);
             } catch (SystemException $e) {
                 throw new IllegalLinkException();
             }
         }
     }
 }
 /**
  * @see Page::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     if (!empty($_REQUEST['userID'])) {
         $this->userIDArray[] = intval($_REQUEST['userID']);
     } else {
         $this->userIDArray = WCF::getSession()->getVar('markedUsers');
         if (!is_array($this->userIDArray)) {
             $this->userIDArray = array();
         }
     }
     if (isset($_REQUEST['url'])) {
         $this->url = $_REQUEST['url'];
     }
 }
 /**
  * @see Page::readParameters()
  */
 public function readParameters()
 {
     ACPForm::readParameters();
     if (isset($_REQUEST['pageID'])) {
         $this->pageID = intval($_REQUEST['pageID']);
     }
     // create page object
     $this->page = new DynamicPageEditor($this->pageID);
     // validate
     if (!$this->page->pageID) {
         throw new IllegalLinkException();
     }
     // menu entry
     if ($this->page->menuItemID) {
         $this->menuEntry = new PageMenuItemEditor($this->page->menuItemID);
         // read variables
         $this->menuItemSortOrder = $this->menuEntry->showOrder;
         $this->menuItemIconS = $this->menuEntry->menuItemIconS;
         $this->menuItemIconM = $this->menuEntry->menuItemIconM;
         $this->menuItemTitle = WCF::getLanguage()->get($this->menuEntry->menuItem);
         $this->menuItemPosition = $this->menuEntry->menuPosition;
     }
 }
 /**
  * @see Page::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     // get language
     if (isset($_REQUEST['languageID'])) {
         $this->languageID = intval($_REQUEST['languageID']);
     }
     $this->language = new LanguageEditor($this->languageID);
     if (!$this->language->getLanguageID()) {
         throw new IllegalLinkException();
     }
     // get language category
     if (isset($_REQUEST['languageCategoryID'])) {
         $this->languageCategoryID = intval($_REQUEST['languageCategoryID']);
     } else {
         if (isset($_REQUEST['languageItemID'])) {
             $this->languageItemID = intval($_REQUEST['languageItemID']);
             // get category by item
             $sql = "SELECT\tlanguageCategoryID\n\t\t\t\tFROM\twcf" . WCF_N . "_language_item\n\t\t\t\tWHERE\tlanguageItemID = " . $this->languageItemID;
             $row = WCF::getDB()->getFirstRow($sql);
             if (!empty($row['languageCategoryID'])) {
                 $this->languageCategoryID = $row['languageCategoryID'];
             }
         }
     }
     if ($this->languageCategoryID) {
         $sql = "SELECT\tlanguageCategory\n\t\t\t\tFROM\twcf" . WCF_N . "_language_category\n\t\t\t\tWHERE\tlanguageCategoryID = " . $this->languageCategoryID;
         $row = WCF::getDB()->getFirstRow($sql);
         if (empty($row['languageCategory'])) {
             throw new IllegalLinkException();
         }
         $this->languageCategory = $row['languageCategory'];
     }
     if (isset($_REQUEST['customVariables'])) {
         $this->customVariables = intval($_REQUEST['customVariables']);
     }
 }
 /**
  * @see Page::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     $this->readModeratorSettings();
     $this->readPermissionSettings();
     if (isset($_REQUEST['parentID'])) {
         $this->parentID = intval($_REQUEST['parentID']);
     }
 }
 /**
  * @see	Page::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     if (isset($_REQUEST['hostID'])) {
         $this->hostID = intval($_REQUEST['hostID']);
     }
     // create host object
     $this->host = new Host($this->hostID);
     // validate host
     if (!$this->host->hostID) {
         throw new IllegalLinkException();
     }
 }
 /**
  * @see Page::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     $this->languageCategories = Language::getLanguageCategories();
     $this->languages = WCF::getCache()->get('languages', 'languages');
 }
 /**
  * @see Page::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     // get available suspension types
     $this->availableSuspensionTypes = Suspension::getAvailableSuspensionTypes();
 }
 /**
  * @see Page::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     // get logged tables
     $this->readLoggedTables();
 }
 /**
  * @see Page::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     // get group
     if (isset($_REQUEST['groupID'])) {
         $this->groupID = intval($_REQUEST['groupID']);
         require_once WCF_DIR . 'lib/data/user/group/GroupEditor.class.php';
         $this->group = new GroupEditor($this->groupID);
         if (!$this->group->groupID) {
             throw new IllegalLinkException();
         }
         if (!$this->group->isAccessible()) {
             throw new PermissionDeniedException();
         }
     }
     // active permission
     if (isset($_REQUEST['permissionName'])) {
         $this->permissionName = $_REQUEST['permissionName'];
     }
     $this->readPermissionSettings();
 }
Ejemplo n.º 28
0
 /**
  * @see Page::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     $this->activeMenuItem = $this->action == 'all' ? 'wcf.acp.menu.link.user.pm' : ($this->action == 'group' ? 'wcf.acp.menu.link.group.pm' : 'wcf.acp.menu.link.user.management');
 }