summaryrefslogtreecommitdiff
path: root/lib/plugins/authldap/auth.php
diff options
context:
space:
mode:
authorSteScho <schoch@dsb.net>2014-01-30 09:31:00 +0100
committerSteScho <schoch@dsb.net>2014-01-30 09:31:00 +0100
commit3e23f03e016611fbb77e51e1ddd7e1e0327f5b2c (patch)
treea2706389bd346111cd4431f450c0f88b50b223c9 /lib/plugins/authldap/auth.php
parenteeedb85240425fe1a9b29e0ab2142da90183727e (diff)
downloadrpg-3e23f03e016611fbb77e51e1ddd7e1e0327f5b2c.tar.gz
rpg-3e23f03e016611fbb77e51e1ddd7e1e0327f5b2c.tar.bz2
Update auth.php
In Novell eDir the group search returns strings, not arrays. Added if-statement which determines if the result is an array or an string.
Diffstat (limited to 'lib/plugins/authldap/auth.php')
-rw-r--r--lib/plugins/authldap/auth.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/plugins/authldap/auth.php b/lib/plugins/authldap/auth.php
index 31e2c5135..d9d4b3d20 100644
--- a/lib/plugins/authldap/auth.php
+++ b/lib/plugins/authldap/auth.php
@@ -143,6 +143,7 @@ class auth_plugin_authldap extends DokuWiki_Auth_Plugin {
* @author Dan Allen <dan.j.allen@gmail.com>
* @author <evaldas.auryla@pheur.org>
* @author Stephane Chazelas <stephane.chazelas@emerson.com>
+ * @author Steffen Schoch <schoch@dsb.net>
*
* @param string $user
* @param bool $inbind authldap specific, true if in bind phase
@@ -241,8 +242,13 @@ class auth_plugin_authldap extends DokuWiki_Auth_Plugin {
if(is_array($result)) foreach($result as $grp) {
if(!empty($grp[$this->getConf('groupkey')][0])) {
- $this->_debug('LDAP usergroup: '.htmlspecialchars($grp[$this->getConf('groupkey')][0]), 0, __LINE__, __FILE__);
- $info['grps'][] = $grp[$this->getConf('groupkey')][0];
+ if(is_array($grp[$this->getConf('groupkey')][0])) {
+ $this->_debug('LDAP usergroup: '.htmlspecialchars($grp[$this->getConf('groupkey')][0]), 0, __LINE__, __FILE__);
+ $info['grps'][] = $grp[$this->getConf('groupkey')][0];
+ } else {
+ $this->_debug('LDAP usergroup: '.htmlspecialchars($grp[$this->getConf('groupkey')]), 0, __LINE__, __FILE__);
+ $info['grps'][] = $grp[$this->getConf('groupkey')];
+ }
}
}
}