From 2f26f0a7cd97d00f67e8093a9c26ecbb3629ae97 Mon Sep 17 00:00:00 2001 From: osaajani <> Date: Wed, 24 Jun 2020 18:55:03 +0200 Subject: [PATCH] Add enabling/disabling account deletion --- controllers/publics/Account.php | 7 ++++++ env.php.dist | 1 + templates/account/show.php | 38 +++++++++++++++++---------------- 3 files changed, 28 insertions(+), 18 deletions(-) diff --git a/controllers/publics/Account.php b/controllers/publics/Account.php index de19f5d..0b4544d 100644 --- a/controllers/publics/Account.php +++ b/controllers/publics/Account.php @@ -156,6 +156,13 @@ namespace controllers\publics; */ public function delete($csrf) { + if (!ENABLE_ACCOUNT_DELETION) + { + \FlashMessage\FlashMessage::push('danger', 'Fonctionnalité désactivée.'); + + return $this->redirect(\descartes\Router::url('Account', 'show')); + } + if (!$this->verify_csrf($csrf)) { \FlashMessage\FlashMessage::push('danger', 'Jeton CSRF invalid !'); diff --git a/env.php.dist b/env.php.dist index 77966ff..f3788ff 100644 --- a/env.php.dist +++ b/env.php.dist @@ -20,6 +20,7 @@ 'PWD_PID' => '/var/run/raspisms', 'APP_SECRET' => '%APP_SECRET%', 'ENABLE_COMMAND' => false, + 'ENABLE_ACCOUNT_DELETION' => true, //E-mail types 'EMAIL_RESET_PASSWORD' => [ diff --git a/templates/account/show.php b/templates/account/show.php index e34f929..5a5574d 100644 --- a/templates/account/show.php +++ b/templates/account/show.php @@ -60,24 +60,26 @@ - -
-
-

Supprimer ce compte

-
-
-
-
- -
-
- -
-
-
-
+ + +
+
+

Supprimer ce compte

+
+
+
+
+ +
+
+ +
+
+
+
+