How to redirect user after login How to redirect user after login
 

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

How to redirect user after login

Started by WBL, September 11, 2007, 06:29:35 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

WBL

How to automatically redirect the user to "My gallery" View [index.php?cat=10010] after login?

Searched the forum but couldnt find a thread which diverts me to the thumbnail view, but i woild like the logged in user to be redirected to his own Gallery

Thanks a lot

Sami

#1
Edit login.php and add this

        $referer = 'index.php?cat=1000'.$USER_DATA['user_id'];        //Mod redirect user to his/her own gallery

to line #39 after this

        $referer=preg_replace("'&'","&",$referer);


This will redirect logged in user to his/her own gallery

Edit : use Nibbler's code instead of this
‍I don't answer to PM with support question
Please post your issue to related board

WBL


Nibbler

Won't work for long. Should read as follows.


$referer = 'index.php?cat=' . (10000 + $USER_DATA['user_id']);        //Mod redirect user to his/her own gallery

Sami

I was sleepy :)
@Nibbler:Indeed you are correct , thanks for pointing that out

@ritson : Please use Nibbler's code cause there is an user_id limit with my code , it's only working with user_id < 10 and other users with user_id more than 9 will see the error message
‍I don't answer to PM with support question
Please post your issue to related board

WBL

Hi Thanks a lot for the support, I have corrected the code..