Added check for config file

This commit is contained in:
Jeroen De Meerleer 2017-04-15 13:16:27 +02:00
parent 16088f9fba
commit da441fc28d
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6
1 changed files with 3 additions and 1 deletions

View File

@ -28,7 +28,9 @@ session_start();
error_reporting("E_ALL");
ini_set("display_errors", "on");
//echo $_SERVER["REQUEST_URI"]; exit;
if (!file_exists("config.inc.php")) {
die ("Cannot find config file");
}
if(php_sapi_name() !== 'cli' ) {
if (!isset($_SESSION['userID']) && (explode("?", $_SERVER["REQUEST_URI"])[0] != "/index.php" && $_SERVER["REQUEST_URI"] != "/")) {
header("location:index.php");