diff options
Diffstat (limited to 'lib/plugins/authad/auth.php')
-rw-r--r-- | lib/plugins/authad/auth.php | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/lib/plugins/authad/auth.php b/lib/plugins/authad/auth.php index e1d758fb8..0860e5756 100644 --- a/lib/plugins/authad/auth.php +++ b/lib/plugins/authad/auth.php @@ -332,11 +332,11 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin { * @param array $filter array of field/pattern pairs, null for no filter * @return array userinfo (refer getUserData for internal userinfo details) */ - public function retrieveUsers($start = 0, $limit = -1, $filter = array()) { + public function retrieveUsers($start = 0, $limit = 0, $filter = array()) { $adldap = $this->_adldap(null); if(!$adldap) return false; - if($this->users === null) { + if(!$this->users) { //get info for given user $result = $adldap->user()->all(); if (!$result) return array(); @@ -357,7 +357,7 @@ class auth_plugin_authad 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; @@ -512,6 +512,31 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin { } /** + * Returns a list of configured domains + * + * The default domain has an empty string as key + * + * @return array associative array(key => domain) + */ + public function _getConfiguredDomains() { + $domains = array(); + if(empty($this->conf['account_suffix'])) return $domains; // not configured yet + + // add default domain, using the name from account suffix + $domains[''] = ltrim($this->conf['account_suffix'], '@'); + + // find additional domains + foreach($this->conf as $key => $val) { + if(is_array($val) && isset($val['account_suffix'])) { + $domains[$key] = ltrim($val['account_suffix'], '@'); + } + } + ksort($domains); + + return $domains; + } + + /** * Check provided user and userinfo for matching patterns * * The patterns are set up with $this->_constructPattern() |