]>
src.bluestatic.org Git - bugdar.git/blob - admin/global.php
2 /*=====================================================================*\
3 || ###################################################################
4 || # Bugdar [#]version[#]
5 || # Copyright ©2002-[#]year[#] Iris Studios, Inc.
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 [#]gpl[#] 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');
27 // ###################################################################
31 $lang->string('Administration Locations') => array(
32 $lang->string('Home') => 'index.php',
33 $lang->string('Logout') => '../login.php?do=cplogout'
36 $lang->string('Options') => array(
37 $lang->string('Bugdar Settings') => 'setting.php',
38 $lang->string('Manage Languages') => 'language.php',
39 $lang->string('Edit User Help') => 'userhelp.php'
42 $lang->string('Bug Fields') => array(
43 $lang->string('Products / Versions / Components') => 'product.php',
44 $lang->string('Priorities') => 'priority.php',
45 $lang->string('Resolutions') => 'resolution.php',
46 $lang->string('Severities') => 'severity.php',
47 $lang->string('Statuses') => 'status.php',
48 $lang->string('Custom Bug Fields') => 'field.php',
49 $lang->string('Automatic Actions') => 'autoaction.php'
52 $lang->string('User Management') => array(
53 $lang->string('Users') => 'user.php',
54 $lang->string('Usergroups') => 'usergroup.php',
55 $lang->string('Usergroup Permissions') => 'permission.php'
59 // ###################################################################
62 $bugsys->load('printer', 'admin', true);
63 $admin->set('realm', $lang->string('Administration'));
64 $admin->set('page_start_hook', 'nav_hook');
65 $admin->css_link('../framework/printer.css.php');
67 // ###################################################################
69 function admin_login()
71 global $admin, $bugsys;
73 $admin->page_start('Login', '', 15, '', 'document.cplogin.' . (($bugsys->userinfo
['email']) ? 'password' : 'email') . '.focus();');
75 $admin->form_start('../login.php', 'cplogin', false, 'cplogin');
76 $admin->table_start(true, '425');
77 $admin->table_head($bugsys->lang
->string('Login to Bugdar'));
78 $admin->row_input($bugsys->lang
->string('Email'), 'email', $bugsys->userinfo
['email'], 2, 35, false, false, 'middle');
79 $admin->row_input($bugsys->lang
->string('Password'), 'password', '', 2, 35, false, true, 'middle');
80 $admin->row_submit('', $bugsys->lang
->string('Login'));
87 // ###################################################################
89 $bugsys->userinfo
['adminsession'] = false;
91 if ($_COOKIE[COOKIE_PREFIX
. 'adminsession'])
93 if (can_perform('canadminpanel'))
95 if (md5(md5($bugsys->userinfo
['authkey']) . md5(gmdate('F j, Y @ H'))) != $_COOKIE[COOKIE_PREFIX
. 'adminsession'])
97 $funct->cookie(COOKIE_PREFIX
. 'adminsession', '');
99 // do we need this message?
100 $admin->error($lang->string('Invalid admin session has been terminated.'));
105 $funct->cookie(COOKIE_PREFIX
. 'adminsession', md5(md5($bugsys->userinfo
['authkey']) . md5(gmdate('F j, Y @ H'))), false);
106 $bugsys->userinfo
['adminsession'] = true;
111 $funct->cookie(COOKIE_PREFIX
. 'adminsession', '');
116 if (!$_COOKIE[COOKIE_PREFIX
. 'adminsession'])
121 // ###################################################################
122 // TEMPORARY NAVIGATION SYSTEM
126 global $globalnav, $bugsys;
128 $location = parse_url($_SERVER['SCRIPT_URL']);
129 $location['path'] = preg_quote(end(explode('/', $location['path'])));
130 $location['path'] = ((!$location['path']) ? 'index.php' : $location['path']);
132 echo "<div class=\"tcat\" style=\"padding: 5px; border-bottom: 4px outset\">\n";
133 echo "\n\t<form action=\"jump.php\" method=\"post\" title=\"navigation\" style=\"display: inline\">";
134 echo "\n\t<span style=\"float: right\"><a href=\"../\">" . $bugsys->lang
->string('Tracker Home') . "</a></span>";
135 echo "\n\t\t" . $bugsys->lang
->string('Navigation') . ": <select name=\"jumplocation\" onchange=\"this.form.submit()\" class=\"input\">";
136 foreach ($globalnav AS $grouptitle => $links)
138 echo "\n\t\t<optgroup label=\"$grouptitle\">";
139 foreach ($links AS $title => $url)
141 $selected = ((preg_match("#$location[path]$#i", $url)) ? ' selected="selected"' : '');
142 echo "\n\t\t\t<option value=\"$url\"$selected>$title</option>";
144 echo "\n\t\t</optgroup>";
146 echo "\n\t\t</select>";
147 echo "\n\t\t<input type=\"submit\" name=\"go\" value=\" " . $bugsys->lang
->string('Go') . " \" class=\"button\" />";
152 /*=====================================================================*\
153 || ###################################################################
156 || ###################################################################
157 \*=====================================================================*/