Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Error message for displayimage.php when restrickting users ?  (Read 2386 times)

0 Members and 1 Guest are viewing this topic.

JohannM

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 252

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
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Error message for displayimage.php when restrickting users ?
« Reply #1 on: May 04, 2007, 06:48:44 am »

Something like
Code: [Select]
if (!USER_ID && $CONFIG['allow_unlogged_access'] == 0) {
    cpg_die('You need to be logged in to access this page.');
}
should do the trick.
Logged
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 20 queries.