From 651c43ffc23d68b807f132aacbcfb6b9fbeb9bb8 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Mon, 5 Jan 2009 21:24:09 -0800 Subject: [PATCH] Add the login template * global.php: Define some global templates, fix admin_login() * templates/doctype.html: Whitespace-ify * templates/headinclude.html: ditto * templates/login.html: New file --- admin/global.php | 34 ++++++++++---------------- admin/templates/doctype.html | 2 +- admin/templates/headinclude.html | 1 + admin/templates/login.html | 41 ++++++++++++++++++++++++++++++++ 4 files changed, 55 insertions(+), 23 deletions(-) create mode 100644 admin/templates/login.html diff --git a/admin/global.php b/admin/global.php index 81061bc..83b1ecd 100755 --- a/admin/global.php +++ b/admin/global.php @@ -28,38 +28,30 @@ require_once('./includes/functions.php'); // setup admin templates require_once ISSO . '/Template.php'; -BSTemplate::$preParseHook = 'isso_pre_parse_hook'; // BSTemplate::$dbCacheTable = TABLE_PREFIX . 'admintemplate'; -BSTemplate::$langcall = 'T'; -BSTemplate::$templatePath = 'templates/%s.tpl'; +BSTemplate::$templatePath = 'admin/templates/%s.html'; +BSTemplate::$globalVars = array( + 'templates' => array( + 'doctype' => BSTemplate::fetch('doctype')->evaluate()->getTemplate(), + 'nav' => BSTemplate::fetch('nav')->evaluate()->getTemplate(), + 'headinclude' => BSTemplate::fetch('headinclude')->evaluate()->getTemplate(), + 'title' => T('Bugdar Administration') + ) +); // ################################################################### function admin_login() { - global $admin, $bugsys; - - define('ISSO_PRINTER_NO_NAVIGATION', 1); - - $admin->page_start(T('Login'), null, '', 'document.cplogin.' . (bugdar::$userinfo['email'] ? 'password' : 'email') . '.focus();'); - - $admin->form_start('../login.php', 'cplogin', false, 'cplogin'); - $admin->table_start(true, '425'); - $admin->table_head(T('Login to Bugdar')); - $admin->row_input(T('Email'), 'email', bugdar::$userinfo['email'], 2, 35, false, false, 'middle'); - $admin->row_input(T('Password'), 'password', '', 2, 35, false, true, 'middle'); - $admin->row_submit('', T('Login')); - $admin->table_end(); - $admin->form_end(); - - $admin->page_end(); + BSTemplate::fetch('login')->evaluate()->flush(); + exit; } // ################################################################### if (can_perform('canadminpanel')) { - $session = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "adminsession WHERE sessionid = '" . $bugsys->input_escape(COOKIE_PREFIX . 'adminsession') . "'"); + $session = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX . "adminsession WHERE sessionid = '" . $input->inputEscape(COOKIE_PREFIX . 'adminsession') . "'"); if ($session AND $session['userid'] == bugdar::$userinfo['userid'] AND $session['dateline'] >= (TIMENOW - 3600)) { // renew the cookie @@ -69,8 +61,6 @@ if (can_perform('canadminpanel')) { BSFunctions::cookie(COOKIE_PREFIX . 'adminsession', false); admin_login(); - // do we need this message? - $admin->error(T('Invalid admin session has been terminated.')); } } else diff --git a/admin/templates/doctype.html b/admin/templates/doctype.html index fd6f946..aa8d9a8 100644 --- a/admin/templates/doctype.html +++ b/admin/templates/doctype.html @@ -1,2 +1,2 @@ \ No newline at end of file + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> diff --git a/admin/templates/headinclude.html b/admin/templates/headinclude.html index 4f6246c..9519bfa 100644 --- a/admin/templates/headinclude.html +++ b/admin/templates/headinclude.html @@ -1,3 +1,4 @@ + \ No newline at end of file diff --git a/admin/templates/login.html b/admin/templates/login.html new file mode 100644 index 0000000..b517ac1 --- /dev/null +++ b/admin/templates/login.html @@ -0,0 +1,41 @@ +<%- $templates['doctype'] %> + + + <%- $templates['headinclude'] %> + <%- $templates['title'] %> - <%- T('Login') %> + + + + +
<%- T('Bugdar Admin Control Panel Login') %>
+ +
+ +
+ + +
+
+ <%- T('Login') %> + Please enter your Bugdar email address and password to proceed into the Admin Control Panel. + +
+
+
+ +
+
+
+
+
+ + +
+
+ +
+ +
+ + + \ No newline at end of file -- 2.43.5