summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/lib/Mapping
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2017-10-31 19:42:17 +0100
committerArthur Schiwon <blizzz@arthur-schiwon.de>2017-11-09 11:10:56 +0100
commit59c05d54472aeed458611341970a72e42e5b9e6a (patch)
treed8503e2c9a080d068c4bb6b7a3e7cf7bfa1e1a06 /apps/user_ldap/lib/Mapping
parentef3cd329167ce236b7f7a09293be439623e585c5 (diff)
downloadnextcloud-server-59c05d54472aeed458611341970a72e42e5b9e6a.tar.gz
nextcloud-server-59c05d54472aeed458611341970a72e42e5b9e6a.zip
move LDAP user attributes "sync" to background (except for ajax jobs)
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'apps/user_ldap/lib/Mapping')
-rw-r--r--apps/user_ldap/lib/Mapping/AbstractMapping.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/apps/user_ldap/lib/Mapping/AbstractMapping.php b/apps/user_ldap/lib/Mapping/AbstractMapping.php
index 755cfadbccd..f5f56ce03d6 100644
--- a/apps/user_ldap/lib/Mapping/AbstractMapping.php
+++ b/apps/user_ldap/lib/Mapping/AbstractMapping.php
@@ -277,4 +277,19 @@ abstract class AbstractMapping {
->getTruncateTableSQL('`' . $this->getTableName() . '`');
return $this->dbc->prepare($sql)->execute();
}
+
+ /**
+ * returns the number of entries in the mappings table
+ *
+ * @return int
+ */
+ public function count() {
+ $qb = $this->dbc->getQueryBuilder();
+ $query = $qb->select($qb->createFunction('COUNT(`ldap_dn`)'))
+ ->from($this->getTableName());
+ $res = $query->execute();
+ $count = $res->fetchColumn();
+ $res->closeCursor();
+ return (int)$count;
+ }
}