diff --git a/html/admin.php b/html/admin.php index 97007104..f5639b8a 100644 --- a/html/admin.php +++ b/html/admin.php @@ -2,7 +2,7 @@ require "../include/variables.php"; require "../include/functions.php"; -if($role < 4) { +if($_SESSION['role'] < 4) { header("Location: index.php"); http_response_code(404); die(); diff --git a/html/editpage.php b/html/editpage.php index a5289b68..8058a18a 100644 --- a/html/editpage.php +++ b/html/editpage.php @@ -2,7 +2,7 @@ require "../include/variables.php"; require "../include/functions.php"; -if($role < 3) { +if($_SESSION['role'] < 3) { header("Location: index.php"); http_response_code(404); die(); diff --git a/html/journal.php b/html/journal.php index 628ff72d..811044d9 100644 --- a/html/journal.php +++ b/html/journal.php @@ -56,7 +56,7 @@ if (filter_var($_GET['article'], FILTER_VALIDATE_INT)) { } else { $bdd = connect($dbhost, $dbname, $dbuser, $dbpass); $req = $bdd->prepare("SELECT ID, titre, date, auteur FROM articles WHERE classification <= :role ORDER BY date DESC"); - $req->bindParam(":role", $role); + $req->bindParam(":role", $_SESSION['role']); $req->execute(); $resultat = $req->fetchAll(PDO::FETCH_ASSOC); diff --git a/html/users.php b/html/users.php index f1748a15..ab281745 100644 --- a/html/users.php +++ b/html/users.php @@ -2,7 +2,7 @@ require "../include/variables.php"; require "../include/functions.php"; -if($role < 4) { +if($_SESSION['role'] < 4) { header("Location: index.php"); http_response_code(404); die(); diff --git a/include/functions.php b/include/functions.php index d9eab46c..655a1ef1 100644 --- a/include/functions.php +++ b/include/functions.php @@ -1,8 +1,6 @@ $url) { echo "";