Skip to content

Commit

Permalink
Revert 738272f and reimplement hide graph link
Browse files Browse the repository at this point in the history
commit 738272f to hide Mantisgraph link
introduced a regression: failing at login when anonymous login is
disabled.

Here that change is reverted and the access level check is now placed in
the callback function, instead of the hook initialization

Fixes #20217

Signed-off-by: Damien Regad <dregad@mantisbt.org>
  • Loading branch information
cproensa authored and dregad committed Oct 30, 2015
1 parent b954cc5 commit 2c0b2a5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions plugins/MantisGraph/MantisGraph.php
Expand Up @@ -87,10 +87,8 @@ function hooks() {
$t_hooks = array(
'EVENT_MENU_SUMMARY' => 'summary_menu',
'EVENT_SUBMENU_SUMMARY' => 'summary_submenu',
'EVENT_MENU_FILTER' => 'graph_filter_menu'
);
if( access_has_project_level( config_get( 'view_summary_threshold' ) ) ) {
$t_hooks['EVENT_MENU_FILTER'] = 'graph_filter_menu';
}
return $t_hooks;
}

Expand All @@ -107,7 +105,11 @@ function summary_menu() {
* @return array
*/
function graph_filter_menu() {
return array( '<a href="' . plugin_page( 'bug_graph_page.php' ) . '">' . plugin_lang_get( 'graph_bug_page_link' ) . '</a>', );
if( access_has_project_level( config_get( 'view_summary_threshold' ) ) ) {
return array( '<a href="' . plugin_page( 'bug_graph_page.php' ) . '">' . plugin_lang_get( 'graph_bug_page_link' ) . '</a>', );
} else {
return '';
}
}

/**
Expand Down

0 comments on commit 2c0b2a5

Please sign in to comment.