From 710cd981aabca58f3d26d0f6e6c0152c6962a039 Mon Sep 17 00:00:00 2001 From: flashwave Date: Mon, 6 Apr 2015 21:23:54 +0000 Subject: [PATCH] Auth pages --- _sakura/sakura.php | 9 +- _sakura/templates/yuuno/global/header.tpl | 161 +++++++++--------- _sakura/templates/yuuno/main/authenticate.tpl | 138 +++++++++++++++ main/.htaccess | 2 +- main/authenticate.php | 33 ++++ 5 files changed, 258 insertions(+), 85 deletions(-) create mode 100644 _sakura/templates/yuuno/main/authenticate.tpl diff --git a/_sakura/sakura.php b/_sakura/sakura.php index e8bae8c..68ad2cf 100644 --- a/_sakura/sakura.php +++ b/_sakura/sakura.php @@ -51,10 +51,11 @@ Main::init($sakuraConf); // Set base page rendering data $renderData = array( 'sakura' => [ - 'version' => SAKURA_VERSION, - 'urls' => Configuration::getLocalConfig('urls'), - 'charset' => Configuration::getConfig('charset'), - 'currentpage' => $_SERVER['PHP_SELF'] + 'version' => SAKURA_VERSION, + 'urls' => Configuration::getLocalConfig('urls'), + 'charset' => Configuration::getConfig('charset'), + 'currentpage' => $_SERVER['PHP_SELF'], + 'recaptcha_public' => Configuration::getConfig('recaptcha_public') ], 'php' => [ 'sessionid' => \session_id(), diff --git a/_sakura/templates/yuuno/global/header.tpl b/_sakura/templates/yuuno/global/header.tpl index 1643f02..5f81950 100644 --- a/_sakura/templates/yuuno/global/header.tpl +++ b/_sakura/templates/yuuno/global/header.tpl @@ -1,80 +1,81 @@ - - - - - - {{ page.title }} - - - - - - - - - - - - -
- - -
- {% if user.loggedin != true %} - - {% endif %} + + + + + + {{ page.title }} + + + + + + + + + + + + +
+ + +
+ {% if user.loggedin != true %} + + {% endif %} diff --git a/_sakura/templates/yuuno/main/authenticate.tpl b/_sakura/templates/yuuno/main/authenticate.tpl new file mode 100644 index 0000000..57b7b8a --- /dev/null +++ b/_sakura/templates/yuuno/main/authenticate.tpl @@ -0,0 +1,138 @@ +{% include 'global/header.tpl' %} +
+ {% if auth.redirect == sakura.urls.chat %}

You need to be logged in to use the chat.

{% endif %} +
+
+
+ Login to Flashii +
+
+ + + + +
+ +
+
+ +
+
+ +
+
+ +
+ +
+ +
+
+
+
+
+ Lost Password +
+
+ + + +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+ +
+
+
+
+
+ Register on Flashii +
+
+ + + +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+ +
+ +
+ +
+
+ {% if auth.blockRegister.do %} +
+
+
+

Are you {{ auth.blockRegister.username }}?

+

Making more than one account is not permitted.

+

If you lost your password please use the form on the bottom left but if you don't already have an account you can go ahead and click the link below to show the registration form this check is based on your IP so in some cases someone may have registered/used the site on this IP already.

+

If we find out that you already have an account we may question you about it, if you can give a good reason we'll let it slide otherwise we may issue a temporary ban.

+
+ +
+ {% endif %} +
+
+
+{% include 'global/footer.tpl' %} diff --git a/main/.htaccess b/main/.htaccess index f5e6268..e29b25d 100644 --- a/main/.htaccess +++ b/main/.htaccess @@ -17,7 +17,7 @@ Options +FollowSymLinks -Indexes RewriteRule ^feedback?/?$ http://forum.flash.moe/viewforum.php?f=22 RewriteRule ^credits?/?$ credits.php RewriteRule ^index?/?$ index.php -RewriteRule ^login?/?$|register?/?$|forgotpassword?/?$ authenticate.php +RewriteRule ^login?/?$|register?/?$|forgotpassword?/?|authenticate?/?$ authenticate.php RewriteRule ^donate?/?$ donate.php RewriteRule ^contact?/?$ contact.php diff --git a/main/authenticate.php b/main/authenticate.php index e69de29..7bcfc2a 100644 --- a/main/authenticate.php +++ b/main/authenticate.php @@ -0,0 +1,33 @@ + 'Login to Flashii' +]; +$renderData['auth'] = [ + 'redirect' => ( + isset($_REQUEST['chat']) ? + Configuration::getLocalConfig('urls', 'chat') : + ( + isset($_SERVER['HTTP_REFERER']) ? + $_SERVER['HTTP_REFERER'] : + Configuration::getLocalConfig('urls', 'main') + ) + ), + 'blockRegister' => [ + 'do' => true, + 'username' => 'test' + ] +]; + +// Print page contents +print Main::tplRender('main/authenticate.tpl', $renderData);