coppermine-gallery.com/forum

Support => Older/other versions => cpg1.2 Standalone Support => Topic started by: Forrest on December 19, 2003, 04:00:22 AM

Title: No access to guests
Post by: Forrest on December 19, 2003, 04:00:22 AM
I have a couple different user forums with multiple photo gallerys.  I don't want any one to have access to any of the photos in the coppermine website without using a login id.  

I know I could make the albums only visible by Registered Users, but my registered users probably won't setup their albums this way.  And I would hate to have to set every album to registered users only.

Another option I have considered is:  Using mod_auth_mysql (in apache) to require a user to login to the coppermine directory.  I could even point mod_auth_mysql to the coppermine user database, for a more centralized password database.

Have you seen anyone do this before?

Do you know of any other solution routes I could use?  The only thing I don't like about the above, is he user will have to login twice.  Once to get into the website, and then again to upload.....

Thanks for all the help!
Title: No access to guests
Post by: Casper on December 19, 2003, 08:56:37 AM
create an .htaccess file for the cpg albums directory (and all contained directories) which restricts access to the albums to logged on users. Then set config as here;

'Show first level album thumbnails in categories' = NO

'The content of the main page' = remove 'random' and 'last up'.

This should leave your cpg homepage  with the list of catagories and albums, but no thumbs.  And anyone not logged in will not be able to get to the albums.
Title: No access to guests
Post by: Joachim Müller on December 19, 2003, 09:43:26 AM
hm, this makes the script rely on .htaccess/webserver means of authentification, so the users will have to know an addidtional username and password.


I'd go for this option:
Title: No access to guests
Post by: Forrest on December 19, 2003, 03:37:35 PM
Thanks.

I think that I will just create a cron job to change all Albums to visibility "2".

There isn't a way to edit the PHP file to only allow "registered users view", and there not even be an option for "Everyone" is there?

Thanks again

Forrest
Title: No access to guests
Post by: Forrest on December 19, 2003, 04:12:30 PM
Just for any future people that may want the same thing, here's what I did:

vi copper_allprivate

#!/bin/sh
mysql -u root -pmypassword
use copperminedb
UPDATE cpg11d_albums SET visibility=2;
exit


Then added this to cron.daily.

I still would like to see if there is a way to prevent an album from becomeing "Everyone" access.

But this will work too.

Thanks!
Title: No access to guests
Post by: Joachim Müller on December 19, 2003, 05:34:34 PM
did you try what I was suggesting?
I can't see how a cron job should be used for this - most users who are webhosted don't have access to cron jobs at all, but if this works for you: fine...

GauGau
Title: No access to guests
Post by: Oasis on December 20, 2003, 02:11:26 PM
you don't need to use cron jobs..
just go to the cpg11d_albums table and run
UPDATE cpg11d_albums SET visibility=2
that will set all existing albums to registered only
then edit the table properties so that visibility defaults to 2 instead of zero
that will make all new albums registered only