Skip to content

Commit

Permalink
Merge pull request #422 from nrundle/bugfix-ldap_connect_deprecated
Browse files Browse the repository at this point in the history
Replace use of deprecated ldap_connect function with supported one
  • Loading branch information
effgarces authored Sep 30, 2024
2 parents 512c88f + e017fb1 commit 11aa388
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions plugins/Authentication/ActiveDirectory/adLDAP.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion plugins/Authentication/Ldap/LDAP2.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down

0 comments on commit 11aa388

Please sign in to comment.