dev auf main #68

Open
niklas.ortmann wants to merge 1044 commits from devNachCSRF into main
Showing only changes of commit 6d6f1f31b0 - Show all commits
+2 -2
View File
@@ -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();