Update updateArticle-controller.php
This commit is contained in:
@@ -8,7 +8,7 @@ require_once '../model/ArticleManager.php';
|
||||
require_once '../model/Article.php';
|
||||
require_once '../validator/article-validator.php';
|
||||
|
||||
if (!isset($_SESSION["user"])) {
|
||||
if (!isset($_SESSION["user_email"])) {
|
||||
header("Location: index.php?pfad=login");
|
||||
exit();
|
||||
}
|
||||
@@ -30,7 +30,7 @@ if ($_SERVER["REQUEST_METHOD"] === "POST") {
|
||||
try {
|
||||
$articleManager = ArticleManager::getInstance();
|
||||
$article = $articleManager->getArticle($id);
|
||||
if ($article->getAuthor() != $_SESSION["user"]->getUsername()) {
|
||||
if ($article->getAuthor() != $_SESSION["user_email"]) {
|
||||
$_SESSION["message"] = "unauthorized_access";
|
||||
header("location: ../../index.php");
|
||||
exit();
|
||||
|
||||
Reference in New Issue
Block a user