PHP_SMART_HOME_V3/app/views/Log.php

39 lines
783 B
PHP
Raw Normal View History

2020-05-16 15:18:27 +00:00
<?php
class Log extends Template
{
function __construct()
{
$userManager = new UserManager();
2020-07-23 13:16:44 +00:00
$langMng = new LanguageManager('en');
2020-05-16 15:18:27 +00:00
if (!$userManager->isLogin()){
header('Location: ' . BASEURL . 'login');
}
$template = new Template('log');
$template->prepare('title', 'Log');
$result = array();
$cdir = scandir('../logs/');
foreach ($cdir as $key => $value)
{
if (!in_array($value,array(".","..", ".gitkeep")))
{
2020-07-23 15:29:55 +00:00
2020-05-16 15:18:27 +00:00
$result[$value] = $value;
}
}
$template->prepare('baseDir', BASEDIR);
$template->prepare('debugMod', DEBUGMOD);
$template->prepare('logToLiveTime', LOGTIMOUT);
$template->prepare('title', 'Logy');
$template->prepare('logsFiles', $result);
$template->prepare('langMng', $langMng);
$template->render();
}
}