From f587a8ac775d88e690ca2848fe176ca0642aa6dc Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 12 Jun 2006 12:55:04 +0000 Subject: [PATCH] =?UTF-8?q?d=E9but=20am=E9lioration=20LDAP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/admin/ldap.php | 20 +++++++++++--------- htdocs/lib/ldap.lib.php | 3 +-- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/htdocs/admin/ldap.php b/htdocs/admin/ldap.php index 13ec3c5d364..63b8b2e0d8f 100644 --- a/htdocs/admin/ldap.php +++ b/htdocs/admin/ldap.php @@ -263,7 +263,6 @@ if (function_exists("ldap_connect")) { // Test ldap_connect $ds = dolibarr_ldap_connect(); - print "x".$ds; if ($ds) { print img_picto('','info'); @@ -279,15 +278,18 @@ if (function_exists("ldap_connect")) } // Test ldap_getversion - if ((dolibarr_ldap_getversion($ds) == 3)) + if ($ds) { - print img_picto('','info'); - print $langs->trans("LDAPSetupForVersion3").'
'; - } - else - { - print img_picto('','info'); - print $langs->trans("LDAPSetupForVersion2").'
'; + if ((dolibarr_ldap_getversion($ds) == 3)) + { + print img_picto('','info'); + print $langs->trans("LDAPSetupForVersion3").'
'; + } + else + { + print img_picto('','info'); + print $langs->trans("LDAPSetupForVersion2").'
'; + } } // Test ldap_bind diff --git a/htdocs/lib/ldap.lib.php b/htdocs/lib/ldap.lib.php index 203e1d375ff..025ade58e17 100644 --- a/htdocs/lib/ldap.lib.php +++ b/htdocs/lib/ldap.lib.php @@ -57,13 +57,12 @@ function dolibarr_ldap_connect() if ($ldapconnect) { ldap_set_option($ldapconnect, LDAP_OPT_PROTOCOL_VERSION, $conf->global->LDAP_SERVER_PROTOCOLVERSION); + return $ldapconnect; } else { $this->err .= ldap_error($ldapconnect); } - - return $ldapconnect; }