summaryrefslogtreecommitdiffstats
path: root/app/controller/root.control.php
diff options
context:
space:
mode:
authorMalf Furious <m@lfurio.us>2016-03-06 00:04:09 -0500
committerMalf Furious <m@lfurio.us>2016-03-27 20:16:32 -0400
commit493e10764abe630e2537f72e3b98d95e6a679b6a (patch)
tree1e1df94f377abef08675b5cedcad203840856856 /app/controller/root.control.php
parente7268937ab3e7dce2fb14e3ae1256690c3b34b63 (diff)
downloadscrott-493e10764abe630e2537f72e3b98d95e6a679b6a.tar.gz
scrott-493e10764abe630e2537f72e3b98d95e6a679b6a.zip
Hook Deauth and Dashboard MVCs from Root controller
These two MVC trees are now accessable from the app. Also, the root controller is finally in a clean state :).
Diffstat (limited to '')
-rw-r--r--app/controller/root.control.php22
1 files changed, 18 insertions, 4 deletions
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)