View Issue Details

IDProjectCategoryView StatusLast Update
0003948mantisbtbugtrackerpublic2004-08-29 02:15
Reporterhugopedersen Assigned Tovboctor  
PrioritynormalSeverityfeatureReproducibilityalways
Status closedResolutionfixed 
PlatformMantisOSAnyOS Version0.18.2
Fixed in Version0.19.0rc1 
Summary0003948: Will not jump to bug when following link in mail
Description

When a bug is reported a link to that is send to a user. If this user who is not logged on to Mantis, clicks the link Mantis shows the logon screen but after login it doesn't jump to the bug that was part of the link.

Steps To Reproduce

Be sure not to be logged on to Mantis
Click a link in a mail send to you by Mantis.
Logon to Mantis when asked
Check if Mantis jumps to the bug with the ID from the link

Additional Information

I am not allowing Anonymous login

TagsNo tags attached.
Attached Files
footer.txt (594 bytes)   
<body>

	<br>
	
	<table border="1" cellspacing="0" width="100%" bgcolor="#9c9cf7">
  	<tr>
    	<td>
    	</td>
   	</tr>
	</table>

	<table border="0" width="100%">

  	<tr>
			<td width="40%">
				<a target="_blank" href="http://www.jamo.com/consumer/products/products.php3?id=DVR+50">
					<IMG src="jamo/dvr_50.gif" align="left" border="0"> 
				</a>
			</td>

			<td width="10%">
			</td>

			<td width="40%">
				<a target="_blank" href="http://2f.jamo.com/">
					<IMG src="jamo/hdp4250.gif" align="right" border="0"> 
				</a>
			</td>
		</tr>
	</table>

footer.txt (594 bytes)   
header.txt (672 bytes)   
<body>
	<table border="0" width="100%">

  	<tr>
			<td width="40%">
				<a target="_blank" href="http://www.mantisbt.org/">
					<IMG src="jamo/mantislogo4.jpg" align="left" border="0"> 
				</a>
			</td>

			<td width="10%">
				<a target="_blank" href="http://www.php.net/">
					<IMG src="jamo/php.gif" align="center" border="0">
				</a>
			</td>

			<td width="40%">
				<a target="_blank" href="http://www.mysql.org/">
					<IMG src="jamo/mysql-logo.png" align="right" border="0">
				</a>
			</td>
		</tr>
	</table>

	<table border="1" cellspacing="0" width="100%" bgcolor="#9c9cf7">
  	<tr>
    	<td>
    	</td>
   	</tr>
	</table>
	
header.txt (672 bytes)   

Relationships

child of 0003987 closedvboctor Mantis 0.19.0 Release 

Activities

Jumar

Jumar

2004-06-17 11:05

reporter   ~0005718

which version are you using?
with 0.18.0 and 0.18.3 its working correctly.

I'm not allowing anonymous login too.

vboctor

vboctor

2004-06-17 19:50

manager   ~0005719

I think I fixed this some versions back. Try upgrading to 0.18.3.

hugopedersen

hugopedersen

2004-06-18 00:30

reporter   ~0005720

I have both 0.18.2 and 0.18.3 running and it is not working on either installations.
The installations are running on the same server, so the setup should not have any thing to say.

Jumar

Jumar

2004-06-18 05:20

reporter   ~0005721

hmmm...
that's strange.

on which side are you after clicking the link and logging in?

hugopedersen

hugopedersen

2004-06-18 05:25

reporter   ~0005722

When clicking the link I am promted for login and the returned to main_page.php

Jumar

Jumar

2004-06-18 05:33

reporter   ~0005724

Last edited: 2004-06-18 05:37

hmmmm....

sorry, i have no idea.

vboctor?

is your 0.18.0 / 0.18.3 a "new installed" version or an updated version?

i have both versions "new installed" without this problem.

bearbeitet am: 06-18-04 05:37

hugopedersen

hugopedersen

2004-06-18 06:18

reporter   ~0005725

Both 0.18.2 and 0.18.3 are clean installs - the only mods are the mailsetup, header and footer on pages and db setup in config

Jumar

Jumar

2004-06-18 06:21

reporter   ~0005726

Last edited: 2004-06-18 06:28

maybe you've changed something essential in the header.

