Add enabling/disabling account deletion

This commit is contained in:
osaajani 2020-06-24 18:55:03 +02:00
parent 6216ff63bb
commit 2f26f0a7cd
3 changed files with 28 additions and 18 deletions

View File

@ -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 !');

View File

@ -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' => [

View File

@ -61,6 +61,7 @@
</form>
</div>
</div>
<?php if (ENABLE_ACCOUNT_DELETION) { ?>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title"><i class="fa fa-trash-o fa-fw"></i> Supprimer ce compte</h4>
@ -78,6 +79,7 @@
</form>
</div>
</div>
<?php } ?>
</div>
<div class="col-xs-12 col-md-6">
<div class="panel panel-default">