coppermine-gallery.com/forum

Support => Older/other versions => cpg1.2 Standalone Support => Topic started by: allabout on November 07, 2003, 07:44:50 PM

Title: [Solved]: Hide albums from Anonymous Users
Post by: allabout on November 07, 2003, 07:44:50 PM
First post here, first of all I just want to thank the developers for this great free photo gallery.
I hope this isn't asking too much, but I was wondering if there is a feature to hide the albums from anonymous users. and just show the log in and register option on the main page?
I wanted to only give access to the albums for friends and family.
Thank you all for any replies.
Title: [Solved]: Hide albums from Anonymous Users
Post by: hyperion on November 08, 2003, 02:51:00 AM
One way to preserve your privacy would be to create a .htaccess file for the entire Coppermine directory.  Give your friends and family the username and password, and then they would be allowed to see CPG index page.

This method is like using a sledgehammer. It's overkill, but it's effective.  :)

The other methods require tinkering with Coppermine's code in index.php, login.php, and theme.php, and those who were really determined to could still access your photos.

However, if you are looking for a mini-blind of sorts, you could try heavy editing of the index.php and theme.php pages.
Title: [Solved]: Hide albums from Anonymous Users
Post by: Bruz on February 23, 2004, 02:01:46 PM
Its much easier:

Just open index.php and find:

/**
 * Local functions definition
 */


before, add:

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

Thats it.
Title: [Solved]: Hide albums from Anonymous Users
Post by: Bruz on February 24, 2004, 08:12:14 PM
I have some problems with my own posting above :D

I'm using the phpbb integration and the code in the index.php which I postet above.
Some of my logged-in users still get the "'You need to register to access this page'"-message..deleting the cookies, re-login - nothing seems to help.
How can I change if (!USER_ID) cpg_die(ERROR, 'You need to register to access this page', __FILE__, __LINE__); to solve this problem?

Thx!
Title: [Solved]: Hide albums from Anonymous Users
Post by: Casper on February 24, 2004, 08:42:33 PM
Try the solution in this thread, which directs all unlogged users to the login page, where they can login, or register if you allow it.
If not, then no-one else but your users will be able to see your main page.  That is what you want I think.

http://forum.coppermine-gallery.net/index.php?topic=3503
Title: [Solved]: Hide albums from Anonymous Users
Post by: Bruz on February 24, 2004, 08:50:54 PM
Yea, thats it!

Thank you a lot casper (again!!)