forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: fidhleir on April 07, 2009, 01:22:38 am

Title: [Solved]: Link to password protected gallery
Post by: fidhleir on April 07, 2009, 01:22:38 am
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.
Title: Re: Link to password protected gallery
Post by: Nibbler on April 07, 2009, 01:41:14 am
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

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

and change it like this:

Code: [Select]
if (!USER_ID && $CONFIG['allow_unlogged_access'] == 0) {
    $redirect = "login.php?referer=$REFERER";
    header("Location: $redirect");
    exit();
}
Title: Re: Link to password protected gallery
Post by: fidhleir on April 07, 2009, 01:59:44 am
Very nice.  Thank you.  I'll give that a try.
Title: Re: Link to password protected gallery
Post by: fidhleir on April 07, 2009, 04:51:00 pm
That worked perfectly.  Thank you again.