début amélioration LDAP

This commit is contained in:
Regis Houssin 2006-06-12 12:55:04 +00:00
parent 7b2d2cf357
commit f587a8ac77
2 changed files with 12 additions and 11 deletions

View File

@ -263,7 +263,6 @@ if (function_exists("ldap_connect"))
{ {
// Test ldap_connect // Test ldap_connect
$ds = dolibarr_ldap_connect(); $ds = dolibarr_ldap_connect();
print "x".$ds;
if ($ds) if ($ds)
{ {
print img_picto('','info'); print img_picto('','info');
@ -279,6 +278,8 @@ if (function_exists("ldap_connect"))
} }
// Test ldap_getversion // Test ldap_getversion
if ($ds)
{
if ((dolibarr_ldap_getversion($ds) == 3)) if ((dolibarr_ldap_getversion($ds) == 3))
{ {
print img_picto('','info'); print img_picto('','info');
@ -289,6 +290,7 @@ if (function_exists("ldap_connect"))
print img_picto('','info'); print img_picto('','info');
print $langs->trans("LDAPSetupForVersion2").'<br>'; print $langs->trans("LDAPSetupForVersion2").'<br>';
} }
}
// Test ldap_bind // Test ldap_bind
$bind = @dolibarr_ldap_bind($ds); $bind = @dolibarr_ldap_bind($ds);

View File

@ -57,13 +57,12 @@ function dolibarr_ldap_connect()
if ($ldapconnect) if ($ldapconnect)
{ {
ldap_set_option($ldapconnect, LDAP_OPT_PROTOCOL_VERSION, $conf->global->LDAP_SERVER_PROTOCOLVERSION); ldap_set_option($ldapconnect, LDAP_OPT_PROTOCOL_VERSION, $conf->global->LDAP_SERVER_PROTOCOLVERSION);
return $ldapconnect;
} }
else else
{ {
$this->err .= ldap_error($ldapconnect); $this->err .= ldap_error($ldapconnect);
} }
return $ldapconnect;
} }