Funktionalität fürs Löschen des Accounts

This commit is contained in:
2025-07-03 12:42:11 +02:00
parent b0c1ddae2a
commit a0416cdefe
3 changed files with 33 additions and 7 deletions

View File

@@ -147,7 +147,7 @@ class UserController{
}
public function clearUserSession(){
unset($_SESSION["user_id"], $_SESSION["user_role"]);
unset($_SESSION["user_id"], $_SESSION["user_role"], $_SESSION["vorname"], $_SESSION["name"]);
}
public function logout(){
@@ -168,8 +168,18 @@ class UserController{
}
public function deleteUser(){
$userId = $_SESSION["user_id"];
$this->db->deleteUser($userId);
public function showUserDeleteConfirmation(){
}
public function deleteAccount(){
$userId = $_SESSION["user_id"] ?? "";
if($userId){
$this->db->deleteUser($userId);
$this->clearUserSession();
$this->view->setDoMethodName("showUserDeleteConfirmation");
$this->showUserDeleteConfirmation();
}
}
}