Don't redirect if cli

This commit is contained in:
Jeroen De Meerleer 2017-04-15 09:15:06 +02:00
parent 3f2e898c26
commit 9e5c078155
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6
1 changed files with 5 additions and 3 deletions

View File

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