can you post it?

in between i'll try to find out where this redirect is happening.
its the login_cookie_test.php i think...

bye the way: the user who tries to login, has access to the bug in the link?

bearbeitet am: 06-18-04 06:28

hugopedersen

hugopedersen

2004-06-18 06:33

reporter   ~0005727

The user is me, and I am administrator with access to everything I think.

I have uploaded the 2 files I use for header and footer - there are some images that I haven't uploaded

Jumar

Jumar

2004-06-18 06:41

reporter   ~0005728

Last edited: 2004-06-18 07:00

ok, your header / footer shouldn't be the problem, unless its not in the page ahead of the redirect.

i guess you need some help of vboctor...

the redirect to the bug-page is in the page login_cookie_test.php
over $f_return = gpc_get_string( 'return', 'main_page.php' ); (line 17)
this will give back the url.
try
print_r($f_return);
exit;

you should get something like /mantis/bug_view_page.php?bug_id=0000123
with the bug-id in the link.

did you try to switch on all debug-messages under "Debugging" in config_defaults_inc.php (especially $g_stop_on_errors=ON;)?

maybe you'll get a warning then.

bearbeitet am: 06-18-04 07:00

hugopedersen

hugopedersen

2004-06-21 00:19

reporter   ~0005742

When I try the
print_r($f_return);
exit;

I get main_page.php

hugopedersen

hugopedersen

2004-06-21 00:27

reporter   ~0005743

$g_stop_on_errors = ON;
SYSTEM NOTICE: Undefined index: REQUEST_URI

hugopedersen

hugopedersen

2004-06-21 00:33

reporter   ~0005744

Sorry - pushed the button to soon

$g_show_detailed_errors = ON
$g_show_notices = ON
$g_show_warnings = ON
$g_stop_on_errors = ON;
SYSTEM NOTICE: Undefined index: REQUEST_URI

Jumar

Jumar

2004-06-23 05:28

reporter   ~0005767

hmm... i'm nearly out of ideas...

vboctor???

one last thing to check:

when you type in an url like http://your-domain/bug_view_page.php?bug_id=0003948
in the browser-address, hit enter then you're redirected to the login_page and the url should be like this
http://your-domain/login_page.php?return=%2Fmantis%2Fbug_view_page.php%3Fbug_id%3D0003948

is this the url you get?

hugopedersen

hugopedersen

2004-06-23 05:43

reporter   ~0005769

The URL that I get is http://your-domain/login_page.php?return=

Jumar

Jumar

2004-06-23 05:48

reporter   ~0005770

Last edited: 2004-06-23 05:48

so thats the problem!

which browser are you using?

bearbeitet am: 06-23-04 05:48

hugopedersen

hugopedersen

2004-06-23 05:54

reporter   ~0005771

Mozilla FireFox 0.8.0+
Internet Explorer 6.0.2800.1106

Jumar

Jumar

2004-06-23 06:06

reporter   ~0005772

Last edited: 2004-06-23 06:13

do you have the problem in both browsers?

if yes...

open core/access_api.php
got to line 34:
$p_return_page = string_url( $_SERVER['REQUEST_URI'] );

place afterwards
echo "p_return_page: $p_return_page - ";
echo "REQUEST_URI: ".$_SERVER['REQUEST_URI'];
exit;

