diff options
Diffstat (limited to 'app/controller')
-rw-r--r-- | app/controller/dashboard.control.php | 2 | ||||
-rw-r--r-- | app/controller/deleteacct.control.php | 44 | ||||
-rw-r--r-- | app/controller/root.control.php | 2 |
3 files changed, 46 insertions, 2 deletions
diff --git a/app/controller/dashboard.control.php b/app/controller/dashboard.control.php index aa1c0bd..4ee4b38 100644 --- a/app/controller/dashboard.control.php +++ b/app/controller/dashboard.control.php @@ -14,8 +14,6 @@ class Dashboard extends Controller function handle($argv) { $mod = new DashboardModel(); - $mod->common_handleFormSubmissions($_REQUEST['input'], $_FILES['attachment']); - $mod->common_deflt(); $this->action_default($mod); } diff --git a/app/controller/deleteacct.control.php b/app/controller/deleteacct.control.php new file mode 100644 index 0000000..bd81ec7 --- /dev/null +++ b/app/controller/deleteacct.control.php @@ -0,0 +1,44 @@ +<?php + +require_once "class/controller.class.php"; +require_once "model/deleteacct.mod.php"; + +/* + * Deleteacct is used to delete user accounts, requiring all requests to + * correctly enter the user's password + */ +class Deleteacct extends Controller +{ + /* + * Controller implementation + */ + function handle($argv) + { + $mod = new DeleteacctModel(); + + switch ($_REQUEST['input']['action']) + { + case "delete": + $this->action_delete($mod); + break; + + default: + $this->action_default($mod); + break; + } + } + + function action_default($mod) + { + $mod->deflt(); + include "view/deleteacct/default.view.php"; + } + + function action_delete($mod) + { + $mod->del($_REQUEST['input']); + $this->action_default($mod); + } +} + +?> diff --git a/app/controller/root.control.php b/app/controller/root.control.php index 7017ada..341fa8a 100644 --- a/app/controller/root.control.php +++ b/app/controller/root.control.php @@ -7,6 +7,7 @@ require_once "controller/except.control.php"; require_once "controller/auth.control.php"; require_once "controller/deauth.control.php"; require_once "controller/dashboard.control.php"; +require_once "controller/deleteacct.control.php"; /* * Root-level controller for Scrott app. This object will delegate the page request to the @@ -65,6 +66,7 @@ class Root extends Controller switch ($argv[0]) { case "logout": $ctrl = new Deauth(); break; + case "deleteaccount": $ctrl = new Deleteacct(); break; default: throw new Exception("The requested path is not valid."); break; |