diff --git a/plugins/Authentication/ActiveDirectory/adLDAP.php b/plugins/Authentication/ActiveDirectory/adLDAP.php index ba316961d..70916bbcc 100644 --- a/plugins/Authentication/ActiveDirectory/adLDAP.php +++ b/plugins/Authentication/ActiveDirectory/adLDAP.php @@ -654,9 +654,9 @@ public function connect() // Connect to the AD/LDAP server as the username/password $domainController = $this->randomController(); if ($this->useSSL) { - $this->ldapConnection = ldap_connect("ldaps://" . $domainController, $this->adPort); + $this->ldapConnection = ldap_connect("ldaps://" . $domainController . ":" . $this->adPort); } else { - $this->ldapConnection = ldap_connect($domainController, $this->adPort); + $this->ldapConnection = ldap_connect("ldap://" . $domainController . ":" . $this->adPort); } // Set some ldap options for talking to AD diff --git a/plugins/Authentication/Ldap/LDAP2.php b/plugins/Authentication/Ldap/LDAP2.php index f9c2d267c..ba69d691b 100644 --- a/plugins/Authentication/Ldap/LDAP2.php +++ b/plugins/Authentication/Ldap/LDAP2.php @@ -433,7 +433,7 @@ protected function performConnect() $this->_config['host'] = $host; // Attempt a connection. - $this->_link = @ldap_connect($host, $this->_config['port']); + $this->_link = @ldap_connect($host . ":" . $this->_config['port']); if (false === $this->_link) { $current_error = PEAR::raiseError('Could not connect to ' . $host . ':' . $this->_config['port']);