début amélioration LDAP
This commit is contained in:
parent
f587a8ac77
commit
32fa237a5b
@ -277,9 +277,9 @@ if (function_exists("ldap_connect"))
|
|||||||
print "<br>";
|
print "<br>";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test ldap_getversion
|
|
||||||
if ($ds)
|
if ($ds)
|
||||||
{
|
{
|
||||||
|
// Test ldap_getversion
|
||||||
if ((dolibarr_ldap_getversion($ds) == 3))
|
if ((dolibarr_ldap_getversion($ds) == 3))
|
||||||
{
|
{
|
||||||
print img_picto('','info');
|
print img_picto('','info');
|
||||||
@ -290,37 +290,37 @@ 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);
|
||||||
if ($bind)
|
|
||||||
{
|
if ($bind)
|
||||||
print img_picto('','info');
|
{
|
||||||
print "Connexion au dn $dn réussi<br>";
|
print img_picto('','info');
|
||||||
}
|
print "Connexion au dn $dn réussi<br>";
|
||||||
else
|
}
|
||||||
{
|
else
|
||||||
print img_picto('','alerte');
|
{
|
||||||
|
print img_picto('','alerte');
|
||||||
print "Connexion au dn $dn raté : ";
|
print "Connexion au dn $dn raté : ";
|
||||||
print ldap_error($ds);
|
print $bind->err;
|
||||||
print "<br>";
|
print "<br>";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test ldap_unbind
|
// Test ldap_unbind
|
||||||
$unbind = @dolibarr_ldap_unbind($ds);
|
$unbind = @dolibarr_ldap_unbind($ds);
|
||||||
if ($bind)
|
|
||||||
{
|
if ($bind)
|
||||||
print img_picto('','info');
|
{
|
||||||
print "Déconnection du dn $dn réussi<br>";
|
print img_picto('','info');
|
||||||
}
|
print "Déconnection du dn $dn réussi<br>";
|
||||||
else
|
}
|
||||||
{
|
else
|
||||||
print img_picto('','alerte');
|
{
|
||||||
|
print img_picto('','alerte');
|
||||||
print "Déconnection du dn $dn raté";
|
print "Déconnection du dn $dn raté";
|
||||||
print "<br>";
|
print "<br>";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -61,7 +61,7 @@ function dolibarr_ldap_connect()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->err .= ldap_error($ldapconnect);
|
$this->err = ldap_error($ldapconnect);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -79,8 +79,15 @@ function dolibarr_ldap_bind($ds)
|
|||||||
{
|
{
|
||||||
$ldapbind = ldap_bind($ds, $conf->global->LDAP_ADMIN_DN, $conf->global->LDAP_ADMIN_PASS);
|
$ldapbind = ldap_bind($ds, $conf->global->LDAP_ADMIN_DN, $conf->global->LDAP_ADMIN_PASS);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $ldapbind;
|
if ($ldapbind)
|
||||||
|
{
|
||||||
|
return $ldapbind;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->err = ldap_error($ldapbind);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user