2020-05-16 15:18:27 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
|
|
class Log extends Template
|
|
|
|
{
|
|
|
|
function __construct()
|
|
|
|
{
|
2020-07-20 17:15:23 +00:00
|
|
|
$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();
|
2020-07-24 16:21:11 +00:00
|
|
|
$result = $this->logFinder ('../logs/', $result);
|
2020-05-16 15:18:27 +00:00
|
|
|
|
|
|
|
$template->prepare('baseDir', BASEDIR);
|
|
|
|
$template->prepare('debugMod', DEBUGMOD);
|
|
|
|
$template->prepare('logToLiveTime', LOGTIMOUT);
|
|
|
|
$template->prepare('title', 'Logy');
|
2020-07-30 14:31:25 +00:00
|
|
|
$template->prepare('logStats', LogMaintainer::getStats());
|
2020-05-16 15:18:27 +00:00
|
|
|
$template->prepare('logsFiles', $result);
|
|
|
|
$template->prepare('langMng', $langMng);
|
|
|
|
|
|
|
|
$template->render();
|
|
|
|
}
|
2020-07-24 16:21:11 +00:00
|
|
|
|
|
|
|
private function logFinder ($dir, $result) {
|
|
|
|
$logFiles = scandir ($dir);
|
|
|
|
foreach ($logFiles as $key => $file) {
|
|
|
|
if (in_array ($file,array (".", "..", ".gitkeep")))
|
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if (!is_dir($dir . $file)) {
|
|
|
|
$result[$dir][] = $file;
|
|
|
|
} else {
|
|
|
|
$result = $this->logFinder ($dir . $file . "/", $result);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $result;
|
|
|
|
}
|
2020-05-16 15:18:27 +00:00
|
|
|
}
|