changed the authticate method to use common::ldapConnect() and not do it yourself, which fails as the ldap-version3 attribute no longer exists

This commit is contained in:
Ralf Becker 2006-06-09 00:07:57 +00:00
parent c30d082ae6
commit d8d93ebd77

View File

@ -46,18 +46,13 @@
$username = $GLOBALS['egw']->translation->convert($username,$GLOBALS['egw']->translation->charset(),'utf-8');
$passwd = $GLOBALS['egw']->translation->convert($passwd,$GLOBALS['egw']->translation->charset(),'utf-8');
if(!$ldap = @ldap_connect($GLOBALS['egw_info']['server']['ldap_host']))
if(!$ldap = $GLOBALS['egw']->common->ldapConnect())
{
$GLOBALS['egw']->log->message('F-Abort, Failed connecting to LDAP server for authenication, execution stopped');
$GLOBALS['egw']->log->commit();
return False;
}
if($GLOBALS['egw_info']['server']['ldap_version3'])
{
ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, 3);
}
/* Login with the LDAP Admin. User to find the User DN. */
if(!@ldap_bind($ldap, $GLOBALS['egw_info']['server']['ldap_root_dn'], $GLOBALS['egw_info']['server']['ldap_root_pw']))
{