Skip to content

Commit

Permalink
Fixing #5590 - LDAP Server issues
Browse files Browse the repository at this point in the history
Secondary LDAP server not evaluated when the first one has failed
  • Loading branch information
TheWitness committed Nov 23, 2023
1 parent 5059751 commit 59cf144
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Expand Up @@ -124,6 +124,7 @@ Cacti CHANGELOG
-issue#5585: Refix Issue #4649 using more appropriate method
-issue#5586: CSV export displays data shifted by rrd step interval
-issue#5589: When a graph has a real long cdef in graph debug mode, it forces an undesirable scroll
-issue#5590: Secondary LDAP server not evaluated when the first one has failed
-feature#5577: Provide new templates for ArubaOS switch, Aruba wifi controller and HPE iLO to be available during install

1.2.25
Expand Down
16 changes: 14 additions & 2 deletions lib/ldap.php
Expand Up @@ -727,7 +727,9 @@ function Connect() {
if ($this->referrals == '0') {
if (!ldap_set_option($ldap_conn, LDAP_OPT_REFERRALS, 0)) {
$output = LdapError::GetErrorDetails(LdapError::ProtocolErrorReferral, $ldap_conn, $this->host);

Ldap::RecordError($output);

ldap_close($ldap_conn);

return array(
Expand All @@ -741,7 +743,9 @@ function Connect() {
if ($this->encryption == '2') {
if (!ldap_start_tls($ldap_conn)) {
$output = LdapError::GetErrorDetails(LdapError::ProtocolErrorTls, $ldap_conn, $this->host);

Ldap::RecordError($output);

ldap_close($ldap_conn);

return array(
Expand All @@ -750,9 +754,17 @@ function Connect() {
);
}
}
}

return array('ldap_conn' => $ldap_conn, 'output' => $output);
return array('ldap_conn' => $ldap_conn, 'output' => $output);
} else {
$output = LdapError::GetErrorDetails(LdapError::ConnectionUnavailable, $ldap_conn, $this->host);
Ldap::RecordError($output);

return array(
'ldap_conn' => $ldap_conn,
'output' => $output
);
}
}

function Authenticate() {
Expand Down

0 comments on commit 59cf144

Please sign in to comment.