Skip to content
Snippets Groups Projects
Commit 3cacf845 authored by Matt Schwager's avatar Matt Schwager
Browse files

Allow specifying the LDAP port used from the configuration file.

parent 266e5c75
No related branches found
No related tags found
No related merge requests found
......@@ -276,6 +276,10 @@ $config = array(
// The default is 0, which means no timeout.
'timeout' => 0,
// The port used when accessing the LDAP server.
// The default is 389.
'port' => 389,
// Set whether to follow referrals. AD Controllers may require FALSE to function.
'referrals' => TRUE,
......
......@@ -45,6 +45,13 @@ class sspmod_ldap_ConfigHelper {
*/
private $timeout;
/**
* The port used when accessing the LDAP server.
*
* @var int
*/
private $port;
/**
* Whether to follow referrals
*/
......@@ -130,6 +137,7 @@ class sspmod_ldap_ConfigHelper {
$this->enableTLS = $config->getBoolean('enable_tls', FALSE);
$this->debug = $config->getBoolean('debug', FALSE);
$this->timeout = $config->getInteger('timeout', 0);
$this->port = $config->getInteger('port', 389);
$this->referrals = $config->getBoolean('referrals', TRUE);
$this->searchEnable = $config->getBoolean('search.enable', FALSE);
$this->privRead = $config->getBoolean('priv.read', FALSE);
......@@ -177,7 +185,7 @@ class sspmod_ldap_ConfigHelper {
throw new SimpleSAML_Error_Error('WRONGUSERPASS');
}
$ldap = new SimpleSAML_Auth_LDAP($this->hostname, $this->enableTLS, $this->debug, $this->timeout, 389, $this->referrals);
$ldap = new SimpleSAML_Auth_LDAP($this->hostname, $this->enableTLS, $this->debug, $this->timeout, $this->port, $this->referrals);
if (!$this->searchEnable) {
$ldapusername = addcslashes($username, ',+"\\<>;*');
......@@ -245,7 +253,7 @@ class sspmod_ldap_ConfigHelper {
$this->enableTLS,
$this->debug,
$this->timeout,
389,
$this->port,
$this->referrals);
if ($attribute == NULL)
......@@ -269,7 +277,7 @@ class sspmod_ldap_ConfigHelper {
$this->enableTLS,
$this->debug,
$this->timeout,
389,
$this->port,
$this->referrals);
/* Are privs needed to get the attributes? */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment