[Solved]: Link to password protected gallery [Solved]: Link to password protected gallery
 

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

[Solved]: Link to password protected gallery

Started by fidhleir, April 07, 2009, 01:22:38 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

fidhleir

I have a multi-user password protected gallery.  When I email a URL link to a photo or album, the recipient clicks the link and the login screen appears.  After they login, the gallery home page is displayed.  Is there any way to have Coppermine take them directly to the URL I sent after they've logged in?  As far as I can tell, after logging into the gallery they have to go back to the email and click the link again. 

I've searched the documentation and the forums and can't find anything about this.  Any help would be appreciated.

Nibbler

You should be able to do this quite easily. Look through the following files

./index.php
./displayimage.php
./search.php
./thumbnails.php

find this code near the start


if (!USER_ID && $CONFIG['allow_unlogged_access'] == 0) {
    $redirect = $redirect . "login.php";
    header("Location: $redirect");
    exit();
}


and change it like this:


if (!USER_ID && $CONFIG['allow_unlogged_access'] == 0) {
    $redirect = "login.php?referer=$REFERER";
    header("Location: $redirect");
    exit();
}

fidhleir

Very nice.  Thank you.  I'll give that a try.

fidhleir

That worked perfectly.  Thank you again.