public static function GetUserAttr($iUserID) { static $arResult = array(); if (!empty($arResult[$iUserID])) { return $arResult[$iUserID]; } $iUserID = (int) $iUserID; $arResult[$iUserID] = array(); $obRes = CAccess::GetUserCodes($iUserID); while ($arCode = $obRes->Fetch()) { if (strpos($arCode['ACCESS_CODE'], 'DR') !== 0) { $arResult[$iUserID][strtoupper($arCode['PROVIDER_ID'])][] = $arCode['ACCESS_CODE']; } } if (!empty($arResult[$iUserID]['INTRANET']) && IsModuleInstalled('intranet')) { foreach ($arResult[$iUserID]['INTRANET'] as $iDepartment) { if (substr($iDepartment, 0, 1) === 'D') { $arTree = CIntranetUtils::GetDeparmentsTree(substr($iDepartment, 1), true); foreach ($arTree as $iSubDepartment) { $arResult[$iUserID]['SUBINTRANET'][] = 'D' . $iSubDepartment; } } } } return $arResult[$iUserID]; }
{ inviteDialogStructureLink.innerHTML = oData.name; inviteDialogDepartmentIdField.value = oData.id; inviteDialogDepartmentPopup.close(); } } </script><?php } $iDepartmentID = is_array($_POST) && array_key_exists("arParams", $_POST) && is_array($_POST["arParams"]) && array_key_exists("UF_DEPARTMENT", $_POST["arParams"]) ? intval($_POST["arParams"]["UF_DEPARTMENT"]) : 0; $arStructure = CIntranetUtils::getSubStructure(0, $iDepartmentID > 0 ? false : 1); if (!array_key_exists($iDepartmentID, $arStructure["DATA"])) { $iDepartmentID = 0; } $iStructureCount = count(CIntranetUtils::GetDeparmentsTree()); CModule::IncludeModule('socialnetwork'); $cacheTtl = defined("BX_COMP_MANAGED_CACHE") ? 3153600 : 3600 * 4; $cacheId = 'invite_dialog_sonetgroups_' . $SITE_ID . '_' . ($bExtranetInstalled ? 'Y' : 'N') . '_' . $GLOBALS["USER"]->GetID(); $cacheDir = '/intranet/invite_dialog/' . $SITE_ID . '/' . $GLOBALS["USER"]->GetID(); $obCache = new CPHPCache(); if ($obCache->InitCache($cacheTtl, $cacheId, $cacheDir)) { $arCacheVars = $obCache->GetVars(); $arSonetGroups = $arCacheVars["SONET_GROUPS"]; $arSonetGroupsExtranet = $arCacheVars["SONET_GROUPS_EXTRANET"]; } else { $obCache->StartDataCache(); $arSonetGroups = CSocNetLogDestination::GetSocnetGroup(); $arSonetGroupsExtranet = array(); if ($bExtranetInstalled && CModule::IncludeModule("extranet")) { $arSonetGroupsExtranet = CSocNetLogDestination::GetSocnetGroup(array("site_id" => CExtranet::GetExtranetSiteID()));