debugging
This commit is contained in:
@@ -4,14 +4,13 @@ require_once '../model/ArticleManager.php';
|
||||
require_once '../validator/article-validator.php';
|
||||
require_once "../model/LocalUserDAO.php";
|
||||
|
||||
$dao = new LocalUserDAO();
|
||||
|
||||
if (!isset($_SESSION["user"])) {
|
||||
header("Location: ../../index.php?pfad=login");
|
||||
exit();
|
||||
}
|
||||
|
||||
try {
|
||||
$dao = new LocalUserDAO();
|
||||
$user = $dao->findUser($_SESSION["user_email"] ?? "");
|
||||
|
||||
if ($_SERVER["REQUEST_METHOD"] === "POST") {
|
||||
@@ -27,7 +26,7 @@ try {
|
||||
} else {
|
||||
$title = $_POST["title"];
|
||||
$content = $_POST["content"];
|
||||
$author = $user;
|
||||
$author = $user["email"];
|
||||
$category = $_POST["category"];
|
||||
$tags = $_POST['tags'] ?? '';
|
||||
|
||||
@@ -96,13 +95,13 @@ try {
|
||||
$_SESSION["message"] = "internal_error";
|
||||
exit();
|
||||
}
|
||||
/*
|
||||
|
||||
if (!$user) {
|
||||
$_SESSION = [];
|
||||
session_destroy();
|
||||
|
||||
header("Location: ../../index.php?pfad=login");
|
||||
exit();
|
||||
}*/
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user