From 3b9b751d5a1f736f9b19367e41697f3e5961e04b Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Tue, 23 Feb 2021 15:03:43 +0200 Subject: [PATCH] Fixed count --- app/controllers/web/home.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/controllers/web/home.php b/app/controllers/web/home.php index 0a26c67a83..1e43634404 100644 --- a/app/controllers/web/home.php +++ b/app/controllers/web/home.php @@ -60,13 +60,14 @@ App::get('/') $whitlistGod = $project->getAttribute('authWhitelistGod'); if($whitlistGod !== 'disabled') { - $sum = $projectDB->getCount([ // Count users - 'limit' => 1, + $projectDB->getCollection([ // Count users 'filters' => [ '$collection='.Database::SYSTEM_COLLECTION_USERS, ], ]); - + + $sum = $projectDB->getSum(); + if($sum !== 0) { return $response->redirect('/auth/signin'); }