/
menu_inc.php
53 lines (51 loc) · 1.97 KB
/
menu_inc.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?
# Mantis - a php based bugtracking system
# Copyright (C) 2000 Kenzaburo Ito - kenito@300baud.org
# This program is distributed under the terms and conditions of the GPL
# See the files README and LICENSE for details
?>
<?
if ( !isset( $g_string_cookie_val ) ) {
### required for variables to get picked up
global $g_string_cookie_val, $g_path,
$g_mantis_user_table, $g_mantis_user_pref_table,
$g_hostname, $g_db_username, $g_db_password, $g_database_name,
$g_main_page, $g_view_bug_all_page,
$g_report_bug_page, $g_report_bug_advanced_page,
$g_summary_page, $g_account_page, $g_manage_page,
$g_news_menu_page, $g_logout_page;
}
db_mysql_connect( $g_hostname, $g_db_username, $g_db_password, $g_database_name );
### grab the access level and protected information for the
### currently logged in user
$query = "SELECT access_level, protected
FROM $g_mantis_user_table
WHERE cookie_string='$g_string_cookie_val'";
$result = mysql_query($query);
$t_access_level = mysql_result( $result, 0, 0 );
$t_protected = mysql_result( $result, 0, 1 );
?>
<div align=center>
<font face=Verdana size=-1>
<a href="<? echo $g_path.$g_main_page ?>">Main</a> |
<a href="<? echo $g_path.$g_view_bug_all_page ?>">View Bugs</a> |
<?
if ( $t_access_level!="viewer" ) {
if ( get_user_value( $g_mantis_user_pref_table, "advanced_view" )=="on" ) {
?>
<a href="<? echo $g_path.$g_report_bug_advanced_page ?>">Report Bug</a> |
<? } else { ?>
<a href="<? echo $g_path.$g_report_bug_page ?>">Report Bug</a> |
<?
}
} # end report/viewer if
?>
<a href="<? echo $g_path.$g_summary_page ?>">Summary</a> |
<a href="<? echo $g_path.$g_account_page ?>">Account</a> |
<? if ( $t_access_level=="administrator" ) { ?>
<a href="<? echo $g_path.$g_manage_page ?>">Manage</a> |
<a href="<? echo $g_path.$g_news_menu_page ?>">Edit News</a> |
<? } ?>
<a href="<? echo $g_path.$g_logout_page ?>">Logout</a>
</font>
</div>