- Модуль: intranet
- Путь к файлу: ~/bitrix/modules/intranet/classes/general/authproviders.php
- Класс: CIntranetAuthProvider
- Вызов: CIntranetAuthProvider::GetNames
public function GetNames($arCodes)
{
$arID = array();
foreach($arCodes as $code)
{
if(preg_match('/^IU([0-9]+)$/', $code, $match))
$arID['U'][] = $match[1];
else if(preg_match('/^(D|DR)([0-9]+)$/', $code, $match))
$arID['D'][] = $match[2];
}
$arResult = array();
if(!empty($arID['D']))
{
$res = CIBlockSection::GetList(
array('ID' => 'ASC'),
array('IBLOCK_ID' => COption::GetOptionInt('intranet', 'iblock_structure'), 'ID'=>$arID['D']),
false,
array("ID", "NAME")
);
while($arSec = $res->Fetch())
{
$arResult["D".$arSec["ID"]] = array("provider" => GetMessage("authprov_name_out_group"), "name"=>$arSec["NAME"].": ".GetMessage("authprov_check_d"));
$arResult["DR".$arSec["ID"]] = array("provider" => GetMessage("authprov_name_out_group"), "name"=>$arSec["NAME"].": ".GetMessage("authprov_check_dr"));
}
}
if(!empty($arID['U']))
{
$res = CUser::GetList("id", '', array("ID"=>implode("|", $arID['U'])), array("FIELDS"=>array('ID', 'EMAIL', 'LOGIN', 'SECOND_NAME', 'LAST_NAME', 'NAME')));
while($arUser = $res->Fetch())
$arResult["IU".$arUser["ID"]] = array("provider"=>GetMessage("authprov_name_out_user1"), "name"=>CUser::FormatName(CSite::GetNameFormat(false), $arUser, true, false));
}
return !empty($arResult)? $arResult: false;
}