|
|
Choosing A Webhost: |
mantisbt set_project.php,1.53,1.54: msg#00086bug-tracking.mantis.cvs
Update of /cvsroot/mantisbt/mantisbt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31774 Modified Files: set_project.php Log Message: fix for 0002686: switch project often goes back to the main page Index: set_project.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/set_project.php,v retrieving revision 1.53 retrieving revision 1.54 diff -u -d -r1.53 -r1.54 --- set_project.php 22 Apr 2005 21:26:22 -0000 1.53 +++ set_project.php 24 Apr 2005 13:27:03 -0000 1.54 @@ -36,47 +36,37 @@ helper_set_current_project( $f_project_id ); - #@@@ we really need to make this more general... it is never intuitive - # to redirect to the main page as far as I can see. Is there a reason - # we can't just redirect back to the referrer in all cases? See - # issue #2686 about this... -jf - # redirect to 'same page' when switching projects. - # view_all_* pages, and summary + # for proxies that clear out HTTP_REFERER if ( !is_blank( $f_ref ) ) { $t_redirect_url = $f_ref; } else if ( !isset( $_SERVER['HTTP_REFERER'] ) || is_blank( $_SERVER['HTTP_REFERER'] ) ) { $t_redirect_url = config_get( 'default_home_page' ); - } else if ( eregi( 'view_all_bug_page.php', $_SERVER['HTTP_REFERER'] ) ){ - $t_source_filter_id = filter_db_get_project_current( $f_project_id ); - $t_redirect_url = 'view_all_set.php?type=4'; + } else { + $t_home_page = config_get( 'default_home_page' ); - if ( $t_source_filter_id != null ) { - $t_redirect_url = 'view_all_set.php?type=3&source_query_id=' . $t_source_filter_id; + # Check that referrer matches our address after squashing case (case insensitive compare) + $t_path = config_get( 'path' ); + if ( strtolower( $t_path ) == strtolower( substr( $_SERVER['HTTP_REFERER'], 0, strlen( $t_path ) ) ) ) { + $t_referrer_page = substr( $_SERVER['HTTP_REFERER'], strlen( $t_path ) ); + # if view_all_bug_page, pass on filter + if ( eregi( 'view_all_bug_page.php', $t_referrer_page ) ) { + $t_source_filter_id = filter_db_get_project_current( $f_project_id ); + $t_redirect_url = 'view_all_set.php?type=4'; + + if ( $t_source_filter_id !== null ) { + $t_redirect_url = 'view_all_set.php?type=3&source_query_id=' . $t_source_filter_id; + } + } else if ( eregi( '_page.php', $t_referrer_page ) ) { + # if any other page, return to that page + $t_redirect_url = $t_referrer_page; + } else { + $t_redirect_url = $t_home_page; + } + } else { + $t_redirect_url = $t_home_page; } - } else if ( eregi( 'changelog_page.php', $_SERVER['HTTP_REFERER'] ) ){ - $t_redirect_url = 'changelog_page.php'; - } else if ( eregi( 'summary_page.php', $_SERVER['HTTP_REFERER'] ) ){ - $t_redirect_url = 'summary_page.php'; - } else if ( eregi( 'proj_user_menu_page.php', $_SERVER['HTTP_REFERER'] ) ){ - $t_redirect_url = 'proj_user_menu_page.php'; - } else if ( eregi( 'manage_user_page.php', $_SERVER['HTTP_REFERER'] ) ){ - $t_redirect_url = 'manage_user_page.php'; - } else if ( eregi( 'bug_report_page.php', $_SERVER['HTTP_REFERER'] ) ){ - $t_redirect_url = 'bug_report_page.php'; - } else if ( eregi( 'bug_report_advanced_page.php', $_SERVER['HTTP_REFERER'] ) ){ - $t_redirect_url = 'bug_report_advanced_page.php'; - } else if ( eregi( 'summary_jpgraph_page.php', $_SERVER['HTTP_REFERER'] ) ){ - $t_redirect_url = 'summary_jpgraph_page.php'; - } else if ( eregi( 'view_filters_page.php', $_SERVER['HTTP_REFERER'] ) ){ - $t_redirect_url = 'view_filters_page.php'; - } else if ( eregi( 'my_view_page.php', $_SERVER['HTTP_REFERER'] ) ){ - $t_redirect_url = 'my_view_page.php'; - } else if ( eregi( 'main_page.php', $_SERVER['HTTP_REFERER'] ) ){ - $t_redirect_url = 'main_page.php'; - } else { - $t_redirect_url = config_get( 'default_home_page' ); } print_header_redirect( $t_redirect_url ); ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | mantisbt issues_rss.php,NONE,1.1 news_rss.php,1.4,1.5, Victor Boctor |
|---|---|
| Next by Date: | mantisbt/core filter_api.php,1.103,1.104, Glenn Henshaw |
| Previous by Thread: | mantisbt issues_rss.php,NONE,1.1 news_rss.php,1.4,1.5, Victor Boctor |
| Next by Thread: | mantisbt/core filter_api.php,1.103,1.104, Glenn Henshaw |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |