From c2137095e8b176affa3e97af579a70d394eeb7c1 Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Sun, 22 May 2016 03:02:33 -0400 Subject: Add action 'delete' to Deleteacct MVC This action will validate the user's password, and make sure you're not removing the last admin, then proceed to delete the current user's account from the database and log them out, for good. --- app/controller/deleteacct.control.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'app/controller/deleteacct.control.php') diff --git a/app/controller/deleteacct.control.php b/app/controller/deleteacct.control.php index 176b7bf..bd81ec7 100644 --- a/app/controller/deleteacct.control.php +++ b/app/controller/deleteacct.control.php @@ -15,7 +15,17 @@ class Deleteacct extends Controller function handle($argv) { $mod = new DeleteacctModel(); - $this->action_default($mod); + + switch ($_REQUEST['input']['action']) + { + case "delete": + $this->action_delete($mod); + break; + + default: + $this->action_default($mod); + break; + } } function action_default($mod) @@ -23,6 +33,12 @@ class Deleteacct extends Controller $mod->deflt(); include "view/deleteacct/default.view.php"; } + + function action_delete($mod) + { + $mod->del($_REQUEST['input']); + $this->action_default($mod); + } } ?> -- cgit v1.2.3