diff -Naurb mantis-0.18.2/core/access_api.php epia/core/access_api.php --- mantis-0.18.2/core/access_api.php 2004-02-12 00:16:28.000000000 +0100 +++ epia/core/access_api.php 2004-05-04 13:21:44.000000000 +0200 @@ -165,6 +165,23 @@ } # -------------------- + # Check if the user has any configured access level + # to manage something + function access_has_any_manage_level( ) { + $t_has_manage_custom_field_access = access_has_global_level( config_get( 'manage_custom_fields_threshold' ) ); + $t_has_manage_user_access = access_has_global_level( config_get( 'manage_user_threshold' ) ); + $t_has_manage_project_access = access_has_project_level( config_get( 'manage_project_threshold' ) ); + + if ( ($t_has_manage_custom_field_access || + $t_has_manage_user_access || + $t_has_manage_project_access) ) { + return true; + } + + return false; + } + + # -------------------- # Check the current user's access against the given value and return true # if the user's access is equal to or higher, false otherwise. # diff -Naurb mantis-0.18.2/core/html_api.php epia/core/html_api.php --- mantis-0.18.2/core/html_api.php 2004-02-29 11:07:44.000000000 +0100 +++ epia/core/html_api.php 2004-05-04 15:02:01.000000000 +0200 @@ -379,12 +393,8 @@ } # Manage Users (admins) or Manage Project (managers) - if ( access_has_project_level( config_get( 'manage_project_threshold' ) ) ) { - if ( access_has_project_level( ADMINISTRATOR ) ) { - $t_link = 'manage_user_page.php'; - } else { - $t_link = 'manage_proj_page.php'; - } + if ( access_has_any_manage_level( ) ) { + $t_link = 'manage_page.php'; $t_menu_options[] = "" . lang_get( 'manage_link' ) . ''; } @@ -459,10 +469,14 @@ # Print the menu for the manage section # $p_page specifies the current page name so it's link can be disabled function print_manage_menu( $p_page='' ) { - if ( !access_has_project_level( ADMINISTRATOR ) ) { + if ( !access_has_any_manage_level( ) ) { return; } + $t_has_manage_custom_field_access = access_has_global_level( config_get( 'manage_custom_fields_threshold' ) ); + $t_has_manage_user_access = access_has_global_level( config_get( 'manage_user_threshold' ) ); + $t_has_manage_project_access = access_has_project_level( config_get( 'manage_project_threshold' ) ); + $t_manage_user_page = 'manage_user_page.php'; $t_manage_project_menu_page = 'manage_proj_page.php'; $t_manage_custom_field_page = 'manage_custom_field_page.php'; @@ -476,10 +490,18 @@ } echo '
'; + if ( $t_has_manage_user_access ) { print_bracket_link( $t_manage_user_page, lang_get( 'manage_users_link' ) ); + } + if ( $t_has_manage_project_access ) { print_bracket_link( $t_manage_project_menu_page, lang_get( 'manage_projects_link' ) ); + } + if ( $t_has_manage_custom_field_access ) { print_bracket_link( $t_manage_custom_field_page, lang_get( 'manage_custom_field_link' ) ); + } + if ( $t_has_manage_project_access ) { print_bracket_link( $t_documentation_page, lang_get( 'documentation_link' ) ); + } echo '
'; } diff -Naurb mantis-0.18.2/manage_page.php epia/manage_page.php --- mantis-0.18.2/manage_page.php 1970-01-01 01:00:00.000000000 +0100 +++ epia/manage_page.php 2004-05-04 15:02:22.000000000 +0200 @@ -0,0 +1,29 @@ + + + + + + + + + + +
+ +