diff --git a/controllers/d.admin.php b/controllers/d.admin.php
index b220d2a..5a58308 100755
--- a/controllers/d.admin.php
+++ b/controllers/d.admin.php
@@ -120,6 +120,19 @@ if(isset($controller->splitted_url[1]) && $user->rankIsHigher("moderator")) {
$notfound = 1;
}
break;
+ case 'stats':
+ if ($user->rankIsHigher("moderator")) {
+ $head['title'] = "Statistiques";
+ $report = $config['abs_root_folder'];
+ $command = '(zcat /var/log/nginx/kabano.org-access.log*.gz && cat /var/log/nginx/kabano.org-access.log.1) | goaccess --log-format=COMBINED -o '.escapeshellarg($report);
+ exec($command, $output, $result);
+
+ include ($config['views_folder']."d.admin.stats.html");
+ }
+ else {
+ $notfound = 1;
+ }
+ break;
default:
$notfound = 1;
break;
diff --git a/views/d.admin.html b/views/d.admin.html
index 13c4ba3..1ff6744 100755
--- a/views/d.admin.html
+++ b/views/d.admin.html
@@ -16,6 +16,7 @@
if($user->rankIsHigher("moderator")) { ?>
Voir les logs Permet d'accéder aux 200 dernières lignes des logs bruts des actions sur la base de données.
Fichiers attachésGérer les fichiers attachés pour le wiki : liste, ajout, suppression...
+ StatistiquesAnalyser les logs et afficher les statistiques.
} ?>
diff --git a/views/d.admin.stats.html b/views/d.admin.stats.html
new file mode 100644
index 0000000..e9d7a59
--- /dev/null
+++ b/views/d.admin.stats.html
@@ -0,0 +1,26 @@
+
+
+
+ include('blocks/d.head.html'); ?>
+
+
+ foreach($output as $line) {
+ echo $line."
";
+ }
+ ?>
+