summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorMikhail Krasilnikov <mihalych@vsepofigu.ru>2012-06-13 13:48:10 +0400
committerMikhail Krasilnikov <mihalych@vsepofigu.ru>2012-06-13 13:48:10 +0400
commit2bd8dcab4065546f3c86392d052aa8898780e9ee (patch)
tree3f98a644a167e3fff934693de4b8cbf8cb6279b4 /inc
parente3ef52cdb2ca53f62839275fb578c5a972d93d71 (diff)
downloadrpg-2bd8dcab4065546f3c86392d052aa8898780e9ee.tar.gz
rpg-2bd8dcab4065546f3c86392d052aa8898780e9ee.tar.bz2
Config method changed from array to comma separated string.
Diffstat (limited to 'inc')
-rw-r--r--inc/auth/ldap.class.php21
1 files changed, 7 insertions, 14 deletions
diff --git a/inc/auth/ldap.class.php b/inc/auth/ldap.class.php
index 9b6ff5023..a0252ca2c 100644
--- a/inc/auth/ldap.class.php
+++ b/inc/auth/ldap.class.php
@@ -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;
}