Compare commits
No commits in common. "942dc3808eec68c86429842cee290191603f2600" and "6c431faa21ddf46a8e1388bed38abcbc2b45a618" have entirely different histories.
942dc3808e
...
6c431faa21
@ -11,7 +11,6 @@
|
|||||||
max-width: 90%;
|
max-width: 90%;
|
||||||
padding: 24px 42px 24px 42px;
|
padding: 24px 42px 24px 42px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
color: var(--brand-white);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.row {
|
.row {
|
||||||
|
@ -147,7 +147,7 @@ class UserController{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function clearUserSession(){
|
public function clearUserSession(){
|
||||||
unset($_SESSION["user_id"], $_SESSION["user_role"], $_SESSION["vorname"], $_SESSION["name"]);
|
unset($_SESSION["user_id"], $_SESSION["user_role"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function logout(){
|
public function logout(){
|
||||||
@ -167,19 +167,4 @@ class UserController{
|
|||||||
public function showUserAccountPage (){
|
public function showUserAccountPage (){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function showUserDeleteConfirmation(){
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public function deleteAccount(){
|
|
||||||
$userId = $_SESSION["user_id"] ?? "";
|
|
||||||
if($userId){
|
|
||||||
$this->db->deleteUser($userId);
|
|
||||||
$this->clearUserSession();
|
|
||||||
$this->view->setDoMethodName("showUserDeleteConfirmation");
|
|
||||||
$this->showUserDeleteConfirmation();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -59,14 +59,4 @@ class UserModel extends Database
|
|||||||
return $sth->fetch();
|
return $sth->fetch();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function deleteUser($id){
|
|
||||||
$pdo = $this->linkDB();
|
|
||||||
$sql = "DELETE FROM user WHERE id = :id";
|
|
||||||
$sth = $pdo->prepare($sql);
|
|
||||||
$sth->bindParam(":id", $id);
|
|
||||||
$sth->execute();
|
|
||||||
$sth->execute();
|
|
||||||
// echo "Benutzer ist gelöscht";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
@ -6,23 +6,11 @@
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<h1>Hallo,
|
<form method="post">
|
||||||
<?php echo ($_SESSION['vorname'] ?? "") . " " . ($_SESSION['name'] ?? "") ?>
|
<input type="hidden" name="controller" value="user">
|
||||||
</br>
|
<input type="hidden" name="do" value="logout">
|
||||||
Hier können Sie ihren Account verwalten.
|
<button type="submit" class="btn btn-logout">Ausloggen</button>
|
||||||
</h1>
|
</form>
|
||||||
<div class="row">
|
|
||||||
<form method="post">
|
|
||||||
<input type="hidden" name="controller" value="user">
|
|
||||||
<input type="hidden" name="do" value="logout">
|
|
||||||
<button type="submit" class="btn btn-logout">Ausloggen</button>
|
|
||||||
</form>
|
|
||||||
<form method="post">
|
|
||||||
<input type="hidden" name="controller" value="user">
|
|
||||||
<input type="hidden" name="do" value="deleteAccount">
|
|
||||||
<button type="submit" class="btn btn-logout">Meinen Account löschen</button>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,14 +0,0 @@
|
|||||||
<?php
|
|
||||||
include dirname(__DIR__).'/header.phtml';
|
|
||||||
?>
|
|
||||||
|
|
||||||
<div class="container">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-12">
|
|
||||||
<h1>Der Account wurde erfolgreich gelöscht</h1>
|
|
||||||
<div class="row">
|
|
||||||
<a class="btn btn-primary" href="index.php">Unsere Kurse ansehen</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
@ -43,5 +43,4 @@
|
|||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
</header>
|
</header>
|
||||||
<!-- TODO Transparent mit Fehleranzeige bei der Anmeldung -->
|
<main>
|
||||||
<main style="color: transparent">
|
|
Loading…
x
Reference in New Issue
Block a user