diff options
author | Malf Furious <m@lfurio.us> | 2016-03-27 20:19:10 -0400 |
---|---|---|
committer | Malf Furious <m@lfurio.us> | 2016-03-27 20:19:10 -0400 |
commit | 4d69a5ecca13bbda5843c176e1bc4df514f079d7 (patch) | |
tree | f15454061b94928181c0a36cd48f0979b9dfc943 /app/controller | |
parent | 7a2672164a73bb011a3d930df52c0643ee18457d (diff) | |
parent | e55a32c647cab450c2a6c6a3156c798dc0f70256 (diff) | |
download | scrott-4d69a5ecca13bbda5843c176e1bc4df514f079d7.tar.gz scrott-4d69a5ecca13bbda5843c176e1bc4df514f079d7.zip |
Merge branch 'feature/setting-modal' into dev
Diffstat (limited to '')
-rw-r--r-- | app/controller/dashboard.control.php | 29 | ||||
-rw-r--r-- | app/controller/root.control.php | 22 |
2 files changed, 47 insertions, 4 deletions
diff --git a/app/controller/dashboard.control.php b/app/controller/dashboard.control.php new file mode 100644 index 0000000..53ca160 --- /dev/null +++ b/app/controller/dashboard.control.php @@ -0,0 +1,29 @@ +<?php + +require_once "class/controller.class.php"; +require_once "model/dashboard.mod.php"; + +/* + * Main page, Dashboard -- Overview information for user, groups, and pads + */ +class Dashboard extends Controller +{ + /* + * Controller implementation + */ + function handle($argv) + { + $mod = new DashboardModel(); + $mod->common_handleFormSubmissions($_REQUEST['input']); + $mod->common_deflt(); + $this->action_default($mod); + } + + function action_default($mod) + { + $mod->deflt(); + include "view/dashboard/default.view.php"; + } +} + +?> diff --git a/app/controller/root.control.php b/app/controller/root.control.php index a9e23e9..7017ada 100644 --- a/app/controller/root.control.php +++ b/app/controller/root.control.php @@ -5,6 +5,8 @@ require_once "class/setting.class.php"; require_once "controller/sysconf.control.php"; require_once "controller/except.control.php"; require_once "controller/auth.control.php"; +require_once "controller/deauth.control.php"; +require_once "controller/dashboard.control.php"; /* * Root-level controller for Scrott app. This object will delegate the page request to the @@ -17,8 +19,6 @@ class Root extends Controller */ function handle($argv) { - /* TODO -- Authentication (login / logout / register) MVC */ - global $_SCROTT; $argv = $this->normalizeArgv($argv); @@ -56,8 +56,22 @@ class Root extends Controller return; } - /* TODO */ - echo "ALL GOOD!<br />"; + /* Handle page request */ + if (count($argv) == 0) + $ctrl = new Dashboard(); + + else + { + switch ($argv[0]) + { + case "logout": $ctrl = new Deauth(); break; + default: + throw new Exception("The requested path is not valid."); + break; + } + } + + $ctrl->handle($argv); } catch (Exception $e) |