mirror of
https://github.com/Aviortheking/Blog_IMIE.git
synced 2025-07-29 06:09:50 +00:00
corrigé
This commit is contained in:
@ -33,16 +33,16 @@ class Controller {
|
||||
/** @var String[] $arr */
|
||||
$arr = preg_split("/ /", $annot);
|
||||
if($arr[0] === "route") {
|
||||
if(preg_match($arr[1], $route)) {
|
||||
if(preg_match($arr[1], $route) && !isset($instance)) {
|
||||
$cl = $class;
|
||||
$instance = new $class();
|
||||
$function = ($method->getName());
|
||||
// return $instance->$function();
|
||||
}
|
||||
} elseif ($arr[0] === "editor" && isset($cl) && $cl == $class) {
|
||||
if(!isset($_SESSION["author"]) || (isset($_SESSION["author"]) && $_SESSION["author"]->getRole() != "ROLE_EDITOR")) header("Location: /login/?redirect=".$_SERVER["REQUEST_URI"]);
|
||||
if(!isset($_SESSION["author"]) || (isset($_SESSION["author"]) && ($_SESSION["author"]->getRole() != "ROLE_EDITOR" && $_SESSION["author"]->getRole() != "ROLE_ADMIN"))) header("Location: /login/?redirect=".$_SERVER["REQUEST_URI"]);
|
||||
} elseif($arr[0] === "admin" && isset($cl) && $cl ==$class) {
|
||||
if(!isset($_SESSION["author"]) || (isset($_SESSION["author"]) && ($_SESSION["author"]->getRole() != "ROLE_ADMIN" || $_SESSION["author"]->getRole() != "ROLE_EDITOR"))) header("Location: /login/?redirect=".$_SERVER["REQUEST_URI"]);
|
||||
if(!isset($_SESSION["author"]) || (isset($_SESSION["author"]) && $_SESSION["author"]->getRole() != "ROLE_ADMIN")) header("Location: /login/?redirect=".$_SERVER["REQUEST_URI"]);
|
||||
}
|
||||
}
|
||||
if(isset($instance)) {
|
||||
|
Reference in New Issue
Block a user