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: one small question..(refer when loggin in)  (Read 3230 times)

0 Members and 1 Guest are viewing this topic.

hooch

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 28
one small question..(refer when loggin in)
« on: September 30, 2004, 02:08:19 pm »

hello!
i recently installed coppermines photogallery and then I modyfied displayimage.php so that you have to be registerd to click on a thumbnail.
So when you click on a thumbnail it says "Your have to Log In!" and i have made the Log In to a link to login.php :)

but i would like it to refer to the page the user tried to access. so when he logs in he comes to that paga directly..
i´ve seen that the "real" login button has that script but i want it on my "own" link..

can anyone help me? i assume that i shold write? login.php?referer=$REFERER..but something is missing?

so can anyone help me? :D

thanks in advance! /Gustav
« Last Edit: October 01, 2004, 02:24:58 am by TranzNDance »
Logged

Nibbler

  • Guest
Re: one small question..(refer when loggin in)
« Reply #1 on: September 30, 2004, 02:18:59 pm »

Make sure $REFERER is available when you make the link, if you are inside a function you will need to global it. Posting a link and the code you have added/changed would be helpful.
Logged

hooch

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 28
Re: one small question..(refer when loggin in)
« Reply #2 on: September 30, 2004, 06:52:54 pm »

in displayimage.php i have this line:
Code: [Select]
if (!USER_ID) cpg_die(ERROR, 'You have to <a href="login.php">log in</a> to reach this page!<br>
If you not are<a href="register.php"> registrered</a> tet? Do it now!!', __FILE__, __LINE__);

and my question is how to do if i want them to come to the right picture that they clicked on when they have logged in/registerd..

thanks in advance
/Gustav
Logged

Nibbler

  • Guest
Re: one small question..(refer when loggin in)
« Reply #3 on: September 30, 2004, 07:11:35 pm »

Code: [Select]
if (!USER_ID) cpg_die(ERROR, "You have to <a href=\"login.php?referer=$REFERER\">log in</a> to reach this page!<br>
Not <a href=\"register.php\">registered</a> yet? Do it now!!", __FILE__, __LINE__);
Logged

hooch

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 28
Re: one small question..(refer when loggin in)
« Reply #4 on: October 01, 2004, 02:21:41 am »

worked very good!! ;D
thank you VERY much nibbler!
/Gustav
Logged
Pages: [1]   Go Up
 

Page created in 0.022 seconds with 20 queries.