Error message for displayimage.php when restrickting users ? Error message for displayimage.php when restrickting users ?
 

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

Error message for displayimage.php when restrickting users ?

Started by JohannM, May 04, 2007, 03:18:09 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

JohannM

Hi there

I'm still stupid in php, but when you Enable (tick) "Allow unlogged users (guest or anonymous) access", this script below prevent the visitors to view or go to the intermediate (displayimage.php) page.

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


QUESTION:

How do I add an error page that will redirect them from the thumbnail page to an "Error message: saying they need to be registered in
order to view photo's, and then again redirecting them to the login page ?

Please help

Thanx

Joachim Müller

Something likeif (!USER_ID && $CONFIG['allow_unlogged_access'] == 0) {
    cpg_die('You need to be logged in to access this page.');
}
should do the trick.