• Модуль: ldap
  • Путь к файлу: ~/bitrix/modules/ldap/classes/general/ldap_server.php
  • Класс: CLdapServer
  • Вызов: CLdapServer::isUserInBannedGroups
static function isUserInBannedGroups($ldap_server_id, $arUserFields)
{
	static $noImportGroups = null;

	if($noImportGroups === null)
	{
		$noImportGroups = array();
		$dbGroups = CLdapServer::GetGroupBan($ldap_server_id);

		while($arGroup = $dbGroups->Fetch())
			$noImportGroups[md5($arGroup['LDAP_GROUP_ID'])] = $arGroup['LDAP_GROUP_ID'];
	}

	if(empty($noImportGroups))
		return false;

	$allUserGroups = $arUserFields['LDAP_GROUPS'];
	$result = false;

	foreach($allUserGroups as $groupId)
	{
		$groupId = trim($groupId);

		if(!empty($groupId) && array_key_exists(md5($groupId), $noImportGroups))
		{
			$result = true;
			break;
		}
	}

	return $result;
}