diff --git a/plugins/moodle/moodle_modules_total.php b/plugins/moodle/moodle_modules_total.php index 33cedd4a..e9583b7e 100644 --- a/plugins/moodle/moodle_modules_total.php +++ b/plugins/moodle/moodle_modules_total.php @@ -56,20 +56,16 @@ if (count($argv) === 2 && $argv[1] === 'config') { echo "graph_category Moodle\n"; echo "graph_scale no\n"; echo "graph_info Displays the sum of module, as well as module instance number by type, in your Moodle site\n"; + echo "graph_total.label total\n"; foreach($data as $entry) { echo "modules_".$entry->modulename.".label ".$entry->modulename."\n"; echo "modules_".$entry->modulename.".min 0\n"; echo "modules_".$entry->modulename.".draw AREA\n"; } - echo "modules_total.label total users\n"; - echo "modules_total.min 0\n"; exit(0); } -$total = 0; foreach($data as $entry) { echo "modules_".$entry->modulename.".label ".$entry->modulename."\n"; echo "modules_".$entry->modulename.".value ".$entry->moduleinstance."\n"; - $total += $entry->moduleinstance; -} -echo "modules_total.value $total\n"; \ No newline at end of file +} \ No newline at end of file diff --git a/plugins/moodle/moodle_users_total.php b/plugins/moodle/moodle_users_total.php index 7ac7585e..890cb4f5 100644 --- a/plugins/moodle/moodle_users_total.php +++ b/plugins/moodle/moodle_users_total.php @@ -43,17 +43,14 @@ if (count($argv) === 2 && $argv[1] === 'config') { echo "graph_category Moodle\n"; echo "graph_scale no\n"; echo "graph_info Displays the sum of users, as well as active, suspended and deleted accounts, in your Moodle site\n"; + echo "graph_total total\n"; - echo "users_total.label total users\n"; - echo "users_active.label active users\n"; - echo "users_suspended.label suspended users\n"; - echo "users_deleted.label deleted users\n"; - - echo "users_total.min 0\n"; + echo "users_active.label active\n"; + echo "users_suspended.label suspended\n"; + echo "users_deleted.label deleted\n"; echo "users_active.min 0\n"; echo "users_suspended.min 0\n"; echo "users_deleted.min 0\n"; - exit(0); } @@ -65,15 +62,6 @@ try { exit(1); } - - -//All users -$nbusers = 0; -if (($stmt = $dbh->query("SELECT COUNT(id) FROM {$table_prefix}user")) != false) { - $nbusers = $stmt->fetchColumn(); -} -echo "users_total.value $nbusers\n"; - //Active users (not deleted or suspended) $nbusers = 0; if (($stmt = $dbh->query("SELECT COUNT(id) FROM {$table_prefix}user WHERE deleted=0 AND suspended=0")) != false) {