From ea4771ca15ece4f43a06ed2581d78b123ec7a21d Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Fri, 23 Jan 2004 13:31:09 +0000 Subject: [PATCH] Ajoute protocole de test --- htdocs/admin/ldap.php | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/htdocs/admin/ldap.php b/htdocs/admin/ldap.php index a8187a7c0c4..c02d7efd0c7 100644 --- a/htdocs/admin/ldap.php +++ b/htdocs/admin/ldap.php @@ -19,6 +19,7 @@ * $Source$ */ require("./pre.inc.php"); +require (DOL_DOCUMENT_ROOT."/lib/ldap.lib.php"); if ($_GET["action"] == 'setvalue' && $user->admin) { @@ -105,41 +106,35 @@ print ''; print ''; +print 'test
'; -if (defined("LDAP_SERVER_HOST") && LDAP_SERVER_HOST && $test) +if (defined("LDAP_SERVER_HOST") && LDAP_SERVER_HOST && $_GET["action"] == 'test') { - $ds = ldap_connect(LDAP_SERVER_HOST); + $ds = dolibarr_ldap_connect(); if ($ds) { - $connect = "ok"; + print "connect ok
"; //ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); - if ($pass) + + $ldapbind = dolibarr_ldap_bind($ds); + if ($ldapbind) { - $ldapbind=ldap_bind($ds, $dn, $pass); + print "bind ok
"; } else { - $ldapbind=ldap_bind($ds, $dn); - if ($ldapbind) - { - $bind = "ok"; - } - else - { - $bind = "erreur"; - } + print "bind erreur
"; } + ldap_close($ds); } else { - $connect = "erreur"; + print "connect erreur
"; } } - - $db->close(); llxFooter();