empty SessionID sends the user to login page

If the session is empty, it now sends you to the login page with a safed url so it can revert you back to the right page after login
This commit is contained in:
Lars van Hijfte
2017-02-02 17:43:32 +01:00
parent b1941f0191
commit f8c9454b85
11 changed files with 44 additions and 30 deletions

View File

@@ -7,10 +7,10 @@ require_once("../../queries/connect.php");
require_once("../../queries/checkInput.php");
require_once("../../queries/user.php");
if (isset($_SESSION["userID"]) &&
getRoleByID($_SESSION["userID"]) != 'frozen' &&
getRoleByID($_SESSION["userID"]) != 'banned') {
if (!isset($_SESSION["userID"])) {
echo "logged out";
} else if (getRoleByID($_SESSION["userID"]) != 'frozen' &&
getRoleByID($_SESSION["userID"]) != 'banned') {
if ($_POST['button'] == 'reaction') {
if (empty($_POST['newcomment-content'])) {
echo 0;