From 9fc133aeb057dc04ce9500f370e5dbe76b902019 Mon Sep 17 00:00:00 2001 From: flashwave Date: Wed, 8 Apr 2015 17:18:19 +0000 Subject: [PATCH] More work on the authentication bit. --- .../templates/yuuno/errors/information.tpl | 8 +++++ _sakura/templates/yuuno/global/header.tpl | 3 ++ main/authenticate.php | 29 ++++++++++++++++++- 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 _sakura/templates/yuuno/errors/information.tpl diff --git a/_sakura/templates/yuuno/errors/information.tpl b/_sakura/templates/yuuno/errors/information.tpl new file mode 100644 index 0000000..8946efa --- /dev/null +++ b/_sakura/templates/yuuno/errors/information.tpl @@ -0,0 +1,8 @@ +{% include 'global/header.tpl' %} +
+

Information

+
+ {{ page.message }} + {% if page.redirect %}
Click here if you aren't being redirected.{% endif %} +
+{% include 'global/footer.tpl' %} diff --git a/_sakura/templates/yuuno/global/header.tpl b/_sakura/templates/yuuno/global/header.tpl index 5f81950..8e8bfb0 100644 --- a/_sakura/templates/yuuno/global/header.tpl +++ b/_sakura/templates/yuuno/global/header.tpl @@ -7,6 +7,9 @@ + {% if page.redirect %} + + {% endif %} diff --git a/main/authenticate.php b/main/authenticate.php index 0a9ebb4..f1107ce 100644 --- a/main/authenticate.php +++ b/main/authenticate.php @@ -9,9 +9,36 @@ namespace Sakura; // Include components require_once str_replace(basename(__DIR__), '', dirname(__FILE__)) .'_sakura/sakura.php'; +// Page actions +if( + isset($_REQUEST['mode']) && + isset($_REQUEST['time']) && + isset($_REQUEST['session']) +) { + + switch($_REQUEST['mode']) { + + case 'login': + case 'register': + case 'forgotpassword': + // Add page specific things + $renderData['page'] = [ + 'title' => 'auth test', + 'redirect' => $_SERVER['PHP_SELF'], + 'message' => 'meow meow meow meow meow meow meow meow meow meow meow meow' + ]; + + // Print page contents + print Templates::render('errors/information.tpl', $renderData); + exit; + + } + +} + // Add page specific things $renderData['page'] = [ - 'title' => 'Login to Flashii' + 'title' => 'Login to Flashii' ]; $renderData['auth'] = [ 'redirect' => (