[Pkg-owncloud-commits] [owncloud] 09/86: add port to host only, if an URL is used instead of a plain hostname

David Prévot taffit at moszumanska.debian.org
Tue Dec 22 16:51:50 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag v8.1.5
in repository owncloud.

commit ccb2a386a46f6f4c0ca438bed1b1a9c8b10c8bb0
Author: Arthur Schiwon <blizzz at owncloud.com>
Date:   Thu Oct 29 16:21:02 2015 +0100

    add port to host only, if an URL is used instead of a plain hostname
---
 apps/user_ldap/lib/wizard.php | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/apps/user_ldap/lib/wizard.php b/apps/user_ldap/lib/wizard.php
index bceb9a3..7b78b47 100644
--- a/apps/user_ldap/lib/wizard.php
+++ b/apps/user_ldap/lib/wizard.php
@@ -1289,9 +1289,13 @@ class Wizard extends LDAPUtility {
 		if(!is_null($this->cr)) {
 			return $this->cr;
 		}
-		$cr = $this->ldap->connect(
-			$this->configuration->ldapHost.':'.$this->configuration->ldapPort,
-			$this->configuration->ldapPort);
+
+		$host = $this->configuration->ldapHost;
+		if(strpos($host, '://') !== false) {
+			//ldap_connect ignores port parameter when URLs are passed
+			$host .= ':' . $this->configuration->ldapPort;
+		}
+		$cr = $this->ldap->connect($host, $this->configuration->ldapPort);
 
 		$this->ldap->setOption($cr, LDAP_OPT_PROTOCOL_VERSION, 3);
 		$this->ldap->setOption($cr, LDAP_OPT_REFERRALS, 0);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list