From 4ad69c6ec8950a480e2a3c6561dd07d7a277b336 Mon Sep 17 00:00:00 2001 From: marcus Date: Tue, 26 Aug 2008 08:34:39 +0000 Subject: Minor tweak to basic stats to clarify number of users in the system. git-svn-id: https://code.elgg.org/elgg/trunk@2041 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/statistics.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'engine/lib') diff --git a/engine/lib/statistics.php b/engine/lib/statistics.php index 89c6d9a09..c1faaa9c7 100644 --- a/engine/lib/statistics.php +++ b/engine/lib/statistics.php @@ -57,13 +57,19 @@ /** * Return the number of users registered in the system. * + * @param bool $show_deactivated * @return int */ - function get_number_users() + function get_number_users($show_deactivated = false) { global $CONFIG; - $result = get_data_row("SELECT count(*) as count from {$CONFIG->dbprefix}entities where type='user'"); + $access = ""; + + if (!$show_deactivated) + $access = "and " . get_access_sql_suffix(); + + $result = get_data_row("SELECT count(*) as count from {$CONFIG->dbprefix}entities where type='user' $access"); if ($result) return $result->count; -- cgit v1.2.3