coppermine-gallery.com/forum

Support => cpg1.3.x Support => Older/other versions => cpg1.3 (BBS) Integration / Bridging => Topic started by: lmurphy on June 02, 2005, 11:54:56 PM

Title: Redirect possible to page other than index.php after login using phpbb bridge?
Post by: lmurphy on June 02, 2005, 11:54:56 PM
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.
Title: Re: Redirect possible to page other than index.php after login using phpbb bridge?
Post by: Nibbler on June 03, 2005, 08:28:26 PM
That should be fine. You get the parameter in the url by using $_GET['redirect_url'] for example.