coppermine-gallery.com/forum

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Permissions & Access Rights => Topic started by: marky on July 06, 2004, 02:39:56 AM

Title: how to allow anonymous to see catagories/albums but do not grant access? SOLVED
Post by: marky on July 06, 2004, 02:39:56 AM
I looked around for similar post...but couldn't find anything via search, etc.  I would like to allow anonymous users to see catagories or albums but when they try to click on them to enter...they get directed to a "you need to register to view this" page or to the login page.

The only setting I can see is under album management and is the "Album can be viewed by "Members of the 'Registered' group", which doesn't allow unregistered users to even see that the album exists.

Updated: ok, i figured out the option to yes in "Show private album Icon to unlogged user" thnx...
Title: Re: how to allow anonymous to see catagories/albums but do not grant access? SOL
Post by: jamurillo on September 06, 2004, 12:33:30 AM
I get it doing this in cpg1.3.2. :

1- Open thumbnails.php
find;
Code:
require('include/init.inc.php');


Add after;
Code:
if (USER_ID){

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

   exit();
}}

2- In  the " Configuration " :
The content of the main page : breadcrumb/anycontent/alblist
Nothing else, so unlogged users can not go in through the thumbnails.

You can see it at www.jamurillo.com/stock
Title: Re: how to allow anonymous to see catagories/albums but do not grant access? SOLVED
Post by: Casper on September 06, 2004, 01:16:25 AM
You should always have catlist in the list of contents of mainpage.

You should also put the if/else switch in displayimage.php.
Title: Re: how to allow anonymous to see catagories/albums but do not grant access? SOL
Post by: jamurillo on September 06, 2004, 01:28:49 AM
Thanks Casper !

What do you means by :

You should also put the if/else switch in displayimage.php.  ???

Explain us, please !
Title: Re: how to allow anonymous to see catagories/albums but do not grant access? SOLVED
Post by: Casper on September 06, 2004, 12:54:37 PM
You just need to do the same thing in displayimage.php as you did in thumbnails.php.

This is explained in this mod, http://forum.coppermine-gallery.net/index.php?topic=3503.msg15506#msg15506, which makes all users log in.  For what you want, do this mod, but not to the index.php.

Then all visitors will see the cats and sub cats, but not be able to go into the albums and see the pics.  You will still be able to show random and lastup thumbs on the front page.
Title: Re: how to allow anonymous to see catagories/albums but do not grant access? SOL
Post by: irishblue on January 02, 2005, 04:20:46 PM
do you mean to paste the same code in thumbnails.php into displayimage.php?
*edit: got it to work. Thanks! :)
Title: Re: how to allow anonymous to see catagories/albums but do not grant access? SOL
Post by: fourhour on February 25, 2005, 05:53:00 PM
I tried this and you do not need to put the extra code into the thumbnails.php. If you do, when someone logs on they will see "User already logged on". Just put the code in the displayimage.php and you'll get the desired result. ;D
Title: Re: how to allow anonymous to see catagories/albums but do not grant access? SOLVED
Post by: blackhat on March 07, 2005, 11:27:51 PM
I'm trying this hack but cant get it to work
http://coppermine.sourceforge.net/faq.php?q=registeredUsersOnly#registeredUsersOnly

I get this error message if I'm logged out and trying to access the gallery url:
Quote
gallery.librarium-online.comhttp could not be found. Please check the name and try again.
I tried accessing the gallery without using the subdomain, but got the same error message. I'm also using the latest version of coppermine..

Thanks