Fix error message in LDAP test

This commit is contained in:
Laurent Destailleur
2022-09-16 01:16:59 +02:00
parent 76e8d6d36d
commit 662384ad7d
6 changed files with 9 additions and 8 deletions

View File

@@ -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().'">';

View File

@@ -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>';

View File

@@ -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">';

View File

@@ -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>';

View File

@@ -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>';

View File

@@ -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) {