Merge branch 'main' of https://git.bib.de/PBBFA23AHR/kurs-app
This commit is contained in:
@@ -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(){
|
||||
@@ -167,4 +167,28 @@ class UserController{
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
public function changeAccountData(){
|
||||
$userId = $_SESSION["user_id"] ?? "";
|
||||
if($userId){
|
||||
$this->db->changeUserData($userId);
|
||||
$this->setUserSession($user);
|
||||
$this->view->setDoMethodName("showUserDeleteConfirmation");
|
||||
$this->showUserDeleteConfirmation();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user