Update 2 files

- /html/admin.php
- /html/editpage.php
This commit is contained in:
Jan BELLON 2024-03-12 12:30:49 +00:00
parent 020b330238
commit 98b910b54f
2 changed files with 4 additions and 4 deletions

View File

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

View File

@ -2,7 +2,7 @@
require "../include/variables.php";
require "../include/functions.php";
if($_SESSION['role'] < 2) {
if($_SESSION['role'] < 1) {
header("Location: index.php");
http_response_code(404);
die();
@ -225,8 +225,8 @@ if(isset($fichier)) {
$search = "%" . htmlspecialchars($_GET['search']) . "%";
$condition = "AND (titre LIKE '" . $search . "' OR ID LIKE '" . $search . "' OR auteur LIKE '" . $search . "') ";
}
$req = $bdd->prepare("SELECT ID, titre, date, image, resume FROM articles WHERE classification <= :accreditation " . $condition . "ORDER BY date DESC LIMIT 10");
$req->bindParam(":accreditation", $_SESSION['accreditation']);
$req = $bdd->prepare("SELECT ID, titre, date, image, resume FROM articles WHERE auteur = :user_id AND IORDER BY date DESC LIMIT 10");
$req->bindParam(":user_id", $_SESSION['userid']);
$req->execute();
$resultat = $req->fetchAll(PDO::FETCH_ASSOC);