]> source.dussan.org Git - nextcloud-server.git/commitdiff
LDAP: append port when URL is passed in LDAP Host configuration, fixes #2600
authorArthur Schiwon <blizzz@owncloud.com>
Mon, 3 Jun 2013 21:07:32 +0000 (23:07 +0200)
committerArthur Schiwon <blizzz@owncloud.com>
Tue, 4 Jun 2013 08:32:54 +0000 (10:32 +0200)
apps/user_ldap/lib/connection.php

index 409f3758792ebe147642d0528e9429774b75aa07..31150a5bec57d2c9575e4f3e7af68d82213a6f24 100644 (file)
@@ -621,6 +621,10 @@ class Connection {
                if(empty($host)) {
                        return false;
                }
+               if(strpos($host, '://') !== false) {
+                       //ldap_connect ignores port paramater when URLs are passed
+                       $host .= ':' . $port;
+               }
                $this->ldapConnectionRes = ldap_connect($host, $port);
                if(ldap_set_option($this->ldapConnectionRes, LDAP_OPT_PROTOCOL_VERSION, 3)) {
                        if(ldap_set_option($this->ldapConnectionRes, LDAP_OPT_REFERRALS, 0)) {