当前位置: 首页>>代码示例>>PHP>>正文


PHP Source::hasAccess方法代码示例

本文整理汇总了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();
     }
 }
开发者ID:ZerGabriel,项目名称:PackageBuilder,代码行数:36,代码来源:UpdateServerPage.class.php

示例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();
     }
 }
开发者ID:ZerGabriel,项目名称:PackageBuilder,代码行数:17,代码来源:SourceViewPage.class.php

示例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'];
 }
开发者ID:ZerGabriel,项目名称:PackageBuilder,代码行数:37,代码来源:BuildPackageAction.class.php

示例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();
     }
 }
开发者ID:ZerGabriel,项目名称:PackageBuilder,代码行数:20,代码来源:SetBuildOptionsAction.class.php

示例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;
         }
     }
 }
开发者ID:ZerGabriel,项目名称:PackageBuilder,代码行数:14,代码来源:SourceList.class.php


注:本文中的Source::hasAccess方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。