diff options
author | Andreas Gohr <andi@splitbrain.org> | 2014-02-14 11:59:44 +0100 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2014-02-14 11:59:44 +0100 |
commit | 25c82f13e0617d3737c89d0235f9f75b1cbb5bf7 (patch) | |
tree | bfbe272302ea52eb10da412521a9046fa3121102 /lib/plugins | |
parent | 133181ec79ac75661d1f79d5f4f256fed821f72d (diff) | |
parent | 9f72d639a21d95cbc5fb211dc4e9bc0584efb0c5 (diff) | |
download | rpg-25c82f13e0617d3737c89d0235f9f75b1cbb5bf7.tar.gz rpg-25c82f13e0617d3737c89d0235f9f75b1cbb5bf7.tar.bz2 |
Merge branch 'pull-request-524'
* pull-request-524:
authldap: handle bad groupkey gracefully
Update auth.php
Update auth.php
Diffstat (limited to 'lib/plugins')
-rw-r--r-- | lib/plugins/authldap/auth.php | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/plugins/authldap/auth.php b/lib/plugins/authldap/auth.php index 31e2c5135..94f3be8d2 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 @@ -240,9 +241,17 @@ class auth_plugin_authldap extends DokuWiki_Auth_Plugin { ldap_free_result($sr); 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(!empty($grp[$this->getConf('groupkey')])) { + $group = $grp[$this->getConf('groupkey')]; + if(is_array($group)){ + $group = $group[0]; + } else { + $this->_debug('groupkey did not return a detailled result', 0, __LINE__, __FILE__); + } + if($group === '') continue; + + $this->_debug('LDAP usergroup: '.htmlspecialchars($group), 0, __LINE__, __FILE__); + $info['grps'][] = $group; } } } |