';
print '
';
print _("Fichiers trace");
print "
";
//print p(_("Fichiers trace"),' class="text-muted"');
$directory=dir( NOALYSS_BASE.DIRECTORY_SEPARATOR."log");
$a_file=[];
while ( $file = $directory->read()) {
if (preg_match("/noalyss.*log/", $file)) {
$a_file[]=$file;
}
}
rsort($a_file);
$nb_file=count($a_file);
if ( $nb_file == 0) {
echo p(_("Aucune donnée"),' class="notice"');
return;
}
if ( $http->get("sa","string","x")=="dwn")
{
$file=$http->get("file");
if (! in_array($file,$a_file ) )
{
echo_warning(sprintf("%s non trouvé",$file));
record_log("admin_logfile : {$file} not found");
return;
}
print "";
print "- ";
print \HtmlInput::button_anchor(_("Retour"), NOALYSS_URL."/admin-noalyss.php?action=logfile");
print "
";
print "- ";
print \HtmlInput::button_anchor(_("Télécharger").''
, NOALYSS_URL."/export.php?admin=1&action=logfile&file={$file}");
print "
";
print "
";
echo '';
echo file_get_contents(NOALYSS_BASE.DIRECTORY_SEPARATOR."/log/{$file}");
echo '';
print "";
print "- ";
print \HtmlInput::button_anchor(_("Retour"), NOALYSS_URL."/admin-noalyss.php?action=logfile");
print "
";
print "- ";
print \HtmlInput::button_anchor(_("Télécharger").''
, NOALYSS_URL."/export.php?admin=1&action=logfile&file={$file}");
print "
";
print "
";
return;
}
echo '';
for ( $i=0;$i < $nb_file;$i++)
{
$url=sprintf("%s?%s", NOALYSS_URL."/admin-noalyss.php"
, http_build_query(["action"=>"logfile","sa"=>"dwn","file"=>$a_file[$i]]));
printf ("- %s
",$url,$a_file[$i]);
}
print "
";