diff --git a/htdocs/admin/ldap.php b/htdocs/admin/ldap.php index 23b559be77b..15f2ec5c79e 100644 --- a/htdocs/admin/ldap.php +++ b/htdocs/admin/ldap.php @@ -1,5 +1,6 @@ + * Copyright (C) 2004 Benoit Mortier * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -117,25 +118,42 @@ if (defined("LDAP_SERVER_HOST") && LDAP_SERVER_HOST && $_GET["action"] == 'test' if ($ds) { - print "connection réussie
"; + print "connection au serveur ldap réussie
"; - ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); + if ((dolibarr_ldap_getversion($ds) == 3) + { + print "Serveur ldap configuré en version 3
"; + } + else + { + print "Serveur ldap configuré en version 2
"; + } - $ldapbind = dolibarr_ldap_bind($ds); + $bind = dolibarr_ldap_bind($ds); - if ($ldapbind) - { - print "connection au dn réussi
"; - } - else - { - print "connection au dn raté
"; - } - ldap_close($ds); + if ($bind) + { + print "connection au dn $dn réussi
"; + } + else + { + print "connection au dn $dn raté
"; + } + + $unbind = dolibarr_ldap_unbind($ds) + + if ($bind) + { + print "déconnection du dn $dn réussi
"; + } + else + { + print "déconnection du dn $dn raté
"; + } } - else + else { - print "connection échouée
"; + print "connection au serveur ldap échouée
"; } }