- Модуль: main
- Путь к файлу: ~/bitrix/modules/main/classes/general/authproviders.php
- Класс: CUserAuthProvider
- Вызов: CUserAuthProvider::GetFormHtml
public function GetFormHtml($arParams=false)
{
global $USER;
if (isset($arParams["user"]) && is_array($arParams["user"]) && $arParams["user"]["disabled"] == "true")
{
return false;
}
if(!$USER->CanDoOperation('view_all_users'))
return false;
$elements = "";
$arFinderParams = array(
"PROVIDER" => $this->id,
"TYPE" => 2,
);
$arLRU = CAccess::GetLastRecentlyUsed($this->id);
if(!empty($arLRU))
{
foreach($arLRU as $i=>$val)
$arLRU[$i] = substr($val, 1);
$nameFormat = CSite::GetNameFormat(false);
//be careful with field list because of CUser::FormatName()
$res = CUser::GetList("LAST_NAME", "asc",
array("ID" => implode("|", $arLRU)),
array("FIELDS" => array('ID', 'NAME', 'LAST_NAME', 'SECOND_NAME', 'LOGIN', 'EMAIL'))
);
while($arUser = $res->Fetch())
{
$arItem = array(
"ID" => "U".$arUser["ID"],
"NAME" => CUser::FormatName($nameFormat, $arUser, true, false),
);
$elements .= CFinder::GetFinderItem($arFinderParams, $arItem);
}
}
$arPanels = array(
array(
"NAME" => GetMessage("authprov_last"),
"ELEMENTS" => $elements,
),
array(
"NAME" => GetMessage("authprov_search"),
"ELEMENTS" => CFinder::GetFinderItem(array("TYPE" => "text"), array("TEXT" => GetMessage("authprov_user"))),
"SEARCH" => "Y",
),
);
$html = CFinder::GetFinderAppearance($arFinderParams, $arPanels);
return array("HTML"=>$html);
}