Update createArticle-controller.php
This commit is contained in:
@@ -13,18 +13,6 @@ if (!isset($_SESSION["user"])) {
|
||||
|
||||
try {
|
||||
$user = $dao->findUser($_SESSION["user_email"] ?? "");
|
||||
} catch (Exception $e) {
|
||||
$_SESSION["message"] = "internal_error";
|
||||
exit();
|
||||
}
|
||||
|
||||
if (!$user) {
|
||||
$_SESSION = [];
|
||||
session_destroy();
|
||||
|
||||
header("Location: ../../index.php?pfad=login");
|
||||
exit();
|
||||
}
|
||||
|
||||
if ($_SERVER["REQUEST_METHOD"] === "POST") {
|
||||
$_SESSION["old_title"] = $_POST["title"] ?? '';
|
||||
@@ -104,5 +92,17 @@ if ($_SERVER["REQUEST_METHOD"] === "POST") {
|
||||
exit();
|
||||
}
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$_SESSION["message"] = "internal_error";
|
||||
exit();
|
||||
}
|
||||
|
||||
if (!$user) {
|
||||
$_SESSION = [];
|
||||
session_destroy();
|
||||
|
||||
header("Location: ../../index.php?pfad=login");
|
||||
exit();
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user