From a4c91749bc7c2d162683e61c5ab9759808dbfddc Mon Sep 17 00:00:00 2001 From: Jan BELLON Date: Thu, 7 Mar 2024 20:55:10 +0000 Subject: [PATCH] Update 4 files - /html/admin.php - /html/compte.php - /html/editpage.php - /html/users.php --- html/admin.php | 2 +- html/compte.php | 6 ++++++ html/editpage.php | 2 +- html/users.php | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/html/admin.php b/html/admin.php index 77466ac5..97007104 100644 --- a/html/admin.php +++ b/html/admin.php @@ -3,7 +3,7 @@ require "../include/variables.php"; require "../include/functions.php"; if($role < 4) { - header("Location: login.php"); + header("Location: index.php"); http_response_code(404); die(); } diff --git a/html/compte.php b/html/compte.php index f564790c..e0c3b3a5 100644 --- a/html/compte.php +++ b/html/compte.php @@ -2,6 +2,12 @@ require "../include/variables.php"; require "../include/functions.php"; +if(isset($_SESSION['userid']) == false) { + header("Location: index.php"); + http_response_code(404); + die(); +} + if(isset($_POST['delete_account'])) { $bdd = connect($dbhost, $dbname, $dbuser, $dbpass); diff --git a/html/editpage.php b/html/editpage.php index ec0a9ba3..00b253a3 100644 --- a/html/editpage.php +++ b/html/editpage.php @@ -3,7 +3,7 @@ require "../include/variables.php"; require "../include/functions.php"; if($role < 3) { - header("Location: login.php"); + header("Location: index.php"); http_response_code(404); die(); } diff --git a/html/users.php b/html/users.php index f175f84e..f1748a15 100644 --- a/html/users.php +++ b/html/users.php @@ -3,7 +3,7 @@ require "../include/variables.php"; require "../include/functions.php"; if($role < 4) { - header("Location: login.php"); + header("Location: index.php"); http_response_code(404); die(); }