From 8149c2bdc068c438b57f0d67b7cb2164056e3973 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Fri, 7 Jun 2013 23:41:23 -0400 Subject: [PATCH] Create a new admin login page using hoplite. --- admin/index.php | 4 ++- admin/login.php | 45 ++++++++++++++++++++++++++++++++ admin/templates/admin_header.tpl | 2 +- admin/templates/admin_login.tpl | 17 ++++++++++++ includes/hoplite | 2 +- 5 files changed, 67 insertions(+), 3 deletions(-) create mode 100644 admin/login.php create mode 100644 admin/templates/admin_login.tpl diff --git a/admin/index.php b/admin/index.php index fc06263..897de72 100644 --- a/admin/index.php +++ b/admin/index.php @@ -35,6 +35,8 @@ require_once HOPLITE_ROOT . '/http/url_map.php'; require_once HOPLITE_ROOT . '/views/pdo_cache_backend.php'; require_once HOPLITE_ROOT . '/views/template_loader.php'; +require_once BUGDAR_ROOT . '/admin/login.php'; + /** * @implements \hoplite\http\RootControllerDelegate */ @@ -78,7 +80,7 @@ class FrontController public function LoginPage() { - $this->controller->StopWithCode(http\ResponseCode::FORBIDDEN); + $this->controller->InvokeAction(new LoginAction($this->controller)); } public function WillInvokeAction(http\Action $action, http\Request $request, http\Response $response) diff --git a/admin/login.php b/admin/login.php new file mode 100644 index 0000000..79663af --- /dev/null +++ b/admin/login.php @@ -0,0 +1,45 @@ +response_code = http\ResponseCode::FORBIDDEN; + $response->data['title'] = T('Login'); + + $response->context['template'] = 'admin_login'; + + $this->controller()->Stop(); + } +} \ No newline at end of file diff --git a/admin/templates/admin_header.tpl b/admin/templates/admin_header.tpl index 0a6f8c4..08543dc 100644 --- a/admin/templates/admin_header.tpl +++ b/admin/templates/admin_header.tpl @@ -2,7 +2,7 @@ - Bugdar2 Admin Panel - {%= $title %} + Bugdar2 {%=T('Administration')%} - {%= $title %} diff --git a/admin/templates/admin_login.tpl b/admin/templates/admin_login.tpl new file mode 100644 index 0000000..2955d0e --- /dev/null +++ b/admin/templates/admin_login.tpl @@ -0,0 +1,17 @@ +{%#import 'admin_header'%} + +

{%=T('Login to Bugdar')%}

+ +
+ + + + + + + + + +
+ +{%#import 'admin_footer'%} \ No newline at end of file diff --git a/includes/hoplite b/includes/hoplite index a7c5ff1..c1097e9 160000 --- a/includes/hoplite +++ b/includes/hoplite @@ -1 +1 @@ -Subproject commit a7c5ff1323c5b72bedd54bd57c1279e780be7232 +Subproject commit c1097e96c8aeaeecf895e9412af52a74b50ef830 -- 2.43.5