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

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