diff options
-rw-r--r-- | app/controller/auth.control.php | 33 | ||||
-rw-r--r-- | app/controller/root.control.php | 7 | ||||
-rw-r--r-- | app/model/auth.mod.php | 15 | ||||
-rw-r--r-- | app/model/common.mod.php | 9 | ||||
-rw-r--r-- | app/view/auth/default.view.php | 13 | ||||
-rw-r--r-- | app/view/common/foot.view.php | 1 | ||||
-rw-r--r-- | app/view/common/head.view.php | 8 | ||||
-rw-r--r-- | app/view/common/topp.view.php | 21 | ||||
-rw-r--r-- | examples/example.html | 22 |
9 files changed, 107 insertions, 22 deletions
diff --git a/app/controller/auth.control.php b/app/controller/auth.control.php new file mode 100644 index 0000000..00c71f6 --- /dev/null +++ b/app/controller/auth.control.php @@ -0,0 +1,33 @@ +<?php + +require_once "class/controller.class.php"; +require_once "model/auth.mod.php"; + +/* + * Auth is used to login, logout, or register new user accounts + */ +class Auth extends Controller +{ + /* + * Controller implementation + */ + function handle($argv) + { + $mod = new AuthModel(); + + switch ($_REQUEST['input']['action']) + { + default: + $this->action_default($mod); + break; + } + } + + function action_default($mod) + { + $mod->deflt(); + include "view/auth/default.view.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); + } } /* diff --git a/app/model/auth.mod.php b/app/model/auth.mod.php new file mode 100644 index 0000000..9c356e2 --- /dev/null +++ b/app/model/auth.mod.php @@ -0,0 +1,15 @@ +<?php + +require_once "model/common.mod.php"; + +class AuthModel extends CommonModel +{ + /* + * Default action + */ + function deflt() + { + } +} + +?> diff --git a/app/model/common.mod.php b/app/model/common.mod.php new file mode 100644 index 0000000..d4270d8 --- /dev/null +++ b/app/model/common.mod.php @@ -0,0 +1,9 @@ +<?php + +require_once "model/master.mod.php"; + +class CommonModel extends MasterModel +{ +} + +?> diff --git a/app/view/auth/default.view.php b/app/view/auth/default.view.php new file mode 100644 index 0000000..8769aa2 --- /dev/null +++ b/app/view/auth/default.view.php @@ -0,0 +1,13 @@ +<!DOCTYPE html> + +<html lang="en"> + <head> + <?php include "view/common/head.view.php"; ?> + <title>Scrott - Login</title> + </head> + + <body> + <?php include "view/common/topp.view.php"; ?> + <?php include "view/common/foot.view.php"; ?> + </body> +</html> diff --git a/app/view/common/foot.view.php b/app/view/common/foot.view.php new file mode 100644 index 0000000..a24a145 --- /dev/null +++ b/app/view/common/foot.view.php @@ -0,0 +1 @@ +<?php include "view/master/foot.view.php"; ?> diff --git a/app/view/common/head.view.php b/app/view/common/head.view.php new file mode 100644 index 0000000..b23ec18 --- /dev/null +++ b/app/view/common/head.view.php @@ -0,0 +1,8 @@ +<?php include "view/master/head.view.php"; ?> + +<style type="text/css"> + body + { + padding-top: 70px; + } +</style> diff --git a/app/view/common/topp.view.php b/app/view/common/topp.view.php new file mode 100644 index 0000000..05e4862 --- /dev/null +++ b/app/view/common/topp.view.php @@ -0,0 +1,21 @@ +<?php include "view/master/topp.view.php"; ?> + +<nav class="navbar navbar-inverse navbar-fixed-top"> + <div class="container-fluid"> + + <div class="navbar-header"> + <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#scrottnav" aria-expanded="false"> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + + <a href="<?=$mod->ar()?>/" class="navbar-brand"><span class="glyphicon glyphicon-pencil"></span> Scrott</a> + </div> + + <div class="collapse navbar-collapse" id="scrottnav"> + <p class="navbar-text navbar-right"><i>Not Logged In </i></p> + </div> + + </div> +</nav> diff --git a/examples/example.html b/examples/example.html index 44c91f2..7f1ac2a 100644 --- a/examples/example.html +++ b/examples/example.html @@ -1,31 +1,11 @@ <!DOCTYPE html> <html lang="en"> - <head> - <title>Scrott - Save the World</title> - - <style type="text/css"> -body -{ - padding-top: 70px; -} - </style> - </head> - <body> <!--NAVBAR--> <nav class="navbar navbar-inverse navbar-fixed-top"> <div class="container-fluid"> - <!--TITLE AND EXPAND BUTTON--> - <div class="navbar-header"> - <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse-1" aria-expanded="false"> - <span class="icon-bar"></span> - <span class="icon-bar"></span> - <span class="icon-bar"></span> - </button> - - <a href="/" class="navbar-brand"><span class="glyphicon glyphicon-pencil"></span> Scrott</a> - </div> + <!--NAVBAR CONTENT--> <div class="collapse navbar-collapse" id="navbar-collapse-1"> |