Update 5 files

- /include/variables.php
- /html/upload.php
- /html/journal.php
- /html/editpage.php
- /html/admin.php
This commit is contained in:
Jan BELLON 2024-03-07 20:43:19 +00:00
parent 0f636ef360
commit 39f8085492
5 changed files with 6 additions and 4 deletions

View File

@ -2,7 +2,7 @@
require "../include/variables.php";
require "../include/functions.php";
if(isset($_SESSION['role']) == false || $_SESSION['role'] < 4) {
if($role < 4) {
header("Location: login.php");
http_response_code(404);
die();

View File

@ -2,7 +2,7 @@
require "../include/variables.php";
require "../include/functions.php";
if(isset($_SESSION['role']) == false || $_SESSION['role'] < 3) {
if($role < 3) {
header("Location: login.php");
http_response_code(404);
die();

View File

@ -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", $_SESSION['role']);
$req->bindParam(":role", $role);
$req->execute();
$resultat = $req->fetchAll(PDO::FETCH_ASSOC);

View File

@ -4,7 +4,7 @@ require "../include/functions.php";
$repertoire = "/var/www/e59/";
if(isset($_SESSION['role']) == false || $_SESSION['role'] < 3) {
if($role < 3) {
header("Location: login.php");
http_response_code(404);
die();

View File

@ -15,4 +15,6 @@ $navadmin = $nav;
$status = "";
$classifications = $config['classifications'];
$role = isset($_SESSION['role']) ? $_SESSION['role'] : 0;
?>