diff options
author | Gerrit Uitslag <klapinklapin@gmail.com> | 2014-03-10 23:57:01 +0100 |
---|---|---|
committer | Gerrit Uitslag <klapinklapin@gmail.com> | 2014-03-10 23:57:01 +0100 |
commit | f97db66038968542deefbf9817a3dd49b67b1904 (patch) | |
tree | 6995f5bfd7017999a743c327474afc7b9514d94f /lib/plugins/authldap/auth.php | |
parent | 6384941886832589f7bb3c13bc18115499cf9369 (diff) | |
parent | 9f12fc1cc9e916c3172a0cf8953ed70fd18f2ec1 (diff) | |
download | rpg-f97db66038968542deefbf9817a3dd49b67b1904.tar.gz rpg-f97db66038968542deefbf9817a3dd49b67b1904.tar.bz2 |
Merge remote-tracking branch 'origin/master' into userlink
Conflicts:
inc/parser/renderer.php
inc/template.php
Diffstat (limited to 'lib/plugins/authldap/auth.php')
-rw-r--r-- | lib/plugins/authldap/auth.php | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/lib/plugins/authldap/auth.php b/lib/plugins/authldap/auth.php index 31e2c5135..6c3637e15 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; } } } @@ -272,7 +281,7 @@ class auth_plugin_authldap extends DokuWiki_Auth_Plugin { * @param array $filter array of field/pattern pairs, null for no filter * @return array of userinfo (refer getUserData for internal userinfo details) */ - function retrieveUsers($start = 0, $limit = -1, $filter = array()) { + function retrieveUsers($start = 0, $limit = 0, $filter = array()) { if(!$this->_openLDAP()) return false; if(is_null($this->users)) { @@ -307,7 +316,7 @@ class auth_plugin_authldap extends DokuWiki_Auth_Plugin { } if($this->_filter($user, $info)) { $result[$user] = $info; - if(($limit >= 0) && (++$count >= $limit)) break; + if(($limit > 0) && (++$count >= $limit)) break; } } return $result; |