Skip to content

Commit

Permalink
Modified account page to show default and current project access levels.
Browse files Browse the repository at this point in the history
git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@811 f5dc347c-c33d-0410-90a0-b07cc1902cb9
  • Loading branch information
Kenzaburo Ito committed Mar 26, 2002
1 parent 1a66b87 commit 3290a8b
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 3 deletions.
8 changes: 8 additions & 0 deletions account_page.php
Expand Up @@ -147,6 +147,14 @@
<?php echo get_enum_element( $s_access_levels_enum_string, $u_access_level ) ?>
</td>
</tr>
<tr class="row-2">
<td class="category">
<?php echo $s_access_level_project ?>:
</td>
<td>
<?php echo get_enum_element( $s_access_levels_enum_string, get_current_user_access_level() ) ?>
</td>
</tr>
<tr>
<td class="left">
<input type="submit" value="<?php echo $s_update_user_button ?>">
Expand Down
6 changes: 4 additions & 2 deletions core_html_API.php
Expand Up @@ -200,16 +200,18 @@ function print_login_info() {
global $g_mantis_user_table,
$g_string_cookie_val, $g_project_cookie_val,
$g_complete_date_format, $g_set_project,
$s_switch, $s_logged_in_as, $s_all_projects;
$s_switch, $s_logged_in_as, $s_all_projects,
$s_access_levels_enum_string;

$t_username = get_current_user_field( "username" );
$t_access_level = get_enum_element( $s_access_levels_enum_string, get_current_user_access_level() );
$t_now = date( $g_complete_date_format );

PRINT "<table class=\"hide\">";
PRINT "<form method=\"post\" action=\"$g_set_project\">";
PRINT "<tr>";
PRINT "<td class=\"login-info-left\">";
PRINT "$s_logged_in_as: <span class=\"login-username\">$t_username</span>";
PRINT "$s_logged_in_as: <span class=\"login-username\">$t_username</span> <span class=\"small\">($t_access_level)</span>";
PRINT "</td>";
PRINT "<td class=\"login-info-middle\">";
PRINT "<span class=\"login-time\">$t_now</span>";
Expand Down
18 changes: 18 additions & 0 deletions core_user_API.php
Expand Up @@ -659,4 +659,22 @@ function create_project_user_prefs( $p_project_id ) {
$result = db_query($query);
}
# --------------------
# grabs the access level of the current user
function get_current_user_access_level() {
global $g_string_cookie_val;

$t_access_level = get_current_user_field( "access_level" );
$t_access_level2 = get_project_access_level();

if ( $t_access_level >= ADMINISTRATOR ) {
return $t_access_level;
}

if ( $t_access_level2 > -1 ) {
return $t_access_level;
} else {
return $t_access_level2;
}
}
# --------------------
?>
1 change: 1 addition & 0 deletions doc/ChangeLog
Expand Up @@ -10,6 +10,7 @@ Mantis
* Modified report page formating.
* Modified file size reports to show up as bytes.
* Modified email string padding and line separation characters.
* Modified account page to show default and current project access levels.
* Added Hungarian translation.
* Added g_bug_link_tag to let users customize how to create bug links.
* Added a "jump to bugnotes" quicklink at the top of the view bug pages.
Expand Down
3 changes: 2 additions & 1 deletion lang/strings_english.txt
Expand Up @@ -17,6 +17,7 @@
$s_login_anonymously = "Login Anonymously";
$s_jump_to_bugnotes = "Jump to Bugnotes";
$s_public_project_msg = "This project is PUBLIC. All users have access to this project.";
$s_access_level_project = "Project Access Level";

# ERROR strings
$MANTIS_ERROR[ERROR_SQL] = "ERROR: SQL error detected. Please report this to ";
Expand Down Expand Up @@ -107,7 +108,7 @@
$s_email = "Email";
$s_password = "Password";
$s_confirm_password = "Confirm Password";
$s_access_level = "Access Level";
$s_access_level = "Default Access Level";
$s_update_user_button = "Update User";

# account_prefs_page.php3
Expand Down

0 comments on commit 3290a8b

Please sign in to comment.