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


PHP UserRights::IsPortalUser方法代码示例

本文整理汇总了PHP中UserRights::IsPortalUser方法的典型用法代码示例。如果您正苦于以下问题:PHP UserRights::IsPortalUser方法的具体用法?PHP UserRights::IsPortalUser怎么用?PHP UserRights::IsPortalUser使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UserRights的用法示例。


在下文中一共展示了UserRights::IsPortalUser方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Display

 public function Display(WebPage $oPage, DataTableSettings $oSettings, $bActionsMenu, $sSelectMode, $bViewLink, $aExtraParams)
 {
     $this->oDefaultSettings = $oSettings;
     // Identified tables can have their own specific settings
     $oCustomSettings = DataTableSettings::GetTableSettings($this->aClassAliases, $this->sTableId);
     if ($oCustomSettings != null) {
         // Custom settings overload the default ones
         $this->bUseCustomSettings = true;
         if ($this->oDefaultSettings->iDefaultPageSize == 0) {
             $oCustomSettings->iDefaultPageSize = 0;
         }
     } else {
         $oCustomSettings = $oSettings;
     }
     if ($oCustomSettings->iDefaultPageSize > 0) {
         $this->oSet->SetLimit($oCustomSettings->iDefaultPageSize);
     }
     $this->oSet->SetOrderBy($oCustomSettings->GetSortOrder());
     // Load only the requested columns
     $aColumnsToLoad = array();
     foreach ($oCustomSettings->aColumns as $sAlias => $aColumnsInfo) {
         foreach ($aColumnsInfo as $sAttCode => $aData) {
             if ($sAttCode != '_key_') {
                 if ($aData['checked']) {
                     $aColumnsToLoad[$sAlias][] = $sAttCode;
                 } else {
                     // See if this column is a must to load
                     $sClass = $this->aClassAliases[$sAlias];
                     $oAttDef = MetaModel::GetAttributeDef($sClass, $sAttCode);
                     if ($oAttDef->alwaysLoadInTables()) {
                         $aColumnsToLoad[$sAlias][] = $sAttCode;
                     }
                 }
             }
         }
     }
     $this->oSet->OptimizeColumnLoad($aColumnsToLoad);
     $bToolkitMenu = true;
     if (isset($aExtraParams['toolkit_menu'])) {
         $bToolkitMenu = (bool) $aExtraParams['toolkit_menu'];
     }
     if (UserRights::IsPortalUser()) {
         // Portal users have a limited access to data, for now they can only see what's configured for them
         $bToolkitMenu = false;
     }
     return $this->GetAsHTML($oPage, $oCustomSettings->iDefaultPageSize, $oCustomSettings->iDefaultPageSize, 0, $oCustomSettings->aColumns, $bActionsMenu, $bToolkitMenu, $sSelectMode, $bViewLink, $aExtraParams);
 }
开发者ID:henryavila,项目名称:itop,代码行数:47,代码来源:datatable.class.inc.php

示例2: ChangeLocation

 /**
  * Overridable: depending on the user, head toward a dedicated portal
  * @param bool $bIsAllowedToPortalUsers Whether or not the current page is considered as part of the portal
  * @param int $iOnExit How to complete the call: redirect or return a code
  */
 protected static function ChangeLocation($bIsAllowedToPortalUsers, $iOnExit = self::EXIT_PROMPT)
 {
     if (!$bIsAllowedToPortalUsers && UserRights::IsPortalUser()) {
         if ($iOnExit == self::EXIT_RETURN) {
             return self::EXIT_CODE_PORTALUSERNOTAUTHORIZED;
         } else {
             // No rights to be here, redirect to the portal
             header('Location: ' . utils::GetAbsoluteUrlAppRoot() . 'portal/index.php');
         }
     } else {
         return self::EXIT_CODE_OK;
     }
 }
开发者ID:kira8565,项目名称:ITOP203-ZHCN,代码行数:18,代码来源:loginwebpage.class.inc.php


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