Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

mantisbt set_project.php,1.53,1.54: msg#00086

bug-tracking.mantis.cvs

Subject: mantisbt set_project.php,1.53,1.54

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>
Google Custom Search

Recently Viewed:
qplus.devel/200...    network.jabber....    debian.qa-packa...    encryption.gpg....    python.dabo.dev...    uclinux.devel/2...    science.mathema...    recreation.pesc...    kernel.ck/2004-...    mozilla.devel.e...    tex.latex.prosp...    ietf.multi6/200...    bbc.cvs/2002-11...    xfree86.newbie/...    jakarta.taglibs...    altlinux.hardwa...    comedi/2002-05/...    horde.bugs/2004...    games.diplomacy...    finance.e-gold....    web.dom.test-su...    lang.ruby.rails...    os.netbsd.devel...    video.gstreamer...   
Home | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive 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

Navigation