and tell me if you get an output and paste it here (when opening url like http://your-domain/bug_view_page.php?bug_id=0000123).

should be something like
p_return_page: %2Fmantis%2Fbug_view_page.php%3Fbug_id%3D0000123 - REQUEST_URI: /mantis/bug_view_page.php?bug_id=0000123

bearbeitet am: 06-23-04 06:13

hugopedersen

hugopedersen

2004-06-23 06:26

reporter   ~0005773

The only output I get is

p_return_page:

hugopedersen

hugopedersen

2004-06-23 06:27

reporter   ~0005774

And the problem is in both browsers

Jumar

Jumar

2004-06-23 06:29

reporter   ~0005775

i've edited my note..
please put all 3 lines in your code and paste the output.

hugopedersen

hugopedersen

2004-06-23 06:31

reporter   ~0005776

p_return_page: - REQUEST_URI:

Jumar

Jumar

2004-06-23 06:34

reporter   ~0005777

so.. i guess its not a mantis.. but a server problem...

$_SERVER['REQUEST_URI'] is a server variable...

please ask vboctor for more details.. my knowledge isn't enough... i think.

Jumar

Jumar

2004-06-23 06:37

reporter   ~0005778

Erinnerung gesendet an vboctor

Hi!

The server-variable $_SERVER['REQUEST_URI'] is empty...
So I guess he may have a server problem.
Can you help him?
My knowledge ends here.

Bye,
Jumar

vboctor

vboctor

2004-06-23 06:42

manager   ~0005781

What version of PHP are you using?

hugopedersen

hugopedersen

2004-06-23 06:55

reporter   ~0005783

PHP 4.3.4
MySQL 3.23.38
IIS on Windows 2000 server

hugopedersen

hugopedersen

2004-07-19 04:06

reporter   ~0006132

The issue is still alive after I installed version 0.19.0a2 so it might be a server problem, but what?

Any one with any ideas

hugopedersen

hugopedersen

2004-07-21 06:17

reporter   ~0006206

grangeway> I can see you added a relationship, but I can't get access to it.

grangeway

grangeway

2004-07-27 05:34

reporter   ~0006384

Question:

Does changing the 2-3 references in access_api, authentication_api of:
$_SERVER['REQUEST_URI']
To read:
$_SERVER['PHP_SELF']

Have any effect for you ?

hugopedersen

hugopedersen

2004-07-27 06:42

reporter   ~0006386

Yes it results in:

APPLICATION ERROR #200
A required parameter to this page was not found.

grangeway

grangeway

2004-07-27 07:37

reporter   ~0006387

in which case, try adding one of following before the REQUEST_URI lines. I'd be interested in whether both/neither work.

if (!isset($_SERVER['REQUEST_URI'])) {
$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'].'?'.$_SERVER['QUERY_STRING'];
}

if (!isset($_SERVER['REQUEST_URI'])) {
$_SERVER['REQUEST_URI'] = $_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING'];
}

hugopedersen

hugopedersen

2004-07-27 07:45

reporter   ~0006389

if (!isset($_SERVER['REQUEST_URI'])) {
$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'].'?'.$_SERVER['QUERY_STRING'];
}
gives an URL like
http://hqsm2/bug_test/login_page.php?return=%2Fbug_test%2Fbug_view_advanced_page.php%3Fbug_id%3D0000097

when inserted in access_api, authentication_api and when pressing the link in my mail I am redirected to the login picture and when logged in I am returned to the correct bug / issue

I haven't tried the second yet - should I do so ?

hugopedersen

hugopedersen

2004-07-27 07:48

reporter   ~0006390

The code in authentication_api
} else { # not logged in
if (!isset($_SERVER['REQUEST_URI'])) {
$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'].'?'.$_SERVER['QUERY_STRING'];
}
if ( is_blank( $p_return_page ) && isset( $_SERVER['REQUEST_URI'] ) ) {
$p_return_page = $_SERVER['REQUEST_URI'];
}
$p_return_page = string_url( $p_return_page );
print_header_redirect( 'login_page.php?return=' . $p_return_page );
}

grangeway

grangeway

2004-07-27 08:04

reporter   ~0006391

ok, so that code solves the issuefor you?

Both $_SERVER['PHP_SELF'] and SCRIPT_NAME as far as i know should return the same value - i'd be interested in you confirming that this is the case as i think i'd rather check for $_SERVER['PHP_SELF'] then SCRIPT_NAME

If that does fix the issue, i'll check something into CVS for 0.19

Paul

grangeway

grangeway

2004-07-27 09:22

reporter   ~0006394

The fix for this issue should be in 0.19.0rc1 when it's released.

hugopedersen

hugopedersen

2004-07-28 00:03

reporter   ~0006406

Has to add note for Paul

hugopedersen

hugopedersen

2004-07-28 00:07

reporter   ~0006407

Just tested the second code snippet and the result is the same - it works. If that is the one you like the most, then I will leave this in my setup.

Had to reopen the bug to be able to add this comment! I think some people would like that the participant in an issue (and only those) could add notes even after the bug was resolved/closed - I know that I would.

grangeway

grangeway

2004-07-30 08:24

reporter   ~0006476

thanks