Final Fixes And Clean Up
This commit is contained in:
		@@ -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 (
 | 
			
		||||
 
 | 
			
		||||
@@ -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 = [];
 | 
			
		||||
 
 | 
			
		||||
@@ -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');
 | 
			
		||||
 
 | 
			
		||||
@@ -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');
 | 
			
		||||
 
 | 
			
		||||
@@ -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")))
 | 
			
		||||
 
 | 
			
		||||
@@ -7,7 +7,7 @@ class Login extends Template
 | 
			
		||||
		global $lang;
 | 
			
		||||
 | 
			
		||||
		if ($userManager->isLogin()){
 | 
			
		||||
			header('Location: ' . BASEDIR);
 | 
			
		||||
			header('Location: ' . BASEURL);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		$template = new Template('login');
 | 
			
		||||
 
 | 
			
		||||
@@ -5,7 +5,7 @@ class Logout extends Template
 | 
			
		||||
	{
 | 
			
		||||
		global $userManager;
 | 
			
		||||
		$userManager->logout();
 | 
			
		||||
		header('Location: ' . BASEDIR . 'login');
 | 
			
		||||
		header('Location: ' . BASEURL . 'login');
 | 
			
		||||
		die();
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -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');
 | 
			
		||||
 
 | 
			
		||||
@@ -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');
 | 
			
		||||
 
 | 
			
		||||
@@ -8,7 +8,7 @@ class Setting extends Template
 | 
			
		||||
		global $langMng;
 | 
			
		||||
 | 
			
		||||
		if (!$userManager->isLogin()){
 | 
			
		||||
			header('Location: ' . BASEDIR . 'login');
 | 
			
		||||
			header('Location: ' . BASEURL . 'login');
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		$automations = [];
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user