aboutsummaryrefslogtreecommitdiffstats
path: root/lib/base.php
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-05-10 21:39:09 -0500
committerMorris Jobke <hey@morrisjobke.de>2017-05-10 22:32:42 -0500
commitabe4a19cbc44b34bf171d1e9499c3e834364bd31 (patch)
treee2c1a490e493c07d6f00398ee01c33f95c64c14e /lib/base.php
parentaffa8d07cab3617e7f2101e3b81a212fa86ab832 (diff)
downloadnextcloud-server-abe4a19cbc44b34bf171d1e9499c3e834364bd31.tar.gz
nextcloud-server-abe4a19cbc44b34bf171d1e9499c3e834364bd31.zip
Properly decide on actual users if instance is too big
* state the reason why NC thinks it is a big instance Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'lib/base.php')
-rw-r--r--lib/base.php24
1 files changed, 23 insertions, 1 deletions
diff --git a/lib/base.php b/lib/base.php
index 69ea6e54c2d..483cd656916 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -313,7 +313,29 @@ class OC {
$tooBig = false;
if (!$disableWebUpdater) {
$apps = \OC::$server->getAppManager();
- $tooBig = $apps->isInstalled('user_ldap') || $apps->isInstalled('user_shibboleth');
+ $tooBig = false;
+ if ($apps->isInstalled('user_ldap')) {
+ $qb = \OC::$server->getDatabaseConnection()->getQueryBuilder();
+
+ $result = $qb->selectAlias($qb->createFunction('COUNT(*)'), 'user_count')
+ ->from('ldap_user_mapping')
+ ->execute();
+ $row = $result->fetch();
+ $result->closeCursor();
+
+ $tooBig = ($row['user_count'] > 50);
+ }
+ if (!$tooBig && $apps->isInstalled('user_saml')) {
+ $qb = \OC::$server->getDatabaseConnection()->getQueryBuilder();
+
+ $result = $qb->selectAlias($qb->createFunction('COUNT(*)'), 'user_count')
+ ->from('user_saml_users')
+ ->execute();
+ $row = $result->fetch();
+ $result->closeCursor();
+
+ $tooBig = ($row['user_count'] > 50);
+ }
if (!$tooBig) {
// count users
$stats = \OC::$server->getUserManager()->countUsers();