Skip to content

Commit f1a3405

Browse files
authored
Merge pull request dokuwiki#4309 from nneul/feature-ldap-uri
Support a URI parameter for ldap since current code doesn't actually work
2 parents 9872396 + cff9a54 commit f1a3405

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/plugins/authldap/auth.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,11 @@ protected function openLDAP()
551551
$servers = explode(',', $this->getConf('server'));
552552
foreach ($servers as $server) {
553553
$server = trim($server);
554-
$this->con = @ldap_connect($server, $port);
554+
if (str_starts_with($server, 'ldap://') || str_starts_with($server, 'ldaps://')) {
555+
$this->con = @ldap_connect($server);
556+
} else {
557+
$this->con = @ldap_connect($server, $port);
558+
}
555559
if (!$this->con) {
556560
continue;
557561
}

0 commit comments

Comments
 (0)