Page 1 of 1

project_id support for login.php

Posted: 19 Jan 2019, 19:32
by truefriend-cz
Hi. How i can add support to login.php for this urls?

http://domain.abc/login.php?username=an ... oject_id=9

Thanks

Re: project_id support for login.php

Posted: 20 Jan 2019, 09:53
by cas
an anonymous user does not need to login so you can use something like:
https://domain.abc/view_all_bug_page.php?project_id=1

Re: project_id support for login.php

Posted: 20 Jan 2019, 22:12
by truefriend-cz
cas wrote: 20 Jan 2019, 09:53 an anonymous user does not need to login so you can use something like:
https://domain.abc/view_all_bug_page.php?project_id=1
Yes i know but this solution have a problem: https://www.mantisbt.org/bugs/view.php?id=25184
And the fix in the next release is not scheduled: https://www.mantisbt.org/bugs/roadmap_p ... ion_id=339
so solving the problem it will take a while so I"m looking for a way to solve it from my side.

EDIT:

I replaced in login.php text:

Code: Select all

print_header_redirect( $t_redirect_url );
to:

Code: Select all

if( isset( $_GET['project_id'] ) ) {
	if( $_GET['action'] == "add" ) {
		print_header_redirect( 'bug_report_page.php?project_id=' . $_GET['project_id'] );
	} elseif ( $_GET['action'] == "view" ) {
		print_header_redirect( 'view_all_bug_page.php?project_id=' . $_GET['project_id'] );
	} else {
		print_header_redirect( 'view_all_bug_page.php?project_id=' . $_GET['project_id'] );
	}
} else {
	print_header_redirect( $t_redirect_url );
}
And supported these URL formats:

Code: Select all

https://domain.abc/login.php?username=anonymous&perm_login=false&action=add&project_id=1
https://domain.abc/login.php?username=anonymous&perm_login=false&action=view&project_id=1
https://domain.abc/login.php?username=anonymous&perm_login=false&project_id=1
anonymous in config_inc.php must disabled and anonymous user must have empty password.

Please moderators moving this thread to Customizations section.