adldap / adLDAP

adLDAP is a PHP class that provides LDAP authentication and integration with Active Directory.
GNU Lesser General Public License v2.1
424 stars 204 forks source link

ldaps bug with custom port #106

Open rkochis opened 8 years ago

rkochis commented 8 years ago

when using ssl, you need to create a connection string as follows since it's using ldaps and you can't pass in the port variable. This breaks ssl connections on ports other than 636 since that is the default if no port is specified.

src/Connections/Ldap.php: lines 340-342 Add: return $this->connection = ldap_connect($protocol.$hostname.":$port");

public function connect($hostname, $port = '389')
{
    $protocol = $this::PROTOCOL;

    if ($this->isUsingSSL()) {
        $protocol = $this::PROTOCOL_SSL;
        return $this->connection = ldap_connect($protocol.$hostname.":$port");
    }

    return $this->connection = ldap_connect($protocol.$hostname, $port);
}