Only registered users can view actual gallery pics, everyone else can view thumb Only registered users can view actual gallery pics, everyone else can view thumb
 

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

Only registered users can view actual gallery pics, everyone else can view thumb

Started by opulence, April 17, 2005, 10:09:29 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

opulence

Is there a way to make it so that only registered users can view the actual gallery pics, but everyone else can view thumbnails, searh, film strip, etc?

krkeegan

This is not in the design of coppermine. You could modify the display image page but it would require some php coding and it could still be curcumnavigated by someone who knew what they were doing.

Kevin
There are no stupid questions, only stupid people. -Mr. Mackey, South Park

opulence

I wouldn't mind if someone who knew what they were doing could access the pics.

I just want to give incentive for someone to actually register, while at least letting them be able to see thumbnails/etc as a tease...

krkeegan

Okay then you will need to modify the php code for the displayimage page to require the registered user group. Sorry I don't have any use for this on my site so I have not looked farther, but I think it should be pretty easy.

Kevin
There are no stupid questions, only stupid people. -Mr. Mackey, South Park

opulence

Does anyone know how I may edit displayimage.php in order to require the registered user group? :S

gaxxia

Edit displayimage.php and add

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

just before
/**************************************************************************
* Local functions definition
**************************************************************************/




kegobeer

The above post came directly from the FAQ.  Always good to check out the resources available.
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

opulence

Thanks for the help guys, but strangely, it didn't work

I did manage to previously find this in the FAQ:

"How can I prevent unregistered user from viewing the gallery?

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();
        }
}"

Which I only added to displayimage.php

I tried with that, didn't work, I tried seperately with the code listed above, didn't work, and I tried both of them together and it still didn't work.

(And yes, I remembered to be logged out each time!)

Joachim Müller