Base Directory Fix #1
This commit is contained in:
		@@ -10,7 +10,7 @@ if (isset($_POST) && !empty($_POST)){
 | 
			
		||||
 | 
			
		||||
		AutomationManager::create($_POST['name'], $onDays, $doCode, $ifCode);
 | 
			
		||||
 | 
			
		||||
		header('Location: /vasek/home/' . strtolower(basename(__FILE__, '.php')), TRUE);
 | 
			
		||||
		header('Location: ' . BASEDIR . strtolower(basename(__FILE__, '.php')), TRUE);
 | 
			
		||||
		die();
 | 
			
		||||
	} else if (isset($_POST['modalFinal']) && $_POST['modalFinal'] == "Upravit") {
 | 
			
		||||
		$doCode = json_encode($_POST['device'], JSON_PRETTY_PRINT);
 | 
			
		||||
@@ -38,7 +38,7 @@ if (isset($_POST) && !empty($_POST)){
 | 
			
		||||
 | 
			
		||||
		AutomationManager::create($_POST['name'], $onDays, $doCode, $ifCode, (isset ($_POST['automation_id']) ? $_POST['automation_id'] : ""));
 | 
			
		||||
 | 
			
		||||
		header('Location: /vasek/home/' . strtolower(basename(__FILE__, '.php')));
 | 
			
		||||
		header('Location: ' . BASEDIR . strtolower(basename(__FILE__, '.php')));
 | 
			
		||||
		die();
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -7,7 +7,7 @@ if (isset($_POST) && !empty($_POST)){
 | 
			
		||||
			DashboardManager::Add($subDeviceId);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	header('Location: /vasek/home/' . strtolower(basename(__FILE__, '.php')));
 | 
			
		||||
	header('Location: ' . BASEDIR . strtolower(basename(__FILE__, '.php')));
 | 
			
		||||
	die();
 | 
			
		||||
}
 | 
			
		||||
?>
 | 
			
		||||
 
 | 
			
		||||
@@ -42,7 +42,7 @@ if (isset($_POST) && !empty($_POST)){
 | 
			
		||||
			echo $deviceId;
 | 
			
		||||
			var_dump(json_decode ($permissionsInJson));
 | 
			
		||||
			echo '</pre>';
 | 
			
		||||
			echo '<a href="/vasek/home/">CONTINUE</a>';
 | 
			
		||||
			echo '<a href="' . BASEDIR .'">CONTINUE</a>';
 | 
			
		||||
			die();
 | 
			
		||||
		}
 | 
			
		||||
	} else if (isset($_POST['approveDevice'])) {
 | 
			
		||||
@@ -64,10 +64,10 @@ if (isset($_POST) && !empty($_POST)){
 | 
			
		||||
		echo '<pre>';
 | 
			
		||||
		var_dump($POST);
 | 
			
		||||
		echo '</pre>';
 | 
			
		||||
		echo '<a href="/vasek/home/">CONTINUE</a>';
 | 
			
		||||
		echo '<a href="' . BASEDIR . '">CONTINUE</a>';
 | 
			
		||||
		die();
 | 
			
		||||
	}
 | 
			
		||||
	header('Location: /vasek/home/');
 | 
			
		||||
	header('Location: ' . BASEDIR );
 | 
			
		||||
	die();
 | 
			
		||||
}
 | 
			
		||||
?>
 | 
			
		||||
 
 | 
			
		||||
@@ -9,10 +9,10 @@ if (isset($_POST) && !empty($_POST)){
 | 
			
		||||
		echo '<pre>';
 | 
			
		||||
		var_dump($_POST);
 | 
			
		||||
		echo '</pre>';
 | 
			
		||||
		echo '<a href="/vasek/home/' . strtolower(basename(__FILE__, '.php')).'">CONTINUE</a>';
 | 
			
		||||
		echo '<a href="/' . BASEDIR . strtolower(basename(__FILE__, '.php')).'">CONTINUE</a>';
 | 
			
		||||
		die();
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	header('Location: /vasek/home/' . strtolower(basename(__FILE__, '.php')));
 | 
			
		||||
	header('Location: ' . BASEDIR . strtolower(basename(__FILE__, '.php')));
 | 
			
		||||
	die();
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -13,12 +13,12 @@ class Ajax extends Template
 | 
			
		||||
		global $lang;
 | 
			
		||||
 | 
			
		||||
		if (!$userManager->isLogin()){
 | 
			
		||||
			header('Location: ./');
 | 
			
		||||
			header('Location: ' . BASEDIR);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		$is_ajax = 'XMLHttpRequest' == ( $_SERVER['HTTP_X_REQUESTED_WITH'] ?? '' );
 | 
			
		||||
		if (!$is_ajax){
 | 
			
		||||
			header('Location: ./');
 | 
			
		||||
			header('Location: '  . BASEDIR);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if (
 | 
			
		||||
 
 | 
			
		||||
@@ -13,7 +13,7 @@ class Automation extends Template
 | 
			
		||||
		global $langMng;
 | 
			
		||||
 | 
			
		||||
		if (!$userManager->isLogin()){
 | 
			
		||||
			header('Location: ./login');
 | 
			
		||||
			header('Location: ' . BASEDIR . 'login');
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		$automations = [];
 | 
			
		||||
 
 | 
			
		||||
@@ -7,7 +7,7 @@ class Dashboard extends Template
 | 
			
		||||
		global $langMng;
 | 
			
		||||
 | 
			
		||||
		if (!$userManager->isLogin()){
 | 
			
		||||
			header('Location: ./login');
 | 
			
		||||
			header('Location: ' . BASEDIR . 'login');
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		$template = new Template('dashboard');
 | 
			
		||||
 
 | 
			
		||||
@@ -9,7 +9,7 @@ class Home extends Template
 | 
			
		||||
		global $langMng;
 | 
			
		||||
 | 
			
		||||
		if (!$userManager->isLogin()){
 | 
			
		||||
			header('Location: ./login');
 | 
			
		||||
			header('Location: ' . BASEDIR . 'login');
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		$template = new Template('home');
 | 
			
		||||
 
 | 
			
		||||
@@ -9,7 +9,7 @@ class Log extends Template
 | 
			
		||||
		global $langMng;
 | 
			
		||||
 | 
			
		||||
		if (!$userManager->isLogin()){
 | 
			
		||||
			header('Location: ./login');
 | 
			
		||||
			header('Location: ' . BASEDIR . 'login');
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		$template = new Template('log');
 | 
			
		||||
 
 | 
			
		||||
@@ -7,7 +7,7 @@ class Login extends Template
 | 
			
		||||
		global $lang;
 | 
			
		||||
 | 
			
		||||
		if ($userManager->isLogin()){
 | 
			
		||||
			header('Location: ./');
 | 
			
		||||
			header('Location: ' . BASEDIR);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		$template = new Template('login');
 | 
			
		||||
 
 | 
			
		||||
@@ -5,7 +5,7 @@ class Logout extends Template
 | 
			
		||||
	{
 | 
			
		||||
		global $userManager;
 | 
			
		||||
		$userManager->logout();
 | 
			
		||||
		header('Location: /vasek/home/login', TRUE);
 | 
			
		||||
		header('Location: ' . BASEDIR . 'login');
 | 
			
		||||
		die();
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -9,7 +9,7 @@ class Rooms extends Template
 | 
			
		||||
		global $lang;
 | 
			
		||||
 | 
			
		||||
		if (!$userManager->isLogin()){
 | 
			
		||||
			header('Location: ./login');
 | 
			
		||||
			header('Location: ' . BASEDIR . 'login');
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		$template = new Template('rooms');
 | 
			
		||||
 
 | 
			
		||||
@@ -7,7 +7,7 @@ class Scene extends Template
 | 
			
		||||
		global $langMng;
 | 
			
		||||
 | 
			
		||||
		if (!$userManager->isLogin()){
 | 
			
		||||
			header('Location: ./');
 | 
			
		||||
			header('Location: ' . BASEDIR . 'login');
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		$template = new Template('scene');
 | 
			
		||||
 
 | 
			
		||||
@@ -7,7 +7,7 @@ class Setting extends Template
 | 
			
		||||
		global $langMng;
 | 
			
		||||
 | 
			
		||||
		if (!$userManager->isLogin()){
 | 
			
		||||
			header('Location: ./login');
 | 
			
		||||
			header('Location: ' . BASEDIR . 'login');
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		$automations = [];
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user