r110: Added some global locations so we have some backtrace links
[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 'Locations' => array(
23 'Admin Home' => 'index.php',
24 'BugStrike Home' => '../index.php',
25 'Admin Logout' => '../login.php?do=cplogout'
26 ),
27
28 'Options' => array(
29 'BugStrike Options' => 'options.php'
30 ),
31
32 'Bug Fields' => array(
33 'Products / Versions / Components' => 'product.php',
34 'Priorities' => 'priority.php',
35 'Resolutions' => 'resolution.php',
36 'Severities' => 'severity.php',
37 'Statuses' => 'status.php'
38 ),
39
40 'User Management' => array(
41 'Usergroups' => 'usergroup.php'
42 )
43 );
44
45 // ###################################################################
46 // continue loading
47
48 require_once('./includes/adminfunctions.php');
49 $admin = new Admin_Print_Class();
50
51 // ###################################################################
52
53 function admin_login()
54 {
55 global $admin, $bugsys;
56
57 $admin->page_start('Login', '', 15, '', 'document.cplogin.' . (($bugsys->userinfo['email']) ? 'password' : 'email') . '.focus();');
58
59 $admin->form_start('../login.php', 'cplogin', false, 'cplogin');
60 $admin->table_start(true, '425');
61 $admin->table_head(phrase('renapsus_login'));
62 $admin->row_input(phrase('email'), 'email', $bugsys->userinfo['email'], 2, 35, false, false, 'middle');
63 $admin->row_input(phrase('password'), 'password', '', 2, 35, false, true, 'middle');
64 $admin->row_submit('', phrase('login'));
65 $admin->table_end();
66 $admin->form_end();
67
68 $admin->page_end();
69 }
70
71 // ###################################################################
72
73 if ($_COOKIE[COOKIE_PREFIX . 'adminsession'])
74 {
75 if (can_perform('canadminpanel'))
76 {
77 if (md5(md5($bugsys->userinfo['authkey']) . md5($bugsys->userinfo['email']) . md5($bugsys->userinfo['userid'])) != $_COOKIE[COOKIE_PREFIX . 'adminsession'])
78 {
79 mysetcookie(COOKIE_PREFIX . 'adminsession', '');
80 $admin->error(phrase('invalid_admin_session_terminated'));
81 }
82 }
83 else
84 {
85 mysetcookie(COOKIE_PREFIX . 'adminsession', '');
86 admin_login();
87 }
88 }
89
90 if (!$_COOKIE[COOKIE_PREFIX . 'adminsession'])
91 {
92 admin_login();
93 }
94
95 /*=====================================================================*\
96 || ###################################################################
97 || # $HeadURL$
98 || # $Id$
99 || ###################################################################
100 \*=====================================================================*/
101 ?>