Log page, 404 page

This commit is contained in:
JonatanRek
2019-09-01 15:55:33 +02:00
parent aa8235c1bf
commit f1feee4e21
4 changed files with 114 additions and 0 deletions

34
views/Log.php Normal file
View File

@@ -0,0 +1,34 @@
<?php
class Log extends Template
{
function __construct()
{
global $userManager;
global $lang;
if (!$userManager->isLogin()){
header('Location: ./login');
}
$template = new Template('log');
$template->prepare('title', 'Log');
$result = array();
$cdir = scandir('./logs/');
foreach ($cdir as $key => $value)
{
if (!in_array($value,array(".","..")))
{
$result[$value] = $value;
}
}
$template->prepare('logsFiles', $result);
$template->prepare('lang', $lang);
$template->render();
}
}