]> src.bluestatic.org Git - bugdar.git/blob - admin/global.php
r496: Removing #submitrow from report.css to global.css
[bugdar.git] / admin / global.php
1 <?php
2 /*=====================================================================*\
3 || ################################################################### ||
4 || # BugStrike [#]version[#]
5 || # --------------------------------------------------------------- # ||
6 || # Copyright ©2002-[#]year[#] by Iris Studios, Inc. All Rights Reserved. # ||
7 || # This file may not be reproduced in any way without permission. # ||
8 || # --------------------------------------------------------------- # ||
9 || # User License Agreement at http://www.iris-studios.com/license/ # ||
10 || ################################################################### ||
11 \*=====================================================================*/
12
13 chdir('./../');
14
15 require_once('./includes/init.php');
16 require_once('./includes/functions.php');
17
18 // ###################################################################
19 // admin navigation
20
21 $globalnav = array(
22 $lang->string('Administration Locations') => array(
23 $lang->string('Home') => 'index.php',
24 $lang->string('Logout') => '../login.php?do=cplogout'
25 ),
26
27 $lang->string('Options') => array(
28 $lang->string('BugStrike Settings') => 'setting.php',
29 $lang->string('Manage Languages') => 'language.php'
30 ),
31
32 $lang->string('Bug Fields') => array(
33 $lang->string('Products / Versions / Components') => 'product.php',
34 $lang->string('Priorities') => 'priority.php',
35 $lang->string('Resolutions') => 'resolution.php',
36 $lang->string('Severities') => 'severity.php',
37 $lang->string('Statuses') => 'status.php',
38 $lang->string('Custom Bug Fields') => 'field.php',
39 $lang->string('Automatic Actions') => 'autoaction.php'
40 ),
41
42 $lang->string('User Management') => array(
43 $lang->string('Usergroups') => 'usergroup.php'
44 )
45 );
46
47 // ###################################################################
48 // continue loading
49
50 require_once('./includes/adminfunctions.php');
51 $admin = new Admin_Print_Class();
52
53 // ###################################################################
54
55 function admin_login()
56 {
57 global $admin, $bugsys;
58
59 $admin->page_start('Login', '', 15, '', 'document.cplogin.' . (($bugsys->userinfo['email']) ? 'password' : 'email') . '.focus();');
60
61 $admin->form_start('../login.php', 'cplogin', false, 'cplogin');
62 $admin->table_start(true, '425');
63 $admin->table_head($bugsys->lang->string('Login to BugStrike'));
64 $admin->row_input($bugsys->lang->string('Email'), 'email', $bugsys->userinfo['email'], 2, 35, false, false, 'middle');
65 $admin->row_input($bugsys->lang->string('Password'), 'password', '', 2, 35, false, true, 'middle');
66 $admin->row_submit('', $bugsys->lang->string('Login'));
67 $admin->table_end();
68 $admin->form_end();
69
70 $admin->page_end();
71 }
72
73 // ###################################################################
74
75 $bugsys->userinfo['adminsession'] = false;
76
77 if ($_COOKIE[COOKIE_PREFIX . 'adminsession'])
78 {
79 if (can_perform('canadminpanel'))
80 {
81 if (md5(md5($bugsys->userinfo['authkey']) . md5($bugsys->userinfo['email']) . md5($bugsys->userinfo['userid'])) != $_COOKIE[COOKIE_PREFIX . 'adminsession'])
82 {
83 $funct->cookie(COOKIE_PREFIX . 'adminsession', '');
84 $admin->error($lang->string('Invalid admin session has been terminated.'));
85 }
86 else
87 {
88 // renew the cookie
89 $funct->cookie(COOKIE_PREFIX . 'adminsession', md5(md5($bugsys->userinfo['authkey']) . md5($bugsys->userinfo['email']) . md5($bugsys->userinfo['userid'])), false);
90 $bugsys->userinfo['adminsession'] = true;
91 }
92 }
93 else
94 {
95 $funct->cookie(COOKIE_PREFIX . 'adminsession', '');
96 admin_login();
97 }
98 }
99
100 if (!$_COOKIE[COOKIE_PREFIX . 'adminsession'])
101 {
102 admin_login();
103 }
104
105 /*=====================================================================*\
106 || ###################################################################
107 || # $HeadURL$
108 || # $Id$
109 || ###################################################################
110 \*=====================================================================*/
111 ?>