Skip to content
Snippets Groups Projects
Commit 3985daa5 authored by Olav Morken's avatar Olav Morken
Browse files

ldap: Add 'debug' and 'timeout' options.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1681 44740490-163a-0410-bde0-09ae8108e29a
parent a063f79b
No related branches found
No related tags found
No related merge requests found
......@@ -95,6 +95,18 @@ $config = array(
/* Whether SSL/TLS should be used when contacting the LDAP server. */
'enable_tls' => FALSE,
/*
* Whether debug output from the LDAP library should be enabled.
* Default is FALSE.
*/
'debug' => FALSE,
/*
* The timeout for accessing the LDAP server, in seconds.
* The default is 0, which means no timeout.
*/
'timeout' => 0,
/*
* Which attributes should be retrieved from the LDAP server.
* This can be an array of attribute names, or NULL, in which case
......
......@@ -31,6 +31,22 @@ class sspmod_ldap_ConfigHelper {
private $enableTLS;
/**
* Whether debug output is enabled.
*
* @var bool
*/
private $debug;
/**
* The timeout for accessing the LDAP server.
*
* @var int
*/
private $timeout;
/**
* Whether we need to search for the users DN.
*/
......@@ -108,6 +124,8 @@ class sspmod_ldap_ConfigHelper {
$this->hostname = $config->getString('hostname');
$this->enableTLS = $config->getBoolean('enable_tls', FALSE);
$this->debug = $config->getBoolean('debug', FALSE);
$this->timeout = $config->getInteger('timeout', 0);
$this->searchEnable = $config->getBoolean('search.enable', FALSE);
$this->privRead = $config->getBoolean('priv.read', FALSE);
......@@ -148,7 +166,7 @@ class sspmod_ldap_ConfigHelper {
assert('is_string($username)');
assert('is_string($password)');
$ldap = new SimpleSAML_Auth_LDAP($this->hostname, $this->enableTLS);
$ldap = new SimpleSAML_Auth_LDAP($this->hostname, $this->enableTLS, $this->debug, $this->timeout);
if (!$this->searchEnable) {
$ldapusername = addcslashes($username, ',+"\\<>;*');
......
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