當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。