Compare commits
24 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| feb64eb769 | |||
| ecc76e453e | |||
| 949ca542ab | |||
| b090195d9f | |||
| 1f1e7dc814 | |||
| 3606a750be | |||
| 8762bc1b07 | |||
| c7f279b7e9 | |||
| 92f1f077d2 | |||
| 50120f974d | |||
| 713a258d48 | |||
| 0a7e6df734 | |||
| 8c769ba280 | |||
| 5bcb64f7f8 | |||
| 944f40d89f | |||
| b15421efee | |||
| 2044853f94 | |||
| 9a3e4cc7dc | |||
| f508a222c6 | |||
| 365f37dcea | |||
| 2472143146 | |||
| a1184299b1 | |||
| c41302d046 | |||
| aaefd2917e |
Generated
-1
@@ -10,7 +10,6 @@
|
|||||||
<option name="highlightLevel" value="WARNING" />
|
<option name="highlightLevel" value="WARNING" />
|
||||||
<option name="transferred" value="true" />
|
<option name="transferred" value="true" />
|
||||||
</component>
|
</component>
|
||||||
<component name="PhpProjectSharedConfiguration" php_language_level="8.5" />
|
|
||||||
<component name="PhpStanOptionsConfiguration">
|
<component name="PhpStanOptionsConfiguration">
|
||||||
<option name="transferred" value="true" />
|
<option name="transferred" value="true" />
|
||||||
</component>
|
</component>
|
||||||
|
|||||||
@@ -0,0 +1,83 @@
|
|||||||
|
<!--
|
||||||
|
Seite: Beitrag erstellen
|
||||||
|
Inhalt: Formular für die Erstellung eines neuen Beitrags
|
||||||
|
-->
|
||||||
|
<?php
|
||||||
|
include_once $abs_path . '/php/model/ArticleManagerDAO.php';
|
||||||
|
include_once $abs_path . '/php/model/ArticleManager.php';
|
||||||
|
|
||||||
|
if(isset($_POST['title']) && isset($_POST['content']) && isset($_POST['category'])) {
|
||||||
|
|
||||||
|
}else{
|
||||||
|
// TODO: Exception werfen.
|
||||||
|
echo"Fehler!";
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
<form method="post" action="php/controller/createArticle-controller.php" id="editor-form" class="wp-editor-scope editor-container">
|
||||||
|
|
||||||
|
<main class="editor-main">
|
||||||
|
<input type="text" id="title" name="title" placeholder="Titel hier eingeben" required>
|
||||||
|
<textarea id="content" name="content" placeholder="Schreibe deinen Beitrag..."></textarea>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<!-- Seitenleiste -->
|
||||||
|
<aside class="editor-sidebar">
|
||||||
|
|
||||||
|
<div class="sidebar-block">
|
||||||
|
<button type="submit" class="btn-publish">Veröffentlichen</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="sidebar-block">
|
||||||
|
<label for="category">Kategorie <span class="required">*</span></label>
|
||||||
|
<select id="category" name="category" required>
|
||||||
|
<option value="" disabled selected>Kategorie wählen...</option>
|
||||||
|
|
||||||
|
<optgroup label="Sprachen">
|
||||||
|
<option value="deutsch">Deutsch</option>
|
||||||
|
<option value="englisch">Englisch</option>
|
||||||
|
<option value="franzoesisch">Französisch</option>
|
||||||
|
<option value="latein">Latein</option>
|
||||||
|
<option value="literatur">Literatur</option>
|
||||||
|
</optgroup>
|
||||||
|
|
||||||
|
<optgroup label="MINT">
|
||||||
|
<option value="mathe">Mathematik</option>
|
||||||
|
<option value="biologie">Biologie</option>
|
||||||
|
<option value="chemie">Chemie</option>
|
||||||
|
<option value="physik">Physik</option>
|
||||||
|
<option value="informatik">Informatik</option>
|
||||||
|
<option value="astronomie">Astronomie</option>
|
||||||
|
</optgroup>
|
||||||
|
|
||||||
|
<optgroup label="Gesellschaft & Werte">
|
||||||
|
<option value="geschichte">Geschichte</option>
|
||||||
|
<option value="erdkunde">Erdkunde</option>
|
||||||
|
<option value="sozialkunde">Sozialkunde</option>
|
||||||
|
<option value="wirtschaft">Wirtschaftskunde</option>
|
||||||
|
<option value="religion">Religion</option>
|
||||||
|
<option value="ethik">Ethikunterricht</option>
|
||||||
|
<option value="philosophie">Philosophie</option>
|
||||||
|
<option value="psychologie">Psychologie</option>
|
||||||
|
<option value="kunst">Kunst</option>
|
||||||
|
<option value="musik">Musik</option>
|
||||||
|
<option value="theater">Theater</option>
|
||||||
|
</optgroup>
|
||||||
|
|
||||||
|
<optgroup label="Technik & Praxis">
|
||||||
|
<option value="technik">Technik</option>
|
||||||
|
<option value="werken">Werken</option>
|
||||||
|
<option value="hauswirtschaft">Hauswirtschaft</option>
|
||||||
|
<option value="sport">Sport</option>
|
||||||
|
</optgroup>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="sidebar-block">
|
||||||
|
<label for="tags">Schlagwörter</label>
|
||||||
|
<input type="text" id="tags" name="tags" placeholder="z.B. Technik, IT (mit Komma trennen)">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</aside>
|
||||||
|
|
||||||
|
</form>
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
<?php
|
|
||||||
require_once "php/model/LocalUserDAO.php";
|
|
||||||
|
|
||||||
$dao = new LocalUserDAO();
|
|
||||||
|
|
||||||
/*
|
|
||||||
Deregistrierung
|
|
||||||
Funktion: Entfernt User aus Dummy-Daten und beendet Session
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (isset($_SESSION["user_email"])) {
|
|
||||||
$dao->deleteUser($_SESSION["user_email"]);
|
|
||||||
}
|
|
||||||
|
|
||||||
$_SESSION = [];
|
|
||||||
session_destroy();
|
|
||||||
|
|
||||||
header("Location: index.php");
|
|
||||||
exit();
|
|
||||||
+12
-33
@@ -1,7 +1,3 @@
|
|||||||
<?php
|
|
||||||
$error = $error ?? null;
|
|
||||||
?>
|
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Form: Login-Bereich
|
Form: Login-Bereich
|
||||||
Funktion: Benutzerauthentifizierung und Zugang zum eigenen Profil, Erstellen von Beiträgen, etc.
|
Funktion: Benutzerauthentifizierung und Zugang zum eigenen Profil, Erstellen von Beiträgen, etc.
|
||||||
@@ -11,43 +7,26 @@ $error = $error ?? null;
|
|||||||
|
|
||||||
<h1>Bitte anmelden</h1>
|
<h1>Bitte anmelden</h1>
|
||||||
|
|
||||||
<?php if ($error): ?>
|
<form>
|
||||||
<p style="color:red;">
|
<label id ="inputEmail" class="screenreader-only">E-Mail Adresse / </label>
|
||||||
<?php echo htmlspecialchars($error); ?>
|
|
||||||
</p>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<form method="post" action="index.php?pfad=login">
|
|
||||||
|
|
||||||
<p class="input-label">Benutzername/E-Mail-Adresse:</p>
|
<p class="input-label">Benutzername/E-Mail-Adresse:</p>
|
||||||
<input type="email"
|
<input type="email" name="email" class="login-input" placeholder="E-Mail-Adresse" required autofocus>
|
||||||
name="email"
|
|
||||||
class="login-input"
|
|
||||||
placeholder="E-Mail-Adresse"
|
|
||||||
required
|
|
||||||
autofocus>
|
|
||||||
|
|
||||||
<p class="input-label">Passwort:</p>
|
<p class="input-label">Passwort:</p>
|
||||||
<input type="password"
|
<input type="password" name="password" class="login-input" placeholder="Passwort" required>
|
||||||
name="password"
|
|
||||||
class="login-input"
|
|
||||||
placeholder="Passwort"
|
|
||||||
required>
|
|
||||||
|
|
||||||
<button type="submit"
|
<div class="checkbox-wrapper">
|
||||||
value="anmelden"
|
<label>
|
||||||
name="loginSubmit"
|
<input type="checkbox" name="remember-me" value="1"> angemeldet bleiben
|
||||||
class="login-button">
|
</label>
|
||||||
anmelden
|
</div>
|
||||||
</button>
|
|
||||||
|
<button type="submit" value="anmelden" name="loginSubmit" class="login-button">anmelden</button>
|
||||||
|
|
||||||
<div class="register-link">
|
<div class="register-link">
|
||||||
<a href="index.php?pfad=register">
|
<a href="register.php">Noch keinen Account? Jetzt hier registrieren!</a>
|
||||||
Noch keinen Account? Jetzt hier registrieren!
|
|
||||||
</a>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
<?php
|
|
||||||
$_SESSION = [];
|
|
||||||
session_destroy();
|
|
||||||
|
|
||||||
header("Location: index.php");
|
|
||||||
exit();
|
|
||||||
+29
-28
@@ -1,45 +1,46 @@
|
|||||||
<?php
|
<!--
|
||||||
include_once 'php/controller/profile-controller.php';
|
Content: Profil
|
||||||
|
Inhalt: Das eigene Profil, wenn man angemeldet ist. Dort hat man die Möglichkeit seine Angaben zu ändern.
|
||||||
$user = $user ?? null;
|
-->
|
||||||
?>
|
|
||||||
|
|
||||||
<main class="form-page">
|
<main class="form-page">
|
||||||
|
|
||||||
<div class="form-container">
|
<div class="form-container">
|
||||||
|
|
||||||
<h1>Mein Profil</h1>
|
|
||||||
|
|
||||||
<form>
|
<form>
|
||||||
<label class="input-label">Name</label>
|
|
||||||
<input type="text"
|
<label class="input-label">Vorname</label>
|
||||||
class="login-input"
|
|
||||||
readonly
|
<input type="text" name="Vorname" class="login-input" required
|
||||||
value="<?php echo htmlspecialchars($user["username"] ?? ""); ?>">
|
placeholder="Vorname"
|
||||||
|
value="<?php //DB-Daten ?>">
|
||||||
|
|
||||||
|
<label class="input-label">Nachname</label>
|
||||||
|
<input type="text" name="Nachname" class="login-input" required
|
||||||
|
placeholder="Nachname"
|
||||||
|
value="<?php //DB-Daten ?>">
|
||||||
|
|
||||||
<label class="input-label">Email-Adresse</label>
|
<label class="input-label">Email-Adresse</label>
|
||||||
<input type="email"
|
<input type="email" name="Email" class="login-input" required
|
||||||
class="login-input"
|
placeholder="mustermann@web.de"
|
||||||
readonly
|
value="<?php //DB-Daten ?>">
|
||||||
value="<?php echo htmlspecialchars($user["email"] ?? ""); ?>">
|
|
||||||
|
|
||||||
<label class="input-label">Passwort</label>
|
<label class="input-label">Passwort</label>
|
||||||
<input type="password"
|
<input type="password" name="Passwort" class="login-input"
|
||||||
class="login-input"
|
required placeholder="Passwort">
|
||||||
readonly
|
|
||||||
value="********">
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<a href="index.php?pfad=deleteAccount" class="login-button">
|
<button type="submit" class="login-button">
|
||||||
Account löschen
|
Speichern
|
||||||
</a>
|
</button>
|
||||||
|
|
||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
<a href="index.php?pfad=logout" class="login-button">
|
<button type="button" class="login-button">
|
||||||
Abmelden
|
Account löschen
|
||||||
</a>
|
</button>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
+11
-41
@@ -1,9 +1,3 @@
|
|||||||
<?php
|
|
||||||
include_once 'php/controller/register-controller.php';
|
|
||||||
|
|
||||||
$error = $error ?? null;
|
|
||||||
?>
|
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Form: Registrierung
|
Form: Registrierung
|
||||||
Funktion: Erstellung neuer Benutzerkonten
|
Funktion: Erstellung neuer Benutzerkonten
|
||||||
@@ -13,50 +7,26 @@ $error = $error ?? null;
|
|||||||
|
|
||||||
<h1>Jetzt Registrieren!</h1>
|
<h1>Jetzt Registrieren!</h1>
|
||||||
|
|
||||||
<?php if ($error): ?>
|
<form>
|
||||||
<p style="color:red;">
|
|
||||||
<?php echo htmlspecialchars($error); ?>
|
|
||||||
</p>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<form method="post" action="index.php?pfad=register">
|
|
||||||
|
|
||||||
<p class="input-label">Email:</p>
|
<p class="input-label">Email:</p>
|
||||||
<input type="email"
|
<input type="email" name="email" class="login-input" placeholder="mustermann@web.de" required>
|
||||||
name="email"
|
|
||||||
class="login-input"
|
|
||||||
placeholder="mustermann@web.de"
|
|
||||||
required>
|
|
||||||
|
|
||||||
<p class="input-label">Vorname:</p>
|
<p class="input-label">Vorname:</p>
|
||||||
<input type="text"
|
<input type="text" name="vorname" class="login-input" placeholder="Max" required>
|
||||||
name="vorname"
|
|
||||||
class="login-input"
|
|
||||||
placeholder="Max"
|
|
||||||
required>
|
|
||||||
|
|
||||||
<p class="input-label">Nachname:</p>
|
<p class="input-label">Nachname:</p>
|
||||||
<input type="text"
|
<input type="text" name="nachname" class="login-input" placeholder="Mustermann" required>
|
||||||
name="nachname"
|
|
||||||
class="login-input"
|
|
||||||
placeholder="Mustermann"
|
|
||||||
required>
|
|
||||||
|
|
||||||
<p class="input-label">Passwort:</p>
|
<p class="input-label">Passwort:</p>
|
||||||
<input type="password"
|
<input type="password" name="password" class="login-input" placeholder="Passwort" required>
|
||||||
name="password"
|
|
||||||
class="login-input"
|
|
||||||
placeholder="Passwort"
|
|
||||||
required>
|
|
||||||
|
|
||||||
<button type="submit"
|
<div class="checkbox-wrapper">
|
||||||
value="register"
|
<label>
|
||||||
name="registerSubmit"
|
<input type="checkbox" value="remember-me"> angemeldet bleiben
|
||||||
class="login-button">
|
</label>
|
||||||
kostenlos registrieren
|
</div>
|
||||||
</button>
|
|
||||||
|
|
||||||
|
<button type="submit" value="anmelden" name="loginSubmit" class="login-button">kostenlos registrieren</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
+123
@@ -0,0 +1,123 @@
|
|||||||
|
/* editor in Flexbox */
|
||||||
|
.wp-editor-scope.editor-container {
|
||||||
|
display: flex;
|
||||||
|
min-height: 100vh;
|
||||||
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
||||||
|
color: #1e1e1e;
|
||||||
|
background-color: #f0f2f5;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wp-editor-scope * {
|
||||||
|
box-sizing: border-box;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Hauptbereich */
|
||||||
|
.wp-editor-scope .editor-main {
|
||||||
|
flex: 1;
|
||||||
|
padding: 40px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 20px;
|
||||||
|
background: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wp-editor-scope #title {
|
||||||
|
font-size: 2.5rem;
|
||||||
|
font-weight: 700;
|
||||||
|
border: none;
|
||||||
|
outline: none;
|
||||||
|
width: 100%;
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wp-editor-scope #content {
|
||||||
|
flex: 1;
|
||||||
|
font-size: 1.1rem;
|
||||||
|
line-height: 1.6;
|
||||||
|
border: none;
|
||||||
|
outline: none;
|
||||||
|
resize: none;
|
||||||
|
width: 100%;
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Seitenleiste */
|
||||||
|
.wp-editor-scope .editor-sidebar {
|
||||||
|
width: 300px;
|
||||||
|
background-color: #ffffff;
|
||||||
|
border-left: 1px solid #e0e0e0;
|
||||||
|
padding: 20px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wp-editor-scope .sidebar-block {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wp-editor-scope .sidebar-block label {
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wp-editor-scope .required {
|
||||||
|
color: #d94f4f;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Formularelemente innerhalb der Editor-Sidebar */
|
||||||
|
.wp-editor-scope .editor-sidebar select,
|
||||||
|
.wp-editor-scope .editor-sidebar input[type="text"] {
|
||||||
|
width: 100%;
|
||||||
|
padding: 8px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
border-radius: 4px;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
background: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Button-Zeugs */
|
||||||
|
.wp-editor-scope .btn-publish {
|
||||||
|
background-color: #007cba;
|
||||||
|
color: white;
|
||||||
|
border: none;
|
||||||
|
padding: 12px;
|
||||||
|
border-radius: 4px;
|
||||||
|
font-weight: 600;
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 1rem;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wp-editor-scope .btn-publish:hover {
|
||||||
|
background-color: #006ba1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 760px) {
|
||||||
|
.wp-editor-scope.editor-container {
|
||||||
|
/* Sidebar nach unten */
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wp-editor-scope .editor-main {
|
||||||
|
/* weniger Innenabstand */
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wp-editor-scope #content {
|
||||||
|
/* Verhindert, dass das Textfeld auf kleinen Displays kollabiert */
|
||||||
|
min-height: 300px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wp-editor-scope .editor-sidebar {
|
||||||
|
width: 100%;
|
||||||
|
/* Entfernt den linken Rand und setzt ihn nach oben als Trenner */
|
||||||
|
border-left: none;
|
||||||
|
border-top: 1px solid #e0e0e0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1 +0,0 @@
|
|||||||
[]
|
|
||||||
+13
-48
@@ -1,7 +1,3 @@
|
|||||||
<?php
|
|
||||||
session_start();
|
|
||||||
?>
|
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Globales Menü, wird via PHP später in alle Seiten eingebunden
|
Globales Menü, wird via PHP später in alle Seiten eingebunden
|
||||||
-->
|
-->
|
||||||
@@ -15,23 +11,17 @@ Globales Menü, wird via PHP später in alle Seiten eingebunden
|
|||||||
<!-- Mobile navbar mit Burger-Symbol -->
|
<!-- Mobile navbar mit Burger-Symbol -->
|
||||||
<input type="checkbox" id="nav-toggle" class="nav__checkbox">
|
<input type="checkbox" id="nav-toggle" class="nav__checkbox">
|
||||||
<label for="nav-toggle" id="mobile-nav">
|
<label for="nav-toggle" id="mobile-nav">
|
||||||
<span>☰</span>
|
<span>☰</span> <!-- Burger Icon Symbol -->
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<ul id="mobile-nav" class="nav__mobile-menu">
|
<ul id="mobile-nav" class="nav__mobile-menu">
|
||||||
|
<li>
|
||||||
<?php if (isset($_SESSION['user'])): ?>
|
<label for="nav-toggle" class="nav__close-btn">×</label>
|
||||||
|
</li>
|
||||||
<li><a href="index.php?pfad=profile">Profil</a></li>
|
<li><a href="index.php?pfad=profile">Profil</a></li>
|
||||||
<li><a href="index.php?pfad=logout">Abmelden</a></li>
|
|
||||||
|
|
||||||
<?php else: ?>
|
|
||||||
|
|
||||||
<li><a href="index.php?pfad=login">Anmelden</a></li>
|
<li><a href="index.php?pfad=login">Anmelden</a></li>
|
||||||
<li><a href="index.php?pfad=register">Registrieren</a></li>
|
<li><a href="index.php?pfad=register">Registrieren</a></li>
|
||||||
|
<li><a href="index.php?pfad=createArticle">Beitrag erstellen</a></li>
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
<label class="nav__mobile-label">Sprachen</label>
|
<label class="nav__mobile-label">Sprachen</label>
|
||||||
<ul class="nav__mobile-submenu">
|
<ul class="nav__mobile-submenu">
|
||||||
@@ -49,7 +39,7 @@ Globales Menü, wird via PHP später in alle Seiten eingebunden
|
|||||||
<li><a href="index.php?pfad=mathe">Mathematik</a></li>
|
<li><a href="index.php?pfad=mathe">Mathematik</a></li>
|
||||||
<li><a href="index.php?pfad=biologie">Biologie</a></li>
|
<li><a href="index.php?pfad=biologie">Biologie</a></li>
|
||||||
<li><a href="index.php?pfad=chemie">Chemie</a></li>
|
<li><a href="index.php?pfad=chemie">Chemie</a></li>
|
||||||
<li><a href="index.php?pfad=physik">Physik</a></li>
|
<li><a href="index.php?pfad=englisch">Physik</a></li>
|
||||||
<li><a href="index.php?pfad=informatik">Informatik</a></li>
|
<li><a href="index.php?pfad=informatik">Informatik</a></li>
|
||||||
<li><a href="index.php?pfad=astronomie">Astronomie</a></li>
|
<li><a href="index.php?pfad=astronomie">Astronomie</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -95,7 +85,6 @@ Globales Menü, wird via PHP später in alle Seiten eingebunden
|
|||||||
<a href="index.php?pfad=literatur">Literatur</a>
|
<a href="index.php?pfad=literatur">Literatur</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="nav__item nav__dropdown">
|
<div class="nav__item nav__dropdown">
|
||||||
<button class="nav__dropdown-toggle">MINT</button>
|
<button class="nav__dropdown-toggle">MINT</button>
|
||||||
<div class="nav__dropdown-menu">
|
<div class="nav__dropdown-menu">
|
||||||
@@ -107,7 +96,6 @@ Globales Menü, wird via PHP später in alle Seiten eingebunden
|
|||||||
<a href="index.php?pfad=astronomie">Astronomie</a>
|
<a href="index.php?pfad=astronomie">Astronomie</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="nav__item nav__dropdown">
|
<div class="nav__item nav__dropdown">
|
||||||
<button class="nav__dropdown-toggle">Gesellschaft & Werte</button>
|
<button class="nav__dropdown-toggle">Gesellschaft & Werte</button>
|
||||||
<div class="nav__dropdown-menu">
|
<div class="nav__dropdown-menu">
|
||||||
@@ -124,7 +112,6 @@ Globales Menü, wird via PHP später in alle Seiten eingebunden
|
|||||||
<a href="index.php?pfad=theater">Theater</a>
|
<a href="index.php?pfad=theater">Theater</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="nav__item nav__dropdown">
|
<div class="nav__item nav__dropdown">
|
||||||
<button class="nav__dropdown-toggle">Technik & Praxis</button>
|
<button class="nav__dropdown-toggle">Technik & Praxis</button>
|
||||||
<div class="nav__dropdown-menu">
|
<div class="nav__dropdown-menu">
|
||||||
@@ -137,36 +124,14 @@ Globales Menü, wird via PHP später in alle Seiten eingebunden
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="nav__right">
|
<div class="nav__right">
|
||||||
|
<a href="index.php?pfad=profile" class="nav_item nav__link">Profil</a>
|
||||||
<?php if (isset($_SESSION['user'])): ?>
|
|
||||||
|
|
||||||
<a href="index.php?pfad=profile" class="nav__item nav__link">
|
|
||||||
Profil
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<div class="nav__search">
|
<div class="nav__search">
|
||||||
<?php include_once 'search.php'; ?>
|
<?php
|
||||||
|
include_once 'search.php';
|
||||||
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
<a href="index.php?pfad=login" class="nav__item nav__button">Anmelden</a>
|
||||||
<a href="index.php?pfad=logout" class="nav__item nav__button">
|
<a href="index.php?pfad=register" class="nav__item nav__button">Registrieren</a>
|
||||||
Abmelden
|
<a href="index.php?pfad=createArticle" class="nav__item nav__button">Beitrag erstellen</a>
|
||||||
</a>
|
|
||||||
|
|
||||||
<?php else: ?>
|
|
||||||
|
|
||||||
<div class="nav__search">
|
|
||||||
<?php include_once 'search.php'; ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<a href="index.php?pfad=login" class="nav__item nav__button">
|
|
||||||
Anmelden
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<a href="index.php?pfad=register" class="nav__item nav__button">
|
|
||||||
Registrieren
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -1,40 +1,19 @@
|
|||||||
|
|
||||||
<?php
|
<?php
|
||||||
session_start();
|
if (!isset($abs_path)) {
|
||||||
ob_start();
|
require_once "path.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 === "logout") {
|
|
||||||
include_once "content/logout.php";
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($pfad === "deleteAccount") {
|
|
||||||
include_once "content/deleteAccount.php";
|
|
||||||
exit();
|
|
||||||
}
|
}
|
||||||
|
require_once $abs_path . "/php/controller/index-controller.php";
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Seite: Index der Lernplattform
|
Seite: Index der Lernplattform
|
||||||
Funktion: Webseitengerüst, Anzeigen von Content
|
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">
|
||||||
<meta name="author" content="Niklas Ortmann">
|
<meta name="author" content="Niklas Ortmann">
|
||||||
@@ -43,30 +22,27 @@ if ($pfad === "deleteAccount") {
|
|||||||
<link rel="stylesheet" href="css/main.css">
|
<link rel="stylesheet" href="css/main.css">
|
||||||
<link rel="stylesheet" href="css/navbar.css">
|
<link rel="stylesheet" href="css/navbar.css">
|
||||||
<link rel="stylesheet" href="css/footer.css">
|
<link rel="stylesheet" href="css/footer.css">
|
||||||
|
<link rel="stylesheet" href="css/article.css">
|
||||||
<title>EduForge</title>
|
<title>EduForge</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
|
||||||
|
<body>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
include_once 'includes/navbar.php';
|
include_once $abs_path . '/includes/navbar.php';
|
||||||
|
//Dynamischer Inhalt:
|
||||||
/*
|
if (isset($_GET["pfad"])) {
|
||||||
Dynamischer Inhalt:
|
if (file_exists($abs_path . '/content/' . $_GET["pfad"] . '.php')) {
|
||||||
Je nach pfad-Parameter wird die passende Datei aus content geladen.
|
include_once $abs_path . '/content/' . $_GET["pfad"] . '.php';
|
||||||
*/
|
|
||||||
if (file_exists('content/' . $pfad . '.php')) {
|
|
||||||
include_once 'content/' . $pfad . '.php';
|
|
||||||
} else {
|
} else {
|
||||||
include_once 'content/404.php';
|
include_once $abs_path . '/content/404.php';
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
include_once 'includes/footer.php';
|
include_once $abs_path . '/content/home.php';
|
||||||
|
}
|
||||||
|
include_once $abs_path . '/includes/footer.php';
|
||||||
?>
|
?>
|
||||||
|
</body>
|
||||||
|
|
||||||
</body>
|
</html>
|
||||||
</html>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
ob_end_flush();
|
|
||||||
?>
|
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
try {
|
||||||
|
$author = "max.mustermann@web.de"; // wird später aus session bezogen.
|
||||||
|
$articleManager->newArticle($_POST['post-title'], $_POST['post-content'], $author);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
echo "Fehler beim Erstellen des Artikels: " . $e->getMessage();
|
||||||
|
}
|
||||||
|
?>
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
<?php
|
||||||
|
require_once $abs_path . '/php/model/ArticleManager.php';
|
||||||
|
require_once $abs_path . '/php/model/Article.php';
|
||||||
|
|
||||||
|
try {
|
||||||
|
$articleManager = new ArticleManager();
|
||||||
|
}catch (Exception $e){
|
||||||
|
die("Fehler bei der Initialisierung des Artikel-Managers: " . $e->getMessage());
|
||||||
|
}
|
||||||
|
?>
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
require_once "php/model/LocalUserDAO.php";
|
|
||||||
|
|
||||||
$dao = new LocalUserDAO();
|
|
||||||
$error = null;
|
|
||||||
|
|
||||||
/*
|
|
||||||
Verarbeitung des Login-Formulars
|
|
||||||
Funktion: Prüft Benutzerdaten und erstellt Session für eingeloggten Nutzer
|
|
||||||
*/
|
|
||||||
if ($_SERVER["REQUEST_METHOD"] === "POST") {
|
|
||||||
|
|
||||||
$email = $_POST["email"] ?? "";
|
|
||||||
$password = $_POST["password"] ?? "";
|
|
||||||
|
|
||||||
$user = $dao->findUser($email);
|
|
||||||
|
|
||||||
if ($user && password_verify($password, $user["password"])) {
|
|
||||||
|
|
||||||
$_SESSION["user"] = $user["username"];
|
|
||||||
$_SESSION["user_email"] = $user["email"];
|
|
||||||
|
|
||||||
header("Location: index.php");
|
|
||||||
exit();
|
|
||||||
|
|
||||||
} else {
|
|
||||||
$error = "Login fehlgeschlagen. Bitte überprüfe deine Eingaben.";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
require_once "php/model/LocalUserDAO.php";
|
|
||||||
|
|
||||||
$dao = new LocalUserDAO();
|
|
||||||
|
|
||||||
if (!isset($_SESSION["user"])) {
|
|
||||||
header("Location: index.php?pfad=login");
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
$user = $dao->findUser($_SESSION["user_email"] ?? "");
|
|
||||||
|
|
||||||
if (!$user) {
|
|
||||||
$_SESSION = [];
|
|
||||||
session_destroy();
|
|
||||||
|
|
||||||
header("Location: index.php?pfad=login");
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
require_once "php/model/LocalUserDAO.php";
|
|
||||||
|
|
||||||
$dao = new LocalUserDAO();
|
|
||||||
$error = null;
|
|
||||||
|
|
||||||
/*
|
|
||||||
Verarbeitung des Registrierungs-Formulars
|
|
||||||
Funktion: Erstellt neuen Benutzer und speichert ihn im DAO + Session
|
|
||||||
*/
|
|
||||||
if ($_SERVER["REQUEST_METHOD"] === "POST") {
|
|
||||||
|
|
||||||
$email = $_POST["email"] ?? "";
|
|
||||||
$vorname = $_POST["vorname"] ?? "";
|
|
||||||
$nachname = $_POST["nachname"] ?? "";
|
|
||||||
$password = password_hash(
|
|
||||||
$_POST["password"] ?? "",
|
|
||||||
PASSWORD_DEFAULT
|
|
||||||
);
|
|
||||||
|
|
||||||
if ($dao->findUser($email)) {
|
|
||||||
|
|
||||||
$error = "Diese E-Mail-Adresse ist bereits registriert.";
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
$dao->addUser(
|
|
||||||
$email,
|
|
||||||
$vorname . " " . $nachname,
|
|
||||||
$password
|
|
||||||
);
|
|
||||||
|
|
||||||
$_SESSION["user"] = $vorname . " " . $nachname;
|
|
||||||
$_SESSION["user_email"] = $email;
|
|
||||||
|
|
||||||
header("Location: index.php");
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
* Klasse: Artikel
|
||||||
|
* Diese Klasse stellt alle Daten eines Artikels (Beitrag) bereit
|
||||||
|
*
|
||||||
|
* @author Niklas Ortmann
|
||||||
|
*/
|
||||||
|
class Article
|
||||||
|
{
|
||||||
|
private $id;
|
||||||
|
private $title;
|
||||||
|
private $content;
|
||||||
|
private $author;
|
||||||
|
private $date;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Gibt die ID eines Artikels zurück.
|
||||||
|
*/
|
||||||
|
public function getId()
|
||||||
|
{
|
||||||
|
return $this->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Gibt den Titel eines Artikels zurück.
|
||||||
|
*/
|
||||||
|
public function getTitle()
|
||||||
|
{
|
||||||
|
return $this->title;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Setzt den Titel eines Artikels.
|
||||||
|
*/
|
||||||
|
public function setTitle($title)
|
||||||
|
{
|
||||||
|
$this->title = $title;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Gibt den Content eines Artikels zurück.
|
||||||
|
* TODO: Content muss noch definiert werden.
|
||||||
|
*/
|
||||||
|
public function getContent()
|
||||||
|
{
|
||||||
|
return $this->content;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Setzt den Content eines Artikels.
|
||||||
|
* TODO: Content muss noch definiert werden.
|
||||||
|
*/
|
||||||
|
public function setContent($content)
|
||||||
|
{
|
||||||
|
$this->content = $content;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Gibt den Autor eines Artikels zurück.
|
||||||
|
*/
|
||||||
|
public function getAuthor()
|
||||||
|
{
|
||||||
|
return $this->author;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Gibt das Veröffentlichungsdatum des Artikels zurück.
|
||||||
|
*/
|
||||||
|
public function getDate()
|
||||||
|
{
|
||||||
|
return $this->date;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
?>
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
<?php
|
||||||
|
require_once 'ArticleManagerDAO.php';
|
||||||
|
/*
|
||||||
|
* Klasse: Eine lokale Lösung der DatenbankDAO.
|
||||||
|
* schreibt zunächst Daten lokal in das Verzeichnis und kann diese wieder auslesen.
|
||||||
|
*
|
||||||
|
* @author Niklas Ortmann
|
||||||
|
*/
|
||||||
|
class ArticleManager implements ArticleManagerDAO {
|
||||||
|
/*
|
||||||
|
* Gibt die Datenbank-Instanz zurück.
|
||||||
|
*/
|
||||||
|
public static function getInstance()
|
||||||
|
{
|
||||||
|
if (self::$instance == null) {
|
||||||
|
self::$instance = new ArticleManager();
|
||||||
|
}
|
||||||
|
|
||||||
|
return self::$instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Prüft, ob die lokalen txt-Dateien existieren.
|
||||||
|
* Wenn nicht, werden diese erstellt.
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function newArticle($title, $content, $author, $category) {
|
||||||
|
$newData = array(
|
||||||
|
"title" => $title,
|
||||||
|
"content" => $content,
|
||||||
|
"author" => $author,
|
||||||
|
"category" => $category,
|
||||||
|
//"tags" => isset($_POST["tags"]) ? $_POST["tags"] : '', TODO: Später hinzufügen
|
||||||
|
"date" => date("d.m.Y, H:i")
|
||||||
|
);
|
||||||
|
$newData = base64_encode(serialize($newData));
|
||||||
|
if (!file_exists("articles.txt")) {
|
||||||
|
$newData = fopen("articles.txt", "xb");
|
||||||
|
fclose($newData);
|
||||||
|
}
|
||||||
|
$previousData = file_get_contents("articles.txt");
|
||||||
|
if (file_put_contents("articles.txt", "$newData\n$previousData")) {
|
||||||
|
// TODO: Vernünftige Rückmeldung implementieren.
|
||||||
|
echo "Artikel erfolgreich gespeichert!";
|
||||||
|
} else {
|
||||||
|
// TODO: passende Exceptions werfen.
|
||||||
|
echo "Fehler!";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function updateArticle($id, $title, $content, $author)
|
||||||
|
{
|
||||||
|
// TODO: Implement updateArticle() method.
|
||||||
|
}
|
||||||
|
|
||||||
|
public function deleteArticle($id)
|
||||||
|
{
|
||||||
|
// TODO: Implement deleteArticle() method.
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getArticle($id)
|
||||||
|
{
|
||||||
|
// TODO: Implement getArticle() method.
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getAllArticles()
|
||||||
|
{
|
||||||
|
// TODO: Implement getAllArticles() method.
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
?>
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
* Die Klasse binhaltet alle Methoden für die Operation auf der Datenbank.
|
||||||
|
*
|
||||||
|
* @author Niklas Ortmann
|
||||||
|
*/
|
||||||
|
|
||||||
|
interface ArticleManagerDAO
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* Ein angemeldeter Nutzer erstellt einen neuen Beitrag.
|
||||||
|
* $title Titel des Beitrags
|
||||||
|
* $content Der Inhalt des Beitrags
|
||||||
|
* $author dem Author des des Beitrags (NID oder email)
|
||||||
|
* $category Kategorie des Beitrags
|
||||||
|
* $tags optionale Schlagworte für eine bessere Suche
|
||||||
|
*
|
||||||
|
* Mögliche Exceptions:
|
||||||
|
* TODO Fehlerbeschreibung hinzufügen
|
||||||
|
*/
|
||||||
|
public function newArticle($title, $content, $author, $category);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Ein angemeldeter Nutzer bearbeitet einen Beitrag.
|
||||||
|
* $id ID des Beitrags
|
||||||
|
* $title Titel des Beitrags
|
||||||
|
* $content Der Inhalt des Beitrags
|
||||||
|
* $author dem Author des des Beitrags (NID oder email)
|
||||||
|
*
|
||||||
|
* Mögliche Exceptions:
|
||||||
|
* TODO Fehlerbeschreibung hinzufügen
|
||||||
|
*/
|
||||||
|
public function updateArticle($id, $title, $content, $author);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Ein angemeldeter Nutzer löscht einen seiner Beiträge.
|
||||||
|
* $id ID des Beitrags
|
||||||
|
* $title Titel des Beitrags
|
||||||
|
* $content Der Inhalt des Beitrags
|
||||||
|
* $author dem Author des des Beitrags (NID oder email)
|
||||||
|
*
|
||||||
|
* Mögliche Exceptions:
|
||||||
|
* TODO Fehlerbeschreibung hinzufügen
|
||||||
|
*/
|
||||||
|
public function deleteArticle($id);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Beitrag aufrufen.
|
||||||
|
* $id ID des Beitrags
|
||||||
|
*
|
||||||
|
* Mögliche Exceptions:
|
||||||
|
* TODO Fehlerbeschreibung hinzufügen
|
||||||
|
*/
|
||||||
|
public function getArticle($id);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Alle Beiträge aufrufen.
|
||||||
|
*
|
||||||
|
* Mögliche Exceptions:
|
||||||
|
* TODO Fehlerbeschreibung hinzufügen
|
||||||
|
*/
|
||||||
|
public function getAllArticles();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
?>
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
<?php
|
|
||||||
require_once "UserDAOInterface.php";
|
|
||||||
|
|
||||||
class LocalUserDAO implements UserDAOInterface {
|
|
||||||
|
|
||||||
private string $file = "data/users.json";
|
|
||||||
|
|
||||||
private function loadUsers() {
|
|
||||||
if (!file_exists($this->file)) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
$json = file_get_contents($this->file);
|
|
||||||
$users = json_decode($json, true);
|
|
||||||
|
|
||||||
return is_array($users) ? $users : [];
|
|
||||||
}
|
|
||||||
|
|
||||||
private function saveUsers($users) {
|
|
||||||
file_put_contents(
|
|
||||||
$this->file,
|
|
||||||
json_encode($users, JSON_PRETTY_PRINT)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function findUser($email) {
|
|
||||||
$users = $this->loadUsers();
|
|
||||||
|
|
||||||
foreach ($users as $user) {
|
|
||||||
if ($user["email"] === $email) {
|
|
||||||
return $user;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function addUser($email, $username, $password) {
|
|
||||||
$users = $this->loadUsers();
|
|
||||||
|
|
||||||
$users[] = [
|
|
||||||
"email" => $email,
|
|
||||||
"username" => $username,
|
|
||||||
"password" => $password
|
|
||||||
];
|
|
||||||
|
|
||||||
$this->saveUsers($users);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function deleteUser($email) {
|
|
||||||
$users = $this->loadUsers();
|
|
||||||
|
|
||||||
foreach ($users as $i => $user) {
|
|
||||||
if ($user["email"] === $email) {
|
|
||||||
unset($users[$i]);
|
|
||||||
$users = array_values($users);
|
|
||||||
$this->saveUsers($users);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Interface für den Zugriff auf Benutzerdaten.
|
|
||||||
*
|
|
||||||
* Definiert die Methoden, die jede UserDAO-Implementierung
|
|
||||||
* bereitstellen muss.
|
|
||||||
*/
|
|
||||||
interface UserDAOInterface {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sucht einen Benutzer anhand seiner E-Mail-Adresse.
|
|
||||||
*
|
|
||||||
* @param string $email E-Mail-Adresse des gesuchten Benutzers
|
|
||||||
* @return array|null Benutzerdaten als Array oder null
|
|
||||||
*/
|
|
||||||
public function findUser($email);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Fügt einen neuen Benutzer hinzu.
|
|
||||||
*
|
|
||||||
* @param string $email E-Mail-Adresse des Benutzers
|
|
||||||
* @param string $username Benutzername des Benutzers
|
|
||||||
* @param string $password Passwort des Benutzers
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function addUser($email, $username, $password);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Löscht einen Benutzer anhand seiner E-Mail-Adresse.
|
|
||||||
*
|
|
||||||
* @param string $email E-Mail-Adresse des zu löschenden Benutzers
|
|
||||||
* @return bool true, wenn der Benutzer gelöscht wurde, sonst false
|
|
||||||
*/
|
|
||||||
public function deleteUser($email);
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user