Redirect possible to page other than index.php after login using phpbb bridge? Redirect possible to page other than index.php after login using phpbb bridge?
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Redirect possible to page other than index.php after login using phpbb bridge?

Started by lmurphy, June 02, 2005, 11:54:56 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

lmurphy

Hello -

I have cpg 1.3.3 and phpbb 2.0.14 installed.  Using the phpbb bridge.  Everything with the bridge works fine. In addition, I have made the modifications to cpg as listed in the FAQ question "How can I prevent unregistered user from viewing the gallery?" so that only registered users can access the gallery.  Works as advertised.

I have been looking into providing an RSS feed of the recent additions to the gallery.  My problem is this.  In the feed contents there will be a link such as - http://www.mydomain.com/coppermine/displayimage.php?album=9&pos=0.  This will bring the user to the phpbb login screen.  After login the user is taken to the index page of cpg and not the display image page.  I understand that this is coming from cpg_redir.php.

So I was hoping you could tell me whether what I am considering is technically possible.  After poking around in the code I was wondering if I could do something like this -

1) append to the displayimage url a name value pair like &some_token=some_value.
2) in phpbb.inc.php in the function udb_login_page() parse the QUERY_STRING and if some_token=somevalue then instead of udb_redirect(LOGIN_REDIR) call udb_redirect(SPECIAL_LOGIN_REDIR) which would be login.php?redirect=cpg_specialredir.php&redirect_url=displayimageurl.
3) add cpg_specialredir.php to the phpbb root directory and then parse in that file the redirect_url and send it to that instead of the index page

I realize that I could use the same cpg_redir.php but for illustration purposes I was just trying to break out the code into its separate pieces.

Is this possible or am I missing a "gotcha" with regards to phpBB login processing, etc.

Thanks in advance.

Nibbler

That should be fine. You get the parameter in the url by using $_GET['redirect_url'] for example.