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
*/
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)
--- /dev/null
+<?php
+/*=====================================================================*\
+|| ###################################################################
+|| # Bugdar
+|| # Copyright (c)2002-2013 Blue Static
+|| #
+|| # This program is free software; you can redistribute it and/or modify
+|| # it under the terms of the GNU General Public License as published by
+|| # the Free Software Foundation; version 2 of the License.
+|| #
+|| # This program is distributed in the hope that it will be useful, but
+|| # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+|| # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+|| # more details.
+|| #
+|| # You should have received a copy of the GNU General Public License along
+|| # with this program; if not, write to the Free Software Foundation, Inc.,
+|| # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+|| ###################################################################
+\*=====================================================================*/
+
+namespace bugdar\admin;
+
+use \bugdar;
+use \hoplite\http;
+
+require_once HOPLITE_ROOT . '/http/action.php';
+
+class LoginAction extends http\Action implements TemplatePreCaching
+{
+ public function TemplateSet()
+ {
+ return array('admin_login');
+ }
+
+ public function Invoke(http\Request $request, http\Response $response)
+ {
+ $response->response_code = http\ResponseCode::FORBIDDEN;
+ $response->data['title'] = T('Login');
+
+ $response->context['template'] = 'admin_login';
+
+ $this->controller()->Stop();
+ }
+}
\ No newline at end of file
<html lang="{%= $language['langcode'] %}" dir="{%= $language['direction'] %}">
<head>
<meta charset="{%= $language['charset'] %}">
- <title>Bugdar2 Admin Panel - {%= $title %}</title>
+ <title>Bugdar2 {%=T('Administration')%} - {%= $title %}</title>
<link rel="stylesheet" href="templates/css/reset.css">
<link rel="stylesheet" href="templates/css/admin.css">
</head>
--- /dev/null
+{%#import 'admin_header'%}
+
+<h1>{%=T('Login to Bugdar')%}</h1>
+
+<form action="../login.php" method="post">
+ <input type="hidden" name="do" value="cplogin">
+
+ <label for="email">{%=T('Email')%}:</label>
+ <input type="text" id="email" name="email" value="{%= Bugdar::$user['email'] %}">
+
+ <label for="password">{%=T('Password')%}</label>
+ <input type="password" id="password" name="password">
+
+ <input type="submit" value="{%=T('Login')%}">
+</form>
+
+{%#import 'admin_footer'%}
\ No newline at end of file