Skip to content
Snippets Groups Projects
Commit 2bd8dcab authored by Mikhail Krasilnikov's avatar Mikhail Krasilnikov
Browse files

Config method changed from array to comma separated string.

parent e3ef52cd
No related branches found
No related tags found
No related merge requests found
......@@ -387,16 +387,12 @@ class auth_ldap extends auth_basic {
$this->bound = 0;
$port = ($this->cnf['port']) ? $this->cnf['port'] : 389;
if (!is_array($this->cnf['server']))
{
$this->cnf['server'] = array($this->cnf['server']);
}
$bound = false;
foreach ($this->cnf['server'] as $server)
{
$servers = explode(',', $this->cnf['server']);
foreach ($servers as $server) {
$server = trim($server);
$this->con = @ldap_connect($server, $port);
if (!$this->con)
{
if (!$this->con) {
continue;
}
......@@ -445,19 +441,16 @@ class auth_ldap extends auth_basic {
}
}
/* As of PHP 5.3.0 we can set timeout to speedup skipping of invalid servers */
if (defined('LDAP_OPT_NETWORK_TIMEOUT'))
{
if (defined('LDAP_OPT_NETWORK_TIMEOUT')) {
ldap_set_option($this->con, LDAP_OPT_NETWORK_TIMEOUT, 1);
}
$bound = ldap_bind($this->con);
if ($bound)
{
if ($bound) {
break;
}
}
if(!$bound)
{
if(!$bound) {
msg("LDAP: couldn't connect to LDAP server",-1);
return false;
}
......
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