From abb659a2753054158e9f7ec26271740a64a07e7d Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Sun, 3 Jan 2016 15:49:33 -0500 Subject: * Hooked the Auth MVC from the Root controller --- app/controller/root.control.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'app/controller/root.control.php') diff --git a/app/controller/root.control.php b/app/controller/root.control.php index 437cae1..b44ad76 100644 --- a/app/controller/root.control.php +++ b/app/controller/root.control.php @@ -2,6 +2,7 @@ require_once "class/controller.class.php"; require_once "controller/sysconf.control.php"; +require_once "controller/auth.control.php"; /* * Root-level controller for Scrott app. This object will delegate the page request to the @@ -27,8 +28,12 @@ class Root extends Controller } /* TODO */ + /* TODO -- only auth if logged out */ else - echo "Configuration is present!"; + { + $ctrl = new Auth(); + $ctrl->handle($argv); + } } /* -- cgit v1.2.3 From 8640c13c934ff3e6d907b1e335edb83da088a2ca Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Sun, 31 Jan 2016 20:33:38 -0500 Subject: Log in on signup success Now, on a successful submission of the signup view form (Auth MVC), the app automatically logs in the newly-created user and redirects to Framework::ap() . "/". Placeholder code has been added to the root controller to simply var_dump() the current logged in user if one exists, otherwise the login view (Auth MVC) is shown --- app/controller/root.control.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'app/controller/root.control.php') diff --git a/app/controller/root.control.php b/app/controller/root.control.php index b44ad76..06abf27 100644 --- a/app/controller/root.control.php +++ b/app/controller/root.control.php @@ -29,11 +29,19 @@ class Root extends Controller /* TODO */ /* TODO -- only auth if logged out */ - else + else if (!$this->getCurrentUser()) { $ctrl = new Auth(); $ctrl->handle($argv); } + + else + { + echo "logged in as:!"; + echo "
";
+            var_dump($this->getCurrentUser());
+            echo "
"; + } } /* -- cgit v1.2.3