summaryrefslogtreecommitdiff
path: root/lib/plugins/authad
diff options
context:
space:
mode:
authorMichael Große <grosse@cosmocode.de>2015-03-11 19:49:14 +0100
committerMichael Große <grosse@cosmocode.de>2015-03-11 19:49:14 +0100
commit25f80763dd71190679289de2b8d29f28021aedb1 (patch)
tree350681887a01b97532f85a1c45d773c11fcf3f34 /lib/plugins/authad
parentc2886dcb3e4136983c3a1f8063038f6ebe4b027c (diff)
downloadrpg-25f80763dd71190679289de2b8d29f28021aedb1.tar.gz
rpg-25f80763dd71190679289de2b8d29f28021aedb1.tar.bz2
Get total number of users in ad, needed for paging
Diffstat (limited to 'lib/plugins/authad')
-rw-r--r--lib/plugins/authad/auth.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/plugins/authad/auth.php b/lib/plugins/authad/auth.php
index 88b56046c..a0a1143db 100644
--- a/lib/plugins/authad/auth.php
+++ b/lib/plugins/authad/auth.php
@@ -116,6 +116,7 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin {
// other can do's are changed in $this->_loadServerConfig() base on domain setup
$this->cando['modName'] = true;
$this->cando['modMail'] = true;
+ $this->cando['getUserCount'] = true;
}
/**
@@ -326,6 +327,26 @@ class auth_plugin_authad extends DokuWiki_Auth_Plugin {
}
/**
+ * @param array $filter
+ * @return int
+ */
+ public function getUserCount($filter = array()) {
+
+ $adldap = $this->_adldap(null);
+ if(!$adldap) {
+ dbglog("authad/auth.php: _adldap not set.");
+ return -1;
+ }
+
+ $result = $adldap->user()->all();
+ if (!$result) {
+ dbglog("authad/auth.php: getting all users failed.");
+ return -1;
+ }
+ return count($result);
+ }
+
+ /**
* Bulk retrieval of user data
*
* @author Dominik Eckelmann <dokuwiki@cosmocode.de>