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


PHP CExtranet::IsExtranetAdmin方法代码示例

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


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

示例1: GetListItemChangesSinceToken

 function GetListItemChangesSinceToken($listName, $viewFields = '', $query = '', $rowLimit = 0, $changeToken = '')
 {
     global $APPLICATION, $USER;
     if (!($listName_original = CIntranetUtils::checkGUID($listName))) {
         return new CSoapFault('Data error', 'Wrong GUID - ' . $listName);
     }
     if (!$USER->IsAdmin() && (!defined("IS_EXTRANET") || IS_EXTRANET != "Y")) {
         $rsUsers = CUser::GetList($by = "id", $order = "asc", array("ID" => $USER->GetID()), array("SELECT" => array("UF_DEPARTMENT")));
         if ($arUser = $rsUsers->Fetch()) {
             if (intval($arUser["UF_DEPARTMENT"][0]) > 0) {
                 $bUserIntranet = true;
             }
         }
         if (!$bUserIntranet) {
             return new CSoapFault('Data error', 'User has no permissions to read intranet contacts');
         }
     }
     $listName = ToUpper(CIntranetUtils::makeGUID($listName_original));
     $arFilter = array('ACTIVE' => 'Y');
     $page = 1;
     $bUpdateFields = false;
     $tsLastFieldsChange = COption::GetOptionString('intranet', 'ws_contacts_last_fields_change', false);
     $this->bGetImages = COption::GetOptionString('intranet', 'ws_contacts_get_images', 'Y') == 'Y';
     if (strlen($changeToken) > 0) {
         if ($pos = strpos($changeToken, ';')) {
             list($newChangeToken, $page, $last_change) = explode(';', $changeToken);
             $page++;
             $changeToken = $newChangeToken;
         }
         $arFilter['TIMESTAMP_X_1'] = ConvertTimeStamp($changeToken, 'FULL');
         if (!$arFilter['TIMESTAMP_X_1']) {
             return new CSoapFault('Params error', 'Wrong changeToken: ' . $changeToken);
         }
         if ($tsLastFieldsChange !== false && $tsLastFieldsChange > $changeToken) {
             $bUpdateFields = true;
         }
     }
     if (CModule::IncludeModule('extranet') && defined("IS_EXTRANET") && IS_EXTRANET == "Y") {
         $arFilter["GROUPS_ID"] = array(COption::GetOptionInt("extranet", "extranet_group"));
     }
     if (!CModule::IncludeModule('extranet') || defined("IS_EXTRANET") && IS_EXTRANET == "Y" && defined("IS_EMPLOYEES") && IS_EMPLOYEES == "Y" || (!defined("IS_EXTRANET") || IS_EXTRANET != "Y")) {
         $arFilter["!UF_DEPARTMENT"] = false;
     } else {
         $arFilter["UF_DEPARTMENT"] = false;
     }
     // it's needed to check is current user an intranet user if he requested intranet script
     $arListParams = array("SELECT" => array("UF_DEPARTMENT"));
     if ($rowLimit > 0) {
         $arListParams["NAV_PARAMS"] = array("nPageSize" => $rowLimit, "bShowAll" => false, "iNumPage" => $page);
     }
     $obUsers = CUser::GetList($by = 'id', $order = 'asc', $arFilter, $arListParams);
     if (!isset($last_change)) {
         $last_change = 0;
     }
     $data = new CXMLCreator('listitems');
     $data->setAttribute('MinTimeBetweenSyncs', 0);
     $data->setAttribute('RecommendedTimeBetweenSyncs', 180);
     $data->setAttribute('TimeStamp', $this->__makeDateTime());
     $data->setAttribute('EffectivePermMask', 'FullMask');
     $data->addChild($obChanges = new CXMLCreator('Changes'));
     if ((!$changeToken || $bUpdateFields) && $page <= 1) {
         $arGetListResult = $this->GetList($listName);
         $obChanges->addChild($arGetListResult['GetListResult']);
     }
     //TODO: the next thing is to do something like this for all deleted events.
     //$obChanges->addChild($obId = new CXMLCreator('Id'));
     //$obId->setAttribute('ChangeType', 'Delete');
     //$obId->setData('702');
     //<Id ChangeType="Delete">14</Id>
     $data->addChild($obData = new CXMLCreator('rs:data'));
     $counter = 0;
     if (CModule::IncludeModule('extranet') && defined("IS_EXTRANET") && IS_EXTRANET == "Y") {
         $arUsersInMyGroupsID = CExtranet::GetMyGroupsUsers(CExtranet::GetExtranetSiteID());
         $arPublicUsersID = CExtranet::GetPublicUsers();
     }
     while ($arUser = $obUsers->Fetch()) {
         if (CModule::IncludeModule('extranet') && !CExtranet::IsExtranetAdmin()) {
             if (defined("IS_EXTRANET") && IS_EXTRANET == "Y" && (!in_array($arUser["ID"], $arUsersInMyGroupsID) && !in_array($arUser["ID"], $arPublicUsersID) || $arUser["ID"] == $USER->GetID())) {
                 continue;
             }
         }
         if (is_array($arUser['UF_DEPARTMENT']) && count($arUser['UF_DEPARTMENT']) > 0) {
             if ($this->arDepartmentsCache[$arUser['UF_DEPARTMENT'][0]]) {
                 $arUser['WORK_COMPANY'] = $this->arDepartmentsTopCache[$arUser['UF_DEPARTMENT'][0]];
                 $arUser['UF_DEPARTMENT'] = $this->arDepartmentsCache[$arUser['UF_DEPARTMENT'][0]];
             } else {
                 $dbRes = CIBlockSection::GetByID($arUser['UF_DEPARTMENT'][0]);
                 if ($arRes = $dbRes->Fetch()) {
                     if (!defined("IS_EXTRANET") || IS_EXTRANET != "Y" || defined("IS_EMPLOYEES") && IS_EMPLOYEES == "Y") {
                         $arUser['DEPARTMENT'] = $this->arDepartmentsCache[$arUser['UF_DEPARTMENT'][0]] = $arRes['NAME'];
                     }
                     // this case crashes inner cache of top departments
                     //if (!$arUser['WORK_COMPANY'])
                     //{
                     if ($top_section = CIntranetUtils::GetIBlockTopSection($arUser['UF_DEPARTMENT'])) {
                         $dbRes = CIBlockSection::GetByID($top_section);
                         if ($arRes = $dbRes->Fetch()) {
                             $arUser['WORK_COMPANY'] = $this->arDepartmentsTopCache[$arUser['UF_DEPARTMENT'][0]] = $arRes['NAME'];
                         }
                     }
//.........这里部分代码省略.........
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:101,代码来源:ws_contacts.php

示例2: __SLEGetLogRecord

 function __SLEGetLogRecord($logID, $arParams, $arCurrentUserSubscribe, $current_page_date)
 {
     static $isExtranetInstalled, $isExtranetSite, $isExtranetUser, $arUserIdVisible, $arAvailableExtranetUserID, $isExtranetAdmin, $bCurrentUserIsAdmin, $arSocNetFeaturesSettings;
     if (!$isExtranetInstalled) {
         $isExtranetInstalled = CModule::IncludeModule("extranet") ? "Y" : "N";
         $isExtranetSite = $isExtranetInstalled == "Y" && CExtranet::IsExtranetSite() ? "Y" : "N";
         $isExtranetUser = $isExtranetInstalled == "Y" && !CExtranet::IsIntranetUser() ? "Y" : "N";
         $isExtranetAdmin = $isExtranetInstalled == "Y" && CExtranet::IsExtranetAdmin() ? "Y" : "N";
         $bCurrentUserIsAdmin = CSocNetUser::IsCurrentUserModuleAdmin();
         $arSocNetFeaturesSettings = CSocNetAllowed::GetAllowedFeatures();
         if ($isExtranetUser == "Y") {
             $arUserIdVisible = CExtranet::GetMyGroupsUsersSimple(SITE_ID);
         } elseif ($isExtranetInstalled == "Y" && $isExtranetUser != "Y") {
             if ($isExtranetAdmin == "Y" && $bCurrentUserIsAdmin) {
                 $arAvailableExtranetUserID = CExtranet::GetMyGroupsUsers(SITE_ID);
             } else {
                 $arAvailableExtranetUserID = CExtranet::GetMyGroupsUsersSimple(CExtranet::GetExtranetSiteID());
             }
         }
     }
     $cache_time = 31536000;
     $arEvent = array();
     $cache = new CPHPCache();
     $arCacheID = array();
     $arKeys = array("AVATAR_SIZE", "DESTINATION_LIMIT", "CHECK_PERMISSIONS_DEST", "NAME_TEMPLATE", "NAME_TEMPLATE_WO_NOBR", "SHOW_LOGIN", "DATE_TIME_FORMAT", "PATH_TO_USER", "PATH_TO_GROUP", "PATH_TO_CONPANY_DEPARTMENT");
     foreach ($arKeys as $param_key) {
         if (array_key_exists($param_key, $arParams)) {
             $arCacheID[$param_key] = $arParams[$param_key];
         } else {
             $arCacheID[$param_key] = false;
         }
     }
     $cache_id = "log_post_" . $logID . "_" . md5(serialize($arCacheID)) . "_" . SITE_TEMPLATE_ID . "_" . SITE_ID . "_" . LANGUAGE_ID . "_" . FORMAT_DATETIME . "_" . CTimeZone::GetOffset();
     $cache_path = "/sonet/log/" . intval(intval($logID) / 1000) . "/" . $logID . "/entry/";
     if (is_object($cache) && $cache->InitCache($cache_time, $cache_id, $cache_path)) {
         $arCacheVars = $cache->GetVars();
         $arEvent["FIELDS_FORMATTED"] = $arCacheVars["FIELDS_FORMATTED"];
         if (array_key_exists("CACHED_CSS_PATH", $arEvent["FIELDS_FORMATTED"])) {
             if (!is_array($arEvent["FIELDS_FORMATTED"]["CACHED_CSS_PATH"]) && strlen($arEvent["FIELDS_FORMATTED"]["CACHED_CSS_PATH"]) > 0) {
                 $GLOBALS['APPLICATION']->SetAdditionalCSS($arEvent["FIELDS_FORMATTED"]["CACHED_CSS_PATH"]);
             } elseif (is_array($arEvent["FIELDS_FORMATTED"]["CACHED_CSS_PATH"])) {
                 foreach ($arEvent["FIELDS_FORMATTED"]["CACHED_CSS_PATH"] as $css_path) {
                     $GLOBALS['APPLICATION']->SetAdditionalCSS($css_path);
                 }
             }
         }
         if (array_key_exists("CACHED_JS_PATH", $arEvent["FIELDS_FORMATTED"])) {
             if (!is_array($arEvent["FIELDS_FORMATTED"]["CACHED_JS_PATH"]) && $arEvent["FIELDS_FORMATTED"]["CACHED_JS_PATH"] !== '') {
                 $GLOBALS['APPLICATION']->AddHeadScript($arEvent["FIELDS_FORMATTED"]["CACHED_JS_PATH"]);
             } elseif (is_array($arEvent["FIELDS_FORMATTED"]["CACHED_JS_PATH"])) {
                 foreach ($arEvent["FIELDS_FORMATTED"]["CACHED_JS_PATH"] as $js_path) {
                     $GLOBALS['APPLICATION']->AddHeadScript($js_path);
                 }
             }
         }
     } else {
         if (is_object($cache)) {
             $cache->StartDataCache($cache_time, $cache_id, $cache_path);
         }
         $arFilter = array("ID" => $logID);
         $arListParams = array("CHECK_RIGHTS" => "N", "USE_FOLLOW" => "N", "USE_SUBSCRIBE" => "N");
         $arSelect = array("ID", "TMP_ID", "ENTITY_TYPE", "ENTITY_ID", "USER_ID", "EVENT_ID", "LOG_DATE", "LOG_UPDATE", "TITLE_TEMPLATE", "TITLE", "MESSAGE", "TEXT_MESSAGE", "URL", "MODULE_ID", "CALLBACK_FUNC", "EXTERNAL_ID", "SITE_ID", "PARAMS", "COMMENTS_COUNT", "ENABLE_COMMENTS", "SOURCE_ID", "GROUP_NAME", "GROUP_OWNER_ID", "GROUP_INITIATE_PERMS", "GROUP_VISIBLE", "GROUP_OPENED", "GROUP_IMAGE_ID", "USER_NAME", "USER_LAST_NAME", "USER_SECOND_NAME", "USER_LOGIN", "USER_PERSONAL_PHOTO", "USER_PERSONAL_GENDER", "CREATED_BY_NAME", "CREATED_BY_LAST_NAME", "CREATED_BY_SECOND_NAME", "CREATED_BY_LOGIN", "CREATED_BY_PERSONAL_PHOTO", "CREATED_BY_PERSONAL_GENDER", "RATING_TYPE_ID", "RATING_ENTITY_ID", "SOURCE_TYPE");
         $dbEvent = CSocNetLog::GetList(array(), $arFilter, false, false, $arSelect, $arListParams);
         if ($arEvent = $dbEvent->GetNext()) {
             if (defined("BX_COMP_MANAGED_CACHE")) {
                 $GLOBALS["CACHE_MANAGER"]->StartTagCache($cache_path);
                 $GLOBALS["CACHE_MANAGER"]->RegisterTag("USER_NAME_" . intval($arEvent["USER_ID"]));
                 $GLOBALS["CACHE_MANAGER"]->RegisterTag("SONET_LOG_" . intval($arEvent["ID"]));
                 if ($arEvent["ENTITY_TYPE"] == SONET_ENTITY_GROUP) {
                     $GLOBALS["CACHE_MANAGER"]->RegisterTag("sonet_group_" . $arEvent["ENTITY_ID"]);
                 }
             }
             $arEvent["EVENT_ID_FULLSET"] = CSocNetLogTools::FindFullSetEventIDByEventID($arEvent["EVENT_ID"]);
             if ($arEvent["ENTITY_TYPE"] == SONET_ENTITY_GROUP) {
                 static $arSiteWorkgroupsPage;
                 if (!$arSiteWorkgroupsPage && (IsModuleInstalled("extranet") || is_set($arEvent["URL"]) && strpos($arEvent["URL"], "#GROUPS_PATH#") !== false)) {
                     $rsSite = CSite::GetList($by = "sort", $order = "desc", array("ACTIVE" => "Y"));
                     while ($arSite = $rsSite->Fetch()) {
                         $arSiteWorkgroupsPage[$arSite["ID"]] = COption::GetOptionString("socialnetwork", "workgroups_page", $arSite["DIR"] . "workgroups/", $arSite["ID"]);
                     }
                 }
                 if (is_set($arEvent["URL"]) && isset($arSiteWorkgroupsPage[SITE_ID])) {
                     $arEvent["URL"] = str_replace("#GROUPS_PATH#", $arSiteWorkgroupsPage[SITE_ID], $arEvent["URL"]);
                 }
             }
             $arEventTmp = CSocNetLogTools::FindLogEventByID($arEvent["EVENT_ID"]);
             if ($arEventTmp && isset($arEventTmp["CLASS_FORMAT"]) && isset($arEventTmp["METHOD_FORMAT"])) {
                 $arEvent["UF"] = $GLOBALS["USER_FIELD_MANAGER"]->GetUserFields("SONET_LOG", $arEvent["ID"], LANGUAGE_ID);
                 $arEvent["FIELDS_FORMATTED"] = call_user_func(array($arEventTmp["CLASS_FORMAT"], $arEventTmp["METHOD_FORMAT"]), $arEvent, $arParams);
                 if (is_array($arEvent["FIELDS_FORMATTED"])) {
                     if (isset($arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]) && is_array($arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]) && isset($arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["MESSAGE"])) {
                         if (in_array($arEvent["EVENT_ID"], array('calendar'))) {
                             $arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["MESSAGE"] = htmlspecialcharsback($arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["MESSAGE"]);
                         } else {
                             $arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["MESSAGE"] = CSocNetTextParser::closetags(htmlspecialcharsback($arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["MESSAGE"]));
                         }
                     }
                     if (isset($arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]) && is_array($arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"])) {
                         $arFields2Cache = array("URL", "STYLE", "DESTINATION", "DESTINATION_MORE", "TITLE_24", "TITLE_24_2", "TITLE_24_2_STYLE", "IS_IMPORTANT", "MESSAGE", "FOOTER_MESSAGE", "MESSAGE_TITLE_24", "DATETIME_FORMATTED", "LOG_DATE_FORMAT", "MENU", "COMMENT_URL");
                         foreach ($arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"] as $field => $value) {
//.........这里部分代码省略.........
开发者ID:webgksupport,项目名称:alpina,代码行数:101,代码来源:include.php

示例3: GetAddressbookExtranetUserFilter

 private static function GetAddressbookExtranetUserFilter($siteId, $arFilter = array())
 {
     if (CModule::IncludeModule('extranet') && (CExtranet::IsExtranetSite($siteId) || !CExtranet::IsIntranetUser($siteId))) {
         if (!CExtranet::IsExtranetAdmin()) {
             $arIDs = array_merge(CExtranet::GetMyGroupsUsers($siteId), CExtranet::GetPublicUsers());
             if (array_key_exists("ID", $arFilter)) {
                 $arIDs1 = $arFilter["ID"];
                 if (!is_array($arIDs1)) {
                     $arIDs1 = explode("|", $arIDs1);
                 }
                 $arIDs = array_intersect($arIDs1, $arIDs);
             }
             if (count($arIDs) > 0) {
                 $arFilter['ID'] = implode('|', array_unique($arIDs));
             } else {
                 $arFilter['ID'] = 0;
             }
         }
     } else {
         $arFilter['!UF_DEPARTMENT'] = false;
     }
     return $arFilter;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:23,代码来源:account.php

示例4: GetMessage

             $arResult["bResult"] = "E";
         }
     } else {
         $arResult["strMessage"] = GetMessage("SONET_LOG_FAVORITES_INCORRECT_LOG_ID");
         $arResult["bResult"] = "E";
     }
 } elseif ($action == "delete" && CSocNetUser::IsCurrentUserModuleAdmin(SITE_ID, false)) {
     $log_id = intval($_REQUEST["log_id"]);
     if ($log_id > 0) {
         $arResult["bResult"] = CSocNetLog::Delete($log_id) ? "Y" : "N";
     }
 } elseif ($action == "get_more_destination") {
     $isExtranetInstalled = CModule::IncludeModule("extranet") ? "Y" : "N";
     $isExtranetSite = $isExtranetInstalled == "Y" && CExtranet::IsExtranetSite() ? "Y" : "N";
     $isExtranetUser = $isExtranetInstalled == "Y" && !CExtranet::IsIntranetUser() ? "Y" : "N";
     $isExtranetAdmin = $isExtranetInstalled == "Y" && CExtranet::IsExtranetAdmin() ? "Y" : "N";
     if ($isExtranetUser == "Y") {
         $arUserIdVisible = CExtranet::GetMyGroupsUsersSimple(SITE_ID);
     } elseif ($isExtranetInstalled == "Y" && $isExtranetUser != "Y" && $isExtranetAdmin != "Y") {
         if ($isExtranetAdmin == "Y" && $bCurrentUserIsAdmin) {
             $arAvailableExtranetUserID = CExtranet::GetMyGroupsUsers(SITE_ID);
         } else {
             $arAvailableExtranetUserID = CExtranet::GetMyGroupsUsersSimple(CExtranet::GetExtranetSiteID());
         }
     }
     $arResult["arDestinations"] = false;
     $log_id = intval($_REQUEST["log_id"]);
     $created_by_id = intval($_REQUEST["created_by_id"]);
     $iDestinationLimit = intval($_REQUEST["dlim"]);
     if ($log_id > 0) {
         $arRights = array();
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:ajax.php

示例5: IsProfileViewableByID

 function IsProfileViewableByID($user_id, $site_id = false)
 {
     global $USER;
     if (CExtranet::IsExtranetAdmin() || IsModuleInstalled("bitrix24") && CSocNetUser::IsCurrentUserModuleAdmin(SITE_ID, false)) {
         return true;
     }
     if (IntVal($user_id) > 0 && strlen(CExtranet::GetExtranetSiteID()) > 0) {
         $dbUser = CUser::GetByID($user_id);
         $arUser = $dbUser->Fetch();
         if (!CExtranet::IsProfileViewable($arUser, $site_id)) {
             return false;
         }
     }
     return true;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:15,代码来源:extranet.php

示例6: array

     if ($arParams['bCache']) {
         $CACHE_MANAGER->RegisterTag('intranet_department_' . $arFilter['UF_DEPARTMENT'][0]);
     }
     $dbRes = CIBlockSection::GetList(array('ID' => 'ASC'), array('ID' => $arFilter['UF_DEPARTMENT'][0], 'IBLOCK_ID' => COption::GetOptionInt('intranet', 'iblock_structure')), false, array('UF_HEAD'));
     if (($arSection = $dbRes->GetNext()) && $arSection['UF_HEAD'] > 0) {
         $dbUsers = $obUser->GetList($sort_by = 'last_name', $sort_dir = 'asc', array('ID' => $arSection['UF_HEAD'], 'ACTIVE' => 'Y'), array('SELECT' => array('UF_*')));
         if ($arRes = $dbUsers->Fetch()) {
             $arResult['DEPARTMENT_HEAD'] = $arSection['UF_HEAD'];
             $arFilter['!ID'] = $arResult['DEPARTMENT_HEAD'];
             $arResult['USERS'][$arRes['ID']] = $arRes;
         }
     }
 }
 $bDisable = false;
 if (CModule::IncludeModule('extranet')) {
     if (CExtranet::IsExtranetSite() && !CExtranet::IsExtranetAdmin()) {
         $arIDs = array_merge(CExtranet::GetMyGroupsUsers(SITE_ID), CExtranet::GetPublicUsers());
         if ($arParams['bCache']) {
             $CACHE_MANAGER->RegisterTag('extranet_public');
             $CACHE_MANAGER->RegisterTag('extranet_user_' . $USER->GetID());
         }
         if (false !== ($key = array_search($USER->GetID(), $arIDs))) {
             unset($arIDs[$key]);
         }
         if (count($arIDs) > 0) {
             $arFilter['ID'] = implode('|', array_unique($arIDs));
         } else {
             $bDisable = true;
         }
     }
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:component.php

示例7: executeComponent

 public function executeComponent()
 {
     if (!CModule::IncludeModule('intranet')) {
         ShowError(GetMessage('INTR_ISL_INTRANET_MODULE_NOT_INSTALLED'));
         return;
     }
     if (!CModule::IncludeModule('socialnetwork')) {
         return;
     }
     $showDepHeadAdditional = $this->arParams['SHOW_DEP_HEAD_ADDITIONAL'] == 'Y';
     $bNav = $this->arParams['SHOW_NAV_TOP'] == 'Y' || $this->arParams['SHOW_NAV_BOTTOM'] == 'Y';
     $isEnoughFiltered = $this->fillFilter();
     list($cntStartCacheId, $cntStart) = $this->getCacheIdWithDepartment();
     if ($this->arParams['SHOW_UNFILTERED_LIST'] == 'N' && !$this->bExcel && !$isEnoughFiltered) {
         $this->arResult['EMPTY_UNFILTERED_LIST'] = 'Y';
         $this->includeComponentTemplate();
         return;
     }
     $this->arParams['bCache'] = $cntStart == count($this->arFilter) && !$this->bExcel && $this->arParams['CACHE_TYPE'] == 'Y' && $this->arParams['CACHE_TIME'] > 0;
     $this->arResult['FILTER_VALUES'] = $this->arFilter;
     if (!$this->bExcel && $bNav) {
         CPageOption::SetOptionString("main", "nav_page_in_session", "N");
     }
     $bFromCache = false;
     if ($this->arParams['bCache']) {
         if ($bFromCache = $this->initCache($cntStartCacheId)) {
             $vars = $this->obCache->getVars();
             $this->arResult['USERS'] = $vars['USERS'];
             $this->arResult['DEPARTMENTS'] = $vars['DEPARTMENTS'];
             $this->arResult['DEPARTMENT_HEAD'] = $vars['DEPARTMENT_HEAD'];
             $this->arResult['USERS_NAV'] = $vars['USERS_NAV'];
             $strUserIDs = $vars['STR_USER_ID'];
         } else {
             $this->obCache->startDataCache();
             $this->getCacheManager()->startTagCache($this->cacheDir);
             $this->getCacheManager()->registerTag('intranet_users');
         }
     }
     if (!$bFromCache) {
         // get users list
         $obUser = new CUser();
         $arSelect = array('ID', 'ACTIVE', 'CONFIRM_CODE', 'DEP_HEAD', 'GROUP_ID', 'NAME', 'LAST_NAME', 'SECOND_NAME', 'LOGIN', 'EMAIL', 'LID', 'DATE_REGISTER', 'PERSONAL_PROFESSION', 'PERSONAL_WWW', 'PERSONAL_ICQ', 'PERSONAL_GENDER', 'PERSONAL_BIRTHDATE', 'PERSONAL_PHOTO', 'PERSONAL_PHONE', 'PERSONAL_FAX', 'PERSONAL_MOBILE', 'PERSONAL_PAGER', 'PERSONAL_STREET', 'PERSONAL_MAILBOX', 'PERSONAL_CITY', 'PERSONAL_STATE', 'PERSONAL_ZIP', 'PERSONAL_COUNTRY', 'PERSONAL_NOTES', 'WORK_COMPANY', 'WORK_DEPARTMENT', 'WORK_POSITION', 'WORK_WWW', 'WORK_PHONE', 'WORK_FAX', 'WORK_PAGER', 'WORK_STREET', 'WORK_MAILBOX', 'WORK_CITY', 'WORK_STATE', 'WORK_ZIP', 'WORK_COUNTRY', 'WORK_PROFILE', 'WORK_LOGO', 'WORK_NOTES', 'PERSONAL_BIRTHDAY', 'LAST_ACTIVITY_DATE', 'LAST_LOGIN', 'IS_ONLINE');
         $this->arResult['USERS'] = array();
         $this->arResult['DEPARTMENTS'] = array();
         $this->arResult['DEPARTMENT_HEAD'] = 0;
         // disable/enable appearing of department head on page
         if ($showDepHeadAdditional && !empty($this->arFilter['UF_DEPARTMENT']) && is_array($this->arFilter['UF_DEPARTMENT'])) {
             if ($this->arParams['bCache']) {
                 $this->getCacheManager()->registerTag('intranet_department_' . $this->arFilter['UF_DEPARTMENT'][0]);
             }
             $managerId = CIntranetUtils::GetDepartmentManagerID($this->arFilter['UF_DEPARTMENT'][0]);
             $appendManager = CUser::GetByID($managerId)->Fetch();
             if ($appendManager) {
                 $this->arResult['DEPARTMENT_HEAD'] = $appendManager['ID'];
                 $this->arFilter['!ID'] = $appendManager['ID'];
                 $this->arResult['USERS'][$appendManager['ID']] = $appendManager;
             }
         }
         $bDisable = false;
         if (CModule::IncludeModule('extranet')) {
             if (CExtranet::IsExtranetSite() && !CExtranet::IsExtranetAdmin()) {
                 $arIDs = array_merge(CExtranet::GetMyGroupsUsers(SITE_ID), CExtranet::GetPublicUsers());
                 if ($this->arParams['bCache']) {
                     $this->getCacheManager()->registerTag('extranet_public');
                     $this->getCacheManager()->registerTag('extranet_user_' . $this->getUser()->getID());
                 }
                 if (false !== ($key = array_search($this->getUser()->getID(), $arIDs))) {
                     unset($arIDs[$key]);
                 }
                 if (count($arIDs) > 0) {
                     $this->arFilter['ID'] = implode('|', array_unique($arIDs));
                 } else {
                     $bDisable = true;
                 }
             }
         }
         if ($bDisable) {
             $dbUsers = new CDBResult();
             $dbUsers->initFromArray(array());
         } else {
             $arListParams = array('SELECT' => array('UF_*'), 'ONLINE_INTERVAL' => static::LAST_ACTIVITY);
             if (!$this->bExcel && $this->arParams['USERS_PER_PAGE'] > 0) {
                 $arListParams['NAV_PARAMS'] = array('nPageSize' => $this->arParams['USERS_PER_PAGE'], 'bShowAll' => false);
             }
             $dbUsers = $obUser->GetList($sortBy = 'last_name', $sortDir = 'asc', $this->arFilter, $arListParams);
         }
         $strUserIDs = '';
         while ($arUser = $dbUsers->Fetch()) {
             $this->arResult['USERS'][$arUser['ID']] = $arUser;
             $strUserIDs .= ($strUserIDs === '' ? '' : '|') . $arUser['ID'];
         }
         $structure = CIntranetUtils::getStructure();
         $this->arResult['DEPARTMENTS'] = $structure['DATA'];
         $this->setDepWhereUserIsHead();
         $arAdmins = array();
         /** @noinspection PhpUndefinedVariableInspection */
         $rsUsers = CUser::GetList($o, $b, array("GROUPS_ID" => array(static::ADMIN_GROUP_ID)), array("SELECT" => array("ID")));
         while ($ar = $rsUsers->Fetch()) {
             $arAdmins[$ar["ID"]] = $ar["ID"];
         }
//.........这里部分代码省略.........
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:101,代码来源:class.php


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