PHP_SMART_HOME_V3/app/views/Log.php
JonatanRek e74d2095c6 Some Big Changes
Co-Authored-By: Xinatorus <patrik@steelants.cz>
2019-09-23 21:11:06 +02:00

35 lines
553 B
PHP

<?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('./app/logs/');
foreach ($cdir as $key => $value)
{
if (!in_array($value,array(".","..", ".gitkeep")))
{
$result[$value] = $value;
}
}
$template->prepare('logsFiles', $result);
$template->prepare('lang', $lang);
$template->render();
}
}