Advanced search  

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]

Pages: [1]   Go Down

Author Topic: How to redirect user after login  (Read 4595 times)

0 Members and 1 Guest are viewing this topic.

WBL

  • Coppermine newbie
  • Offline Offline
  • Posts: 18
How to redirect user after login
« on: September 11, 2007, 06:29:35 am »

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
« Last Edit: September 11, 2007, 07:39:02 am by Sami »
Logged

Sami

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 3686
  • BMossavari
    • My Project
Re: How to redirect user after login
« Reply #1 on: September 11, 2007, 06:53:13 am »

Edit login.php and add this
Code: [Select]
        $referer = 'index.php?cat=1000'.$USER_DATA['user_id'];        //Mod redirect user to his/her own gallery
to line #39 after this
Code: [Select]
        $referer=preg_replace("'&'","&",$referer);

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

Edit : use Nibbler's code instead of this
« Last Edit: September 11, 2007, 12:01:23 pm by Sami »
Logged
‍I don't answer to PM with support question
Please post your issue to related board

WBL

  • Coppermine newbie
  • Offline Offline
  • Posts: 18
Re: How to redirect user after login
« Reply #2 on: September 11, 2007, 07:10:43 am »

Thanks a lot , it worked
Logged

Nibbler

  • Guest
Re: How to redirect user after login
« Reply #3 on: September 11, 2007, 09:29:32 am »

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

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

Sami

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 3686
  • BMossavari
    • My Project
Re: How to redirect user after login
« Reply #4 on: September 11, 2007, 11:59:11 am »

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
Logged
‍I don't answer to PM with support question
Please post your issue to related board

WBL

  • Coppermine newbie
  • Offline Offline
  • Posts: 18
Re: How to redirect user after login
« Reply #5 on: September 12, 2007, 04:24:50 am »

Hi Thanks a lot for the support, I have corrected the code..
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 19 queries.