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();
}