mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-23 01:41:31 +01:00
Fix error message in LDAP test
This commit is contained in:
@@ -142,7 +142,7 @@ if (!function_exists("ldap_connect")) {
|
|||||||
print dol_get_fiche_head($head, 'contacts', $langs->trans("LDAPSetup"), -1);
|
print dol_get_fiche_head($head, 'contacts', $langs->trans("LDAPSetup"), -1);
|
||||||
|
|
||||||
|
|
||||||
print $langs->trans("LDAPDescContact").'<br>';
|
print '<span class="opacitymedium">'.$langs->trans("LDAPDescContact").'</span><br>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?action=setvalue&token='.newToken().'">';
|
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?action=setvalue&token='.newToken().'">';
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ if (!function_exists("ldap_connect")) {
|
|||||||
print dol_get_fiche_head($head, 'groups', $langs->trans("LDAPSetup"), -1);
|
print dol_get_fiche_head($head, 'groups', $langs->trans("LDAPSetup"), -1);
|
||||||
|
|
||||||
|
|
||||||
print $langs->trans("LDAPDescGroups").'<br>';
|
print '<span class="opacitymedium">'.$langs->trans("LDAPDescGroups").'</span><br>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -190,7 +190,7 @@ print '<input type="hidden" name="token" value="'.newToken().'">';
|
|||||||
print dol_get_fiche_head($head, 'members', $langs->trans("LDAPSetup"), -1);
|
print dol_get_fiche_head($head, 'members', $langs->trans("LDAPSetup"), -1);
|
||||||
|
|
||||||
|
|
||||||
print $langs->trans("LDAPDescMembers").'<br>';
|
print '<span class="opacitymedium">'.$langs->trans("LDAPDescMembers").'</span><br>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ if (!function_exists("ldap_connect")) {
|
|||||||
print dol_get_fiche_head($head, 'memberstypes', $langs->trans("LDAPSetup"), -1);
|
print dol_get_fiche_head($head, 'memberstypes', $langs->trans("LDAPSetup"), -1);
|
||||||
|
|
||||||
|
|
||||||
print $langs->trans("LDAPDescMembersTypes").'<br>';
|
print '<span class="opacitymedium">'.$langs->trans("LDAPDescMembersTypes").'</span><br>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ print '<input type="hidden" name="token" value="'.newToken().'">';
|
|||||||
|
|
||||||
print dol_get_fiche_head($head, 'users', $langs->trans("LDAPSetup"), -1);
|
print dol_get_fiche_head($head, 'users', $langs->trans("LDAPSetup"), -1);
|
||||||
|
|
||||||
print $langs->trans("LDAPDescUsers").'<br>';
|
print '<span class="opacitymedium">'.$langs->trans("LDAPDescUsers").'</span><br>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -263,6 +263,7 @@ class Ldap
|
|||||||
if ($this->result) {
|
if ($this->result) {
|
||||||
$this->bind = $this->result;
|
$this->bind = $this->result;
|
||||||
$connected = 2;
|
$connected = 2;
|
||||||
|
$this->connectedServer = $host;
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
$this->error = ldap_errno($this->connection).' '.ldap_error($this->connection);
|
$this->error = ldap_errno($this->connection).' '.ldap_error($this->connection);
|
||||||
@@ -275,6 +276,7 @@ class Ldap
|
|||||||
if ($this->result) {
|
if ($this->result) {
|
||||||
$this->bind = $this->result;
|
$this->bind = $this->result;
|
||||||
$connected = 2;
|
$connected = 2;
|
||||||
|
$this->connectedServer = $host;
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
$this->error = ldap_errno($this->connection).' '.ldap_error($this->connection);
|
$this->error = ldap_errno($this->connection).' '.ldap_error($this->connection);
|
||||||
@@ -287,6 +289,7 @@ class Ldap
|
|||||||
if ($result) {
|
if ($result) {
|
||||||
$this->bind = $this->result;
|
$this->bind = $this->result;
|
||||||
$connected = 1;
|
$connected = 1;
|
||||||
|
$this->connectedServer = $host;
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
$this->error = ldap_errno($this->connection).' '.ldap_error($this->connection);
|
$this->error = ldap_errno($this->connection).' '.ldap_error($this->connection);
|
||||||
@@ -297,10 +300,8 @@ class Ldap
|
|||||||
|
|
||||||
if (!$connected) {
|
if (!$connected) {
|
||||||
$this->unbind();
|
$this->unbind();
|
||||||
} else {
|
|
||||||
$this->connectedServer = $host;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
} // End loop on each server
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($connected) {
|
if ($connected) {
|
||||||
|
|||||||
Reference in New Issue
Block a user