Page statistiques
This commit is contained in:
@@ -120,6 +120,19 @@ if(isset($controller->splitted_url[1]) && $user->rankIsHigher("moderator")) {
|
|||||||
$notfound = 1;
|
$notfound = 1;
|
||||||
}
|
}
|
||||||
break;
|
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:
|
default:
|
||||||
$notfound = 1;
|
$notfound = 1;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
<? if($user->rankIsHigher("moderator")) { ?>
|
<? if($user->rankIsHigher("moderator")) { ?>
|
||||||
<a href="<?=$config['rel_root_folder']?>admin/logs" class="button"><i class="fas fa-history"></i> Voir les logs</a> <small>Permet d'accéder aux 200 dernières lignes des logs bruts des actions sur la base de données.</small><br><br>
|
<a href="<?=$config['rel_root_folder']?>admin/logs" class="button"><i class="fas fa-history"></i> Voir les logs</a> <small>Permet d'accéder aux 200 dernières lignes des logs bruts des actions sur la base de données.</small><br><br>
|
||||||
<a href="<?=$config['rel_root_folder']?>admin/wiki-files" class="button"><i class="fas fa-paperclip"></i> Fichiers attachés</a><small>Gérer les fichiers attachés pour le wiki : liste, ajout, suppression...</small><br><br>
|
<a href="<?=$config['rel_root_folder']?>admin/wiki-files" class="button"><i class="fas fa-paperclip"></i> Fichiers attachés</a><small>Gérer les fichiers attachés pour le wiki : liste, ajout, suppression...</small><br><br>
|
||||||
|
<a href="<?=$config['rel_root_folder']?>admin/stats" class="button"><i class="fas fa-chart-line"></i> Statistiques</a><small>Analyser les logs et afficher les statistiques.</small><br><br>
|
||||||
<? } ?>
|
<? } ?>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|||||||
26
views/d.admin.stats.html
Normal file
26
views/d.admin.stats.html
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="fr">
|
||||||
|
|
||||||
|
<? include('blocks/d.head.html'); ?>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<? include('blocks/d.nav.html'); ?>
|
||||||
|
|
||||||
|
<section>
|
||||||
|
<h1><?=$head['title']?></h1>
|
||||||
|
<br>
|
||||||
|
<br><h3>Retour de l'execution de la commande :</h3><br>
|
||||||
|
<pre><?
|
||||||
|
foreach($output as $line) {
|
||||||
|
echo $line."<br>";
|
||||||
|
}
|
||||||
|
?></pre>
|
||||||
|
<br>
|
||||||
|
<br><a href='/report.html' target='_blank'><i class="fas fa-chart-line"></i> Voir le rapport</a>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<? include('blocks/d.footer.html'); ?>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user