Update functions: Check the debug mode after the direct access check

This commit is contained in:
Jeroen 2022-08-21 12:54:56 +02:00
parent 3071ceb6fd
commit b70a56de85
Signed by: jeroen
GPG Key ID: 7C7028F783798BAB

View File

@ -7,21 +7,23 @@
// //
// File: functions.inc.php // File: functions.inc.php
// //
if ($CONF['debug'] == 'true') {
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
} else {
ini_set('display_errors', 0);
ini_set('display_startup_errors', 0);
}
if(preg_match("/functions.inc.php/", $_SERVER['SCRIPT_NAME'])) { if(preg_match("/functions.inc.php/", $_SERVER['SCRIPT_NAME'])) {
header("Location: login.php"); header("Location: login.php");
exit; die();
} }
if ($CONF['debug'] == 'true') {
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
} else {
ini_set('display_errors', 0);
ini_set('display_startup_errors', 0);
}
$version = "1.0.0"; $version = "1.0.0";
// //
@ -33,7 +35,7 @@ function check_session() {
session_start(); session_start();
if (!isset($_SESSION['sessid']['username'])) { if (!isset($_SESSION['sessid']['username'])) {
header("Location: login.php"); header("Location: login.php");
exit; die();
} }
$SESSID_USERNAME = $_SESSION['sessid']['username']; $SESSID_USERNAME = $_SESSION['sessid']['username'];
return $SESSID_USERNAME; return $SESSID_USERNAME;
@ -43,7 +45,7 @@ function check_user_session() {
session_start(); session_start();
if (!isset($_SESSION['userid']['username'])) { if (!isset($_SESSION['userid']['username'])) {
header("Location: login.php"); header("Location: login.php");
exit; die();
} }
$USERID_USERNAME = $_SESSION['userid']['username']; $USERID_USERNAME = $_SESSION['userid']['username'];
return $USERID_USERNAME; return $USERID_USERNAME;