Skip to content

Commit

Permalink
Fixed issue #17535: Login with LDAP not working
Browse files Browse the repository at this point in the history
  • Loading branch information
ptelu committed Aug 24, 2021
1 parent 45b478b commit f4b1de2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions application/core/plugins/AuthLDAP/AuthLDAP.php
Expand Up @@ -330,7 +330,7 @@ private function createConnection()
}

// Try to connect
if (str_pos($ldapserver, 'ldaps://') === false && str_pos($ldapserver, 'ldap://') === false) {
if (strpos($ldapserver, 'ldaps://') === false && strpos($ldapserver, 'ldap://') === false) {
$ldapserver = 'ldap://' . $ldapserver;
}
$ldapconn = ldap_connect($ldapserver . ':' . (int) $ldapport);
Expand All @@ -350,7 +350,7 @@ private function createConnection()
if (!empty($ldaptls) && $ldaptls == '1' && $ldapver == 3 && preg_match("/^ldaps:\/\//", $ldapserver) == 0) {
// starting TLS secure layer
if (!ldap_start_tls($ldapconn)) {
ldap_close($ldapconn); // all done? close connection
ldap_unbind($ldapconn); // all done? close connection
return array("errorCode" => 100, 'errorMessage' => ldap_error($ldapconn));
}
}
Expand Down

0 comments on commit f4b1de2

Please sign in to comment.