2 /*=====================================================================*\
3 || ###################################################################
5 || # Copyright (c)2004-2009 Blue Static
7 || # This program is free software; you can redistribute it and/or modify
8 || # it under the terms of the GNU General Public License as published by
9 || # the Free Software Foundation; version 2 of the License.
11 || # This program is distributed in the hope that it will be useful, but
12 || # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 || # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 || # You should have received a copy of the GNU General Public License along
17 || # with this program; if not, write to the Free Software Foundation, Inc.,
18 || # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 || ###################################################################
20 \*=====================================================================*/
24 require_once('./includes/init.php');
25 require_once('./includes/functions.php');
26 require_once('./includes/functions_admin.php');
28 // ###################################################################
29 // setup admin templates
31 require_once ISSO
. '/DecoratorHelpers.php';
33 require_once ISSO
. '/Template.php';
34 BSTemplate
::$dbCacheTable = TABLE_PREFIX
. 'template';
35 BSTemplate
::$templatePath = 'admin/templates/%s.html';
37 $globaltemplates = array(
45 BSTemplate
::cache(array_merge($globaltemplates, (array)$fetchtemplates));
46 BSApp
::debug('time for tpl cache: ' . BSFunctions
::fetch_microtime_diff($start));
48 BSTemplate
::$globalVars = array(
50 'doctype' => BSTemplate
::fetch('doctype')->evaluate()->getTemplate(),
51 'nav' => BSTemplate
::fetch('nav')->evaluate()->getTemplate(),
52 'headinclude' => BSTemplate
::fetch('headinclude')->evaluate()->getTemplate(),
53 'title' => T('Bugdar Administration')
57 // ###################################################################
59 if (can_perform('canadminpanel'))
61 $session = $db->queryFirst("SELECT * FROM " . TABLE_PREFIX
. "adminsession WHERE sessionid = '" . $input->inputEscape(COOKIE_PREFIX
. 'adminsession') . "'");
62 if ($session AND $session['userid'] == bugdar
::$userinfo['userid'] AND $session['dateline'] >= (TIMENOW
- 3600))
65 BSFunctions
::cookie(COOKIE_PREFIX
. 'adminsession', $session['sessionid'], false
);
69 BSFunctions
::cookie(COOKIE_PREFIX
. 'adminsession', false
);
75 BSFunctions
::cookie(COOKIE_PREFIX
. 'adminsession', false
);