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