Final Fixes And Clean Up

This commit is contained in:
JonatanRek
2020-04-28 11:52:14 +02:00
parent a3d911d3ec
commit e0bbc09389
18 changed files with 29 additions and 35 deletions

View File

@@ -8,12 +8,12 @@ class Ajax extends Template
global $lang;
if (!$userManager->isLogin()){
header('Location: ' . BASEDIR);
header('Location: ' . BASEURL);
}
$is_ajax = 'XMLHttpRequest' == ( $_SERVER['HTTP_X_REQUESTED_WITH'] ?? '' );
if (!$is_ajax){
header('Location: ' . BASEDIR);
header('Location: ' . BASEURL);
}
if (

View File

@@ -1,10 +1,4 @@
<?php
$files = scandir('app/class/');
$files = array_diff($files, array('.', '..'));
foreach($files as $file) {
include_once 'app/class/'. $file;
}
class Automation extends Template
{
function __construct()
@@ -13,7 +7,7 @@ class Automation extends Template
global $langMng;
if (!$userManager->isLogin()){
header('Location: ' . BASEDIR . 'login');
header('Location: ' . BASEURL . 'login');
}
$automations = [];

View File

@@ -7,7 +7,7 @@ class Dashboard extends Template
global $langMng;
if (!$userManager->isLogin()){
header('Location: ' . BASEDIR . 'login');
header('Location: ' . BASEURL . 'login');
}
$template = new Template('dashboard');

View File

@@ -9,7 +9,7 @@ class Home extends Template
global $langMng;
if (!$userManager->isLogin()){
header('Location: ' . BASEDIR . 'login');
header('Location: ' . BASEURL . 'login');
}
$template = new Template('home');

View File

@@ -9,14 +9,14 @@ class Log extends Template
global $langMng;
if (!$userManager->isLogin()){
header('Location: ' . BASEDIR . 'login');
header('Location: ' . BASEURL . 'login');
}
$template = new Template('log');
$template->prepare('title', 'Log');
$result = array();
$cdir = scandir('./app/logs/');
$cdir = scandir('../logs/');
foreach ($cdir as $key => $value)
{
if (!in_array($value,array(".","..", ".gitkeep")))

View File

@@ -7,7 +7,7 @@ class Login extends Template
global $lang;
if ($userManager->isLogin()){
header('Location: ' . BASEDIR);
header('Location: ' . BASEURL);
}
$template = new Template('login');

View File

@@ -5,7 +5,7 @@ class Logout extends Template
{
global $userManager;
$userManager->logout();
header('Location: ' . BASEDIR . 'login');
header('Location: ' . BASEURL . 'login');
die();
}
}

View File

@@ -9,7 +9,7 @@ class Rooms extends Template
global $langMng;
if (!$userManager->isLogin()){
header('Location: ' . BASEDIR . 'login');
header('Location: ' . BASEURL . 'login');
}
$template = new Template('rooms');

View File

@@ -7,7 +7,7 @@ class Scene extends Template
global $langMng;
if (!$userManager->isLogin()){
header('Location: ' . BASEDIR . 'login');
header('Location: ' . BASEURL . 'login');
}
$template = new Template('scene');

View File

@@ -8,7 +8,7 @@ class Setting extends Template
global $langMng;
if (!$userManager->isLogin()){
header('Location: ' . BASEDIR . 'login');
header('Location: ' . BASEURL . 'login');
}
$automations = [];