- Модуль: ldap
- Путь к файлу: ~/bitrix/modules/ldap/classes/general/ldap.php
- Класс: CLDAP
- Вызов: CLDAP::Bind
public function Bind($login, $password)
{
if(!$this->conn)
return false;
global $APPLICATION;
if($this->arFields["CONVERT_UTF8"] == "Y")
{
$login = $APPLICATION->ConvertCharset($login, SITE_CHARSET, "utf-8");
$password = $APPLICATION->ConvertCharset($password, SITE_CHARSET, "utf-8");
}
if(mb_strpos($password, " ") !== false || $password == '')
return false;
if(intval($this->arFields["CONNECTION_TYPE"]) == CLDAP::CONNECTION_TYPE_TLS)
if(!$this->startTls())
return false;
if(!@ldap_bind($this->conn, $login, $password))
{
$APPLICATION->ThrowException('ldap_bind() error. '.$this->getLastErrorDescription());
return false;
}
return true;
}