Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 98b088afc0 | |||
| 51c850d122 | |||
| 97302f1bb3 |
+1
-5
@@ -4,11 +4,7 @@
|
|||||||
-->
|
-->
|
||||||
<main>
|
<main>
|
||||||
|
|
||||||
<?php if (isset($_SESSION["message"]) && $_SESSION["message"] == "internal_error"): ?>
|
<?php include_once "includes/alertMessages.php"?>
|
||||||
<p class="alert-message is-error">
|
|
||||||
Es ist ein interner Fehler beim Speichern aufgetreten. Bitte versuche es erneut.
|
|
||||||
</p>
|
|
||||||
<?php endif; ?>
|
|
||||||
<?php
|
<?php
|
||||||
unset($_SESSION["message"]);
|
unset($_SESSION["message"]);
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -18,11 +18,6 @@
|
|||||||
Ein Beitrag muss Inhalt besitzen. Text- und Bildelemente dürfen nicht leer sein!
|
Ein Beitrag muss Inhalt besitzen. Text- und Bildelemente dürfen nicht leer sein!
|
||||||
</p>
|
</p>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php if (isset($_SESSION["message"]) && $_SESSION["message"] == "invalid_category"): ?>
|
|
||||||
<p class="alert-message is-error">
|
|
||||||
Die ausgewählte Kategorie ist ungültig.
|
|
||||||
</p>
|
|
||||||
<?php endif; ?>
|
|
||||||
<?php if (isset($_SESSION["message"]) && $_SESSION["message"] == "invalid_tags"): ?>
|
<?php if (isset($_SESSION["message"]) && $_SESSION["message"] == "invalid_tags"): ?>
|
||||||
<p class="alert-message is-error">
|
<p class="alert-message is-error">
|
||||||
Ungültige Schlagworte gefunden. Erlaubt sind nur Buchstaben, Zahlen, Leerzeichen und Bindestriche (2-50 Zeichen).
|
Ungültige Schlagworte gefunden. Erlaubt sind nur Buchstaben, Zahlen, Leerzeichen und Bindestriche (2-50 Zeichen).
|
||||||
|
|||||||
@@ -2,10 +2,52 @@
|
|||||||
if (session_status() === PHP_SESSION_NONE) {
|
if (session_status() === PHP_SESSION_NONE) {
|
||||||
session_start();
|
session_start();
|
||||||
}
|
}
|
||||||
include_once "php/controller/index-controller.php";
|
ob_start();
|
||||||
|
include_once("php/controller/index.php");
|
||||||
|
|
||||||
|
$pfad = $_GET["pfad"] ?? "home";
|
||||||
|
|
||||||
|
/*
|
||||||
|
Controller für Aktionen werden vor der HTML-Ausgabe geladen,
|
||||||
|
damit Weiterleitungen mit header() funktionieren.
|
||||||
|
*/
|
||||||
|
if ($pfad === "login") {
|
||||||
|
include_once "php/controller/login-controller.php";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($pfad === "register") {
|
||||||
|
include_once "php/controller/register-controller.php";
|
||||||
|
}
|
||||||
|
if ($pfad === "password-forgotten") {
|
||||||
|
include_once "php/controller/password-forgotten-controller.php";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($pfad === "confirm-register") {
|
||||||
|
include_once "php/controller/confirm-register-controller.php";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($pfad === "confirm-password") {
|
||||||
|
include_once "php/controller/confirm-password-controller.php";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($pfad === "logout") {
|
||||||
|
include_once "php/controller/logout-controller.php";
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($pfad === "deleteAccount") {
|
||||||
|
include_once "php/controller/deleteAccount-controller.php";
|
||||||
|
exit();
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Seite: Index der Lernplattform
|
||||||
|
Funktion: Webseitengerüst, Anzeigen von Content
|
||||||
|
-->
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="de">
|
<html lang="de">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="description" content="EduForge">
|
<meta name="description" content="EduForge">
|
||||||
@@ -31,13 +73,17 @@ include_once "php/controller/index-controller.php";
|
|||||||
|
|
||||||
<title>EduForge</title>
|
<title>EduForge</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
include_once 'includes/navbar.php';
|
include_once 'includes/navbar.php';
|
||||||
|
|
||||||
// Dynamischer Inhalt
|
/*
|
||||||
if (isset($pfad) && $pfad !== "404" && file_exists('content/' . $pfad . '.php')) {
|
Dynamischer Inhalt:
|
||||||
|
Je nach pfad-Parameter wird die passende Datei aus content geladen.
|
||||||
|
*/
|
||||||
|
if (file_exists('content/' . $pfad . '.php')) {
|
||||||
include_once 'content/' . $pfad . '.php';
|
include_once 'content/' . $pfad . '.php';
|
||||||
} else {
|
} else {
|
||||||
include_once 'content/404.php';
|
include_once 'content/404.php';
|
||||||
@@ -48,3 +94,7 @@ include_once 'includes/footer.php';
|
|||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
ob_end_flush();
|
||||||
|
?>
|
||||||
@@ -1,35 +1,3 @@
|
|||||||
<?php
|
<?php
|
||||||
// Standardpfad
|
|
||||||
$pfad = $_GET["pfad"] ?? "home";
|
|
||||||
|
|
||||||
if ($pfad === "logout") {
|
?>
|
||||||
include_once "php/controller/logout-controller.php";
|
|
||||||
exit();
|
|
||||||
} elseif ($pfad === "deleteAccount") {
|
|
||||||
include_once "php/controller/deleteAccount-controller.php";
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($pfad === "login") {
|
|
||||||
include_once "php/controller/login-controller.php";
|
|
||||||
} elseif ($pfad === "register") {
|
|
||||||
include_once "php/controller/register-controller.php";
|
|
||||||
} elseif ($pfad === "password-forgotten") {
|
|
||||||
include_once "php/controller/password-forgotten-controller.php";
|
|
||||||
} elseif ($pfad === "confirm-register") {
|
|
||||||
include_once "php/controller/confirm-register-controller.php";
|
|
||||||
} elseif ($pfad === "confirm-password") {
|
|
||||||
include_once "php/controller/confirm-password-controller.php";
|
|
||||||
}
|
|
||||||
|
|
||||||
// Whitelist
|
|
||||||
$erlaubte_content_seiten = [
|
|
||||||
"accessibility", "confirm-password", "confirm-register", "createArticle",
|
|
||||||
"datenschutz", "home", "impressum", "login", "nutzungsbedingungen",
|
|
||||||
"password-forgotten", "profile", "register", "search-results",
|
|
||||||
"show-mail", "showArticle", "showCategory", "updateArticle"
|
|
||||||
];
|
|
||||||
|
|
||||||
if (!in_array($pfad, $erlaubte_content_seiten)) {
|
|
||||||
$pfad = "404";
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
if (session_status() === PHP_SESSION_NONE) {
|
if (session_status() === PHP_SESSION_NONE) {
|
||||||
session_start();
|
session_start();
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once '../model/ArticleManager.php';
|
require_once '../model/ArticleManager.php';
|
||||||
require_once '../model/UserManager.php';
|
require_once '../model/UserManager.php';
|
||||||
require_once '../model/Article.php';
|
require_once '../model/Article.php';
|
||||||
|
|||||||
Reference in New Issue
Block a user