Stats : Commande plus robuste pour récupérer l'affichage
This commit is contained in:
@@ -124,8 +124,8 @@ if(isset($controller->splitted_url[1]) && $user->rankIsHigher("moderator")) {
|
|||||||
if ($user->rankIsHigher("moderator")) {
|
if ($user->rankIsHigher("moderator")) {
|
||||||
$head['title'] = "Statistiques";
|
$head['title'] = "Statistiques";
|
||||||
$report = $config['abs_root_folder'];
|
$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 --no-progress -o '.escapeshellarg($report);
|
$command = '(zcat /var/log/nginx/kabano.org-access.log*.gz && cat /var/log/nginx/kabano.org-access.log.1) | goaccess --log-format=COMBINED --no-progress -o '.escapeshellarg($report).' 2>&1';
|
||||||
exec($command, $output, $result);
|
$output = shell_exec($command);
|
||||||
|
|
||||||
include ($config['views_folder']."d.admin.stats.html");
|
include ($config['views_folder']."d.admin.stats.html");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
echo $line."<br>";
|
echo $line."<br>";
|
||||||
}
|
}
|
||||||
?></pre>
|
?></pre>
|
||||||
<? if ($result === 0 && file_exists($report)) { ?>
|
<? if (file_exists($report)) { ?>
|
||||||
<a href='/report.html' target='_blank'><i class="fas fa-chart-line"></i> Voir le rapport</a>
|
<a href='/report.html' target='_blank'><i class="fas fa-chart-line"></i> Voir le rapport</a>
|
||||||
<? } else { ?>
|
<? } else { ?>
|
||||||
Echec de la commande
|
Echec de la commande
|
||||||
|
|||||||
Reference in New Issue
Block a user