coppermine-gallery.com/forum

Support => Older/other versions => cpg1.3.x Support => Topic started by: clayaikenfancom on October 18, 2005, 03:13:12 PM

Title: Problems w/ preventing unregistered user viewing gallery...
Post by: clayaikenfancom on October 18, 2005, 03:13:12 PM
I just want to let you know that I have searched this forum for this mod and tried what I found and it didn't work. I am trying to make it so only registered users can view the full size pics. This is how I have my displayimage.php edited:

/**
if (!USER_ID) cpg_die(ERROR, 'You need to register to access this page', __FILE__, __LINE__);

* Local functions definition
*/

I log out and can still view everything full size. I also tried this mod:

edit
displayimage.php and index.php and search.php and thumbnails.php
and search for


require('include/init.inc.php');

and add after it

if (USER_ID){

} else {
{
   $redirect = $redirect . "login.php";
   header("Location: $redirect");

   exit();
        }
}



still not working. What am I doing wrong?
Title: Re: Problems w/ preventing unregistered user viewing gallery...
Post by: kegobeer on October 18, 2005, 03:48:37 PM
Try following the FAQ:

http://coppermine.sourceforge.net/faq.php#viewThumbnailsOnly
Title: Re: Problems w/ preventing unregistered user viewing gallery...
Post by: clayaikenfancom on October 18, 2005, 04:46:02 PM
I already tried that one. Posted above is the exact code I edited in displayimage.php. Here is is again:

/**
if (!USER_ID) cpg_die(ERROR, 'You need to register to access this page', __FILE__, __LINE__);

* Local functions definition
*/


it should work but yet it doesn't.
Title: Re: Problems w/ preventing unregistered user viewing gallery...
Post by: Nibbler on October 18, 2005, 06:36:20 PM
There is no chance that will work, you added the code in the wrong place


if (!USER_ID) cpg_die(ERROR, 'You need to register to access this page', __FILE__, __LINE__);
/**
* Local functions definition
*/
Title: Re: Problems w/ preventing unregistered user viewing gallery...
Post by: clayaikenfancom on October 18, 2005, 06:40:45 PM
I changed it and it still doesn't work!! I am logged out and everything. Ahhh. What else should I do?
Title: Re: Problems w/ preventing unregistered user viewing gallery...
Post by: clayaikenfancom on October 18, 2005, 07:07:17 PM
This is now what I have and it still doesnt work:

if (!USER_ID) cpg_die(ERROR, 'You need to register to access this page', __FILE__, __LINE__);
/**
* Local functions definition
*/
Title: Re: Problems w/ preventing unregistered user viewing gallery...
Post by: Stramm on October 19, 2005, 08:32:41 AM
in what file is this code?

you also can try http://forum.coppermine-gallery.net/index.php?topic=21332.0