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


PHP CExtranet::GetPublicUsers方法代码示例

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


在下文中一共展示了CExtranet::GetPublicUsers方法的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: array

             $strNameFormatted = CUser::FormatName($arParams['NAME_TEMPLATE'], $arTmpUser, $bUseLogin);
             $arResult["Friends"][] = array("USER_ID" => $arFriends[$pref . "_USER_ID"], "USER_NAME" => $arFriends[$pref . "_USER_NAME"], "USER_LAST_NAME" => $arFriends[$pref . "_USER_LAST_NAME"], "USER_SECOND_NAME" => $arFriends[$pref . "_USER_SECOND_NAME"], "USER_LOGIN" => $arFriends[$pref . "_USER_LOGIN"], "USER_NAME_FORMATTED" => $strNameFormatted, "USER_PROFILE_URL" => $pu, "SHOW_PROFILE_LINK" => $canViewProfile, "PATH_TO_MESSAGES_CHAT" => str_replace("#user_id#", $arFriends[$pref . "_USER_ID"], $arParams["PATH_TO_MESSAGES_CHAT"]), "IS_ONLINE" => $arFriends[$pref . "_USER_IS_ONLINE"] == "Y");
         }
     }
 } elseif (CModule::IncludeModule('extranet') && CExtranet::IsExtranetSite()) {
     $arResult["Friends"] = array();
     $arUsersInListID = array();
     $arMyGroupsUsers = CExtranet::GetMyGroupsUsersFull(SITE_ID, true);
     foreach ($arMyGroupsUsers as $arUser) {
         $pu = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER"], array("user_id" => $arUser["ID"]));
         $canViewProfile = CSocNetUserPerms::CanPerformOperation($arResult["UserSelf"]["ID"], $arUser["ID"], "viewprofile", CSocNetUser::IsCurrentUserModuleAdmin());
         $strNameFormatted = CUser::FormatName($arParams['NAME_TEMPLATE'], $arUser, $bUseLogin);
         $arResult["Friends"][] = array("USER_ID" => $arUser["ID"], "USER_NAME" => $arUser["NAME"], "USER_LAST_NAME" => $arUser["LAST_NAME"], "USER_SECOND_NAME" => $arUser["SECOND_NAME"], "USER_LOGIN" => $arUser["LOGIN"], "USER_NAME_FORMATTED" => $strNameFormatted, "USER_PROFILE_URL" => $pu, "SHOW_PROFILE_LINK" => $canViewProfile, "PATH_TO_MESSAGES_CHAT" => str_replace("#user_id#", $arUser["ID"], $arParams["PATH_TO_MESSAGES_CHAT"]), "IS_ONLINE" => $arUser["IS_ONLINE"] == "Y");
         $arUsersInListID[] = $arUser["ID"];
     }
     $arPublicUsers = CExtranet::GetPublicUsers(true);
     foreach ($arPublicUsers as $arUser) {
         if (in_array($arUser["ID"], $arUsersInListID)) {
             continue;
         }
         $pu = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER"], array("user_id" => $arUser["ID"]));
         $canViewProfile = CSocNetUserPerms::CanPerformOperation($arResult["UserSelf"]["ID"], $arUser["ID"], "viewprofile", CSocNetUser::IsCurrentUserModuleAdmin());
         $strNameFormatted = CUser::FormatName($arParams['NAME_TEMPLATE'], $arUser, $bUseLogin);
         $arResult["Friends"][] = array("USER_ID" => $arUser["ID"], "USER_NAME" => $arUser["NAME"], "USER_LAST_NAME" => $arUser["LAST_NAME"], "USER_SECOND_NAME" => $arUser["SECOND_NAME"], "USER_LOGIN" => $arUser["LOGIN"], "USER_NAME_FORMATTED" => $strNameFormatted, "USER_PROFILE_URL" => $pu, "SHOW_PROFILE_LINK" => $canViewProfile, "PATH_TO_MESSAGES_CHAT" => str_replace("#user_id#", $arUser["ID"], $arParams["PATH_TO_MESSAGES_CHAT"]), "IS_ONLINE" => $arUser["IS_ONLINE"] == "Y");
     }
 }
 //Recent users
 $arResult["RecentUsers"] = array();
 $arNavParams = array("nPageSize" => 20, "bDescPageNumbering" => false);
 $dbMessages = CSocNetMessages::GetMessagesUsers($GLOBALS["USER"]->GetID(), $arNavParams);
 while ($arMessages = $dbMessages->GetNext()) {
开发者ID:webgksupport,项目名称:alpina,代码行数:31,代码来源:component.php

示例3: isset

 $APPLICATION->RestartBuffer();
 $EXTERNAL = isset($_GET['EXTERNAL']) && $_GET['EXTERNAL'] != 'I' && CModule::IncludeModule('extranet') ? $_GET['EXTERNAL'] : 'I';
 $site = $EXTERNAL == 'I' ? '' : $_GET['SITE_ID'];
 $search = $_REQUEST['search'];
 if (isset($_GET['SOCNET_GROUP_ID'])) {
     $group_id = $_GET['SOCNET_GROUP_ID'];
 }
 if (isset($_REQUEST["nt"])) {
     preg_match_all("/(#NAME#)|(#NOBR#)|(#\\/NOBR#)|(#LAST_NAME#)|(#SECOND_NAME#)|(#NAME_SHORT#)|(#SECOND_NAME_SHORT#)|\\s|\\,/", urldecode($_REQUEST["nt"]), $matches);
     $nameTemplate = implode("", $matches[0]);
 } else {
     $nameTemplate = CSite::GetNameFormat(false);
 }
 if ($EXTERNAL == "E" && strlen($site) > 0 && !CExtranet::IsIntranetUser()) {
     $arUsersInMyGroupsID = CExtranet::GetMyGroupsUsers($site);
     $arPublicUsersID = CExtranet::GetPublicUsers();
     $arUsersToFilter = array_merge($arUsersInMyGroupsID, $arPublicUsersID);
 } elseif ($EXTERNAL == "EA" && $GLOBALS["APPLICATION"]->GetGroupRight("socialnetwork", false, "Y", "Y", array($site, false)) >= "K") {
     $arExtranetUsersID = CExtranet::GetExtranetGroupUsers();
     $arIntranetUsersID = CExtranet::GetIntranetUsers();
     $arUsersToFilter = array_diff($arExtranetUsersID, $arIntranetUsersID);
 } elseif ($EXTERNAL == "EA") {
     $arUsersInMyGroupsID = CExtranet::GetMyGroupsUsers($site);
     $arIntranetUsersID = CExtranet::GetIntranetUsers();
     $arUsersToFilter = array_diff($arUsersInMyGroupsID, $arIntranetUsersID);
 } elseif ($EXTERNAL == 'I' && CModule::IncludeModule('extranet') && CExtranet::IsIntranetUser($site)) {
     $arUsersToFilter = CExtranet::GetIntranetUsers();
 } elseif (intval($group_id) > 0) {
     $arSonetGroup = CSocNetGroup::GetByID($group_id);
     if (!$arSonetGroup) {
         require_once $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/include/epilog_after.php";
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:ajax.php

示例4: GetList

 function GetList($arParams)
 {
     $sectionId = isset($arParams['sectionId']) && $arParams['sectionId'] !== false ? $arParams['sectionId'] : 0;
     $iblockId = $arParams['iblockId'];
     $xmlId = isset($arParams['xmlId']) && $arParams['xmlId'] !== false ? $arParams['xmlId'] : 0;
     $forExport = $arParams['forExport'] == true;
     $checkPermissions = $forExport ? 'N' : 'Y';
     $bOwner = $arParams['bOwner'] === true;
     $arFilter = array("SECTION_ID" => $sectionId, "IBLOCK_ID" => $iblockId, "ACTIVE" => "Y", "CHECK_PERMISSIONS" => $checkPermissions);
     if ($bOwner) {
         $ownerType = $arParams['ownerType'];
         $ownerId = $arParams['ownerId'];
         if ($ownerType == 'USER') {
             $arFilter["CREATED_BY"] = $ownerId;
             $userId = $arParams['userId'] ? intVal($arParams['userId']) : $GLOBALS['USER']->GetID();
             $bCurUserOwner = $ownerId == $userId;
         } elseif ($ownerType == 'GROUP') {
             $arFilter["SOCNET_GROUP_ID"] = $ownerId;
             $bCurUserOwner = true;
         }
     } else {
         $ownerType = false;
         $ownerId = false;
         $bCurUserOwner = true;
     }
     /* modified by wladart */
     // get superpose calendars
     //if (!$bOwner && CModule::IncludeModule('extranet'))
     if (CModule::IncludeModule('extranet')) {
         if (CExtranet::IsExtranetSite()) {
             $arUsersInMyGroupsID = CExtranet::GetMyGroupsUsers(SITE_ID);
             $arPublicUsersID = CExtranet::GetPublicUsers();
             $arUsersToFilter = array_merge($arUsersInMyGroupsID, $arPublicUsersID);
             $arFilter["CREATED_BY"] = $arUsersToFilter;
         } else {
             $arFilter["CREATED_BY"] = CExtranet::GetIntranetUsers();
         }
     }
     /* --modified by wladart */
     if ($xmlId !== 0) {
         $arFilter['XML_ID'] = $xmlId;
         if ($sectionId === 0) {
             unset($arFilter['SECTION_ID']);
         }
     }
     $rsData = CIBlockSection::GetList(array('ID' => 'ASC'), $arFilter);
     $arCalendars = array();
     if (!$arParams['bSuperposed'] && !$arParams['bOnlyID']) {
         $outerUrl = $GLOBALS['APPLICATION']->GetCurPageParam('', array("action", "bx_event_calendar_request", "clear_cache", "bitrix_include_areas", "bitrix_show_mode", "back_url_admin", "SEF_APPLICATION_CUR_PAGE_URL"), false);
     }
     while ($arRes = $rsData->Fetch()) {
         $privateStatus = CECCalendar::GetPrivateStatus($iblockId, $arRes['ID'], $ownerType);
         if ($privateStatus == 'private' && !$bCurUserOwner) {
             continue;
         }
         if ($arParams['bOnlyID']) {
             $arCalendars[] = intVal($arRes['ID']);
             continue;
         }
         $calendar = array("ID" => intVal($arRes['ID']), "IBLOCK_ID" => $iblockId, "IBLOCK_SECTION_ID" => intVal($arRes['IBLOCK_SECTION_ID']), "NAME" => htmlspecialcharsex($arRes['NAME']), "DESCRIPTION" => htmlspecialcharsex($arRes['DESCRIPTION']), "COLOR" => CECCalendar::GetColor($iblockId, $arRes['ID'], $ownerType), "PRIVATE_STATUS" => $privateStatus);
         if (!$arParams['bSuperposed']) {
             $calendar["OUTLOOK_JS"] = CECCalendar::GetOutlookLink(array('ID' => intVal($arRes['ID']), 'XML_ID' => $arRes['XML_ID'], 'IBLOCK_ID' => $iblockId, 'NAME' => htmlspecialcharsex($arRes['NAME']), 'PREFIX' => CEventCalendar::GetOwnerName(array('iblockId' => $iblockId, 'ownerType' => $ownerType, 'ownerId' => $ownerId)), 'LINK_URL' => $outerUrl));
             $arExport = CECCalendar::GetExportParams($iblockId, $arRes['ID'], $ownerType, $ownerId);
             $calendar["EXPORT"] = $arExport['ALLOW'];
             $calendar["EXPORT_SET"] = $arExport['SET'];
             $calendar["EXPORT_LINK"] = $arExport['LINK'];
         }
         $arCalendars[] = $calendar;
     }
     return $arCalendars;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:71,代码来源:event_calendar.php

示例5: 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

示例6: array

     $obCache->StartDataCache();
     global $CACHE_MANAGER;
     $CACHE_MANAGER->StartTagCache($cache_dir);
     if (defined("BX_COMP_MANAGED_CACHE")) {
         $CACHE_MANAGER->RegisterTag('intranet_users');
         $CACHE_MANAGER->RegisterTag('intranet_birthday');
     }
 }
 $arFilter = array('ACTIVE' => 'Y');
 if ($arResult['DEPARTMENT'] > 0 && (!CModule::IncludeModule('extranet') || !CExtranet::IsExtranetSite())) {
     $arFilter['UF_DEPARTMENT'] = CIntranetUtils::GetIBlockSectionChildren(intval($arResult['DEPARTMENT']));
 } elseif (!CModule::IncludeModule('extranet') || !CExtranet::IsExtranetSite()) {
     $arFilter["!UF_DEPARTMENT"] = false;
 }
 if (CModule::IncludeModule('extranet') && CExtranet::IsExtranetSite()) {
     $arIDs = array_merge(CExtranet::GetMyGroupsUsers(SITE_ID), CExtranet::GetPublicUsers());
     if ($arParams['bCache'] && defined("BX_COMP_MANAGED_CACHE")) {
         $CACHE_MANAGER->RegisterTag('extranet_public');
         $CACHE_MANAGER->RegisterTag('extranet_user_' . $USER->GetID());
     }
     if (count($arIDs) > 0) {
         $arFilter['ID'] = implode('|', array_unique($arIDs));
     } else {
         $bDisable = true;
     }
 }
 $arNavParams = array('nTopCount' => $arParams['NUM_USERS']);
 $dbUsers = CUser::GetList($by = 'CURRENT_BIRTHDAY', $order = "asc", $arFilter, array('SELECT' => array('UF_*'), 'NAV_PARAMS' => $arNavParams));
 $arResult['USERS'] = array();
 $num = 0;
 while ($arUser = $dbUsers->Fetch()) {
开发者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::GetPublicUsers方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。