本文整理汇总了PHP中Source::hasAccess方法的典型用法代码示例。如果您正苦于以下问题:PHP Source::hasAccess方法的具体用法?PHP Source::hasAccess怎么用?PHP Source::hasAccess使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Source
的用法示例。
在下文中一共展示了Source::hasAccess方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: readParameters
/**
* @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();
}
}
示例2: readParameters
/**
* @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();
}
}
示例3: readParameters
/**
* @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'];
}
示例4: readParameters
/**
* @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();
}
}
示例5: readObjects
/**
* @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;
}
}
}