diff --git a/src/controllers/Profile.php b/src/controllers/Profile.php
index 37a9897..be9e8e0 100644
--- a/src/controllers/Profile.php
+++ b/src/controllers/Profile.php
@@ -22,7 +22,7 @@ public function __construct()
$this->signed_client = null;
$this->view_data['errors'] = [];
$this->view_data['client'] = null;
- $this->view_data['confirmation_message'] = false;
+ $this->view_data['show_account_deletion_confirmation'] = false;
}
private function handleLogOut(): void
@@ -40,9 +40,7 @@ private function handleLogOut(): void
private function handleAccountDeletion(): void
{
- // Display confirmation message
- $confirmation_message = "Are you sure you want to delete your account? This action is irreversible.";
- $this->view_data['confirmation_message'] = $confirmation_message;
+ $this->view_data['show_account_deletion_confirmation'] = true;
// Check if the deletion confirmation has been submitted
if (isset($_POST['confirm_delete'])) {
@@ -205,7 +203,6 @@ public function index(): void
// delete user account if delete button clicked
if (isset($_GET['account_delete_submit'])) {
- $this->view_data['confirmation_message'] = true;
$this->handleAccountDeletion();
return;
}
diff --git a/src/views/Profile.php b/src/views/Profile.php
index 0f6142e..54d9425 100644
--- a/src/views/Profile.php
+++ b/src/views/Profile.php
@@ -6,6 +6,7 @@
* The following attributes are defined in controllers/Profile.php
*
* @var $client Client signed in client
+ * @var $show_account_deletion_confirmation bool Whether to display a confirmation dialog for account deletion
* @var $orders array array of orders
*/
@@ -203,14 +204,19 @@ function openTab(evt, tabName) {
-
-
\ No newline at end of file
+
+
+