/** * @see Page::readParameters */ public function readParameters() { // if there is no user logged in try to get valid logindata if (!WCF::getUser()->userID && function_exists('getallheaders')) { if (!isset($_SERVER['PHP_AUTH_USER']) && !isset($_SERVER['PHP_AUTH_PW'])) { $this->authenticate(); } else { $this->user = new UserSession(null, null, $_SERVER['PHP_AUTH_USER']); if (!$this->user->checkPassword($_SERVER['PHP_AUTH_PW'])) { $this->authenticate(); } } } else { $this->user = WCF::getUser(); } $sourceID = 0; if (isset($_REQUEST['sourceID'])) { $sourceID = $_REQUEST['sourceID']; } if (isset($_REQUEST['type'])) { $this->type = StringUtil::trim($_REQUEST['type']); } if (!in_array($this->type, $this->validTypes)) { throw new IllegalLinkException(); } $this->source = new Source($sourceID); if (!$this->source->sourceID) { throw new IllegalLinkException(); } if (!$this->source->hasAccess($this->user)) { throw new PermissionDeniedException(); } }
/** * @see Page::readParameters() */ public function readParameters() { $sourceID = 0; if (isset($_GET['sourceID'])) { $sourceID = $_GET['sourceID']; } $this->source = new Source($sourceID); if (!$this->source->sourceID) { throw new IllegalLinkException(); } if (!$this->source->hasAccess()) { throw new PermissionDeniedException(); } }
/** * @see Action::readParameters() */ public function readParameters() { parent::readParameters(); if (isset($_POST['filename'])) { $this->filename = StringUtil::trim($_POST['filename']); } if (isset($_POST['saveSelection'])) { $this->saveSelection = true; } if (isset($_POST['sourceID'])) { $this->sourceID = intval($_POST['sourceID']); } if (isset($_POST['wcfSetupResource'])) { $this->wcfSetupResource = StringUtil::trim($_POST['wcfSetupResource']); // override package name if building WCFSetup $this->filename = 'pn'; } $this->source = new Source($this->sourceID); if (!$this->source->sourceID) { throw new IllegalLinkException(); } if (!$this->source->hasAccess()) { throw new PermissionDeniedException(); } // read selected resources $this->readPackageSelection(); // handle current directory resource $sourceData = WCF::getSession()->getVar('source' . $this->source->sourceID); if ($sourceData === null) { throw new SystemException('Resource directory missing'); } $sourceData = unserialize($sourceData); $this->directory = $sourceData['directory']; }
/** * @see Action::readParameters() */ public function readParameters() { parent::readParameters(); if (isset($_POST['directory'])) { $this->directory = StringUtil::trim($_POST['directory']); } if (isset($_POST['packageName'])) { $this->packageName = StringUtil::trim($_POST['packageName']); } if (isset($_POST['sourceID'])) { $this->sourceID = intval($_POST['sourceID']); } $this->source = new Source($this->sourceID); if (!$this->source->sourceID || !$this->source->hasAccess()) { throw new IllegalLinkException(); } }
/** * @see DatabaseObjectList::readObjects() */ public function readObjects() { $sql = "SELECT\t\t" . (!empty($this->sqlSelects) ? $this->sqlSelects . ',' : '') . "\n\t\t\t\t\tsource.*\n\t\t\tFROM\t\tpb" . PB_N . "_source source\n\t\t\t" . $this->sqlJoins . "\n\t\t\t" . (!empty($this->sqlConditions) ? "WHERE " . $this->sqlConditions : '') . "\n\t\t\t" . (!empty($this->sqlOrderBy) ? "ORDER BY " . $this->sqlOrderBy : ''); $result = WCF::getDB()->sendQuery($sql, $this->sqlLimit, $this->sqlOffset); while ($row = WCF::getDB()->fetchArray($result)) { $source = new Source(null, $row); if (!$this->hasAccessCheck || $source->hasAccess()) { $this->sources[] = $source; } } }