Access

iamwally

Joined: 2011-06-19
Posts: 9
Posted: Wed, 2011-06-22 14:41

Trying to figure out how to allow non registered members to be able to see main gallery page with the thumbnails representing the albums but that's it until they are registered. Should be easy I know but I am a newbie so please go easy on me!

Thanks,

John

 
Armani2

Joined: 2007-05-09
Posts: 263
Posted: Wed, 2011-06-22 20:53

As far as I know, via permissions you can only stop unregistered users from viewing full size, there is nothing to stop them from seeing the resize and just the thumb....

 
iamwally

Joined: 2011-06-19
Posts: 9
Posted: Thu, 2011-06-23 13:57

Thanks for the response. Maybe i need to phrase my question better. My main gallery page has albums for each year and then under that I have albums for each event that year. I would like for unregistered's to be able to see thumbnails for years and then thumbnails for events under each year but not be able to see the thumbnails for individual photos inside event albums. I was thinking maybe I could set permissions on photos that I wanted to use for thumbails and lock the rest down. Maybe that is not possible.

Thanks,

John

 
tempg

Joined: 2005-12-17
Posts: 1857
Posted: Thu, 2011-06-23 22:51

I thought there was a way to do this (maybe with a module) but I'm not sure and I don't have time to check right now.
The albumpassword description comes close and may work, but I've never used it or seen it in operation. Have you tried that?
http://codex.gallery2.org/Gallery3:Modules:albumpassword

You can also do it with htaccess, but it gets messy if you're not totally familiar with htaccess. You'd create an htaccess rule that requires the page visitor be a logged in user to access the page, and you'd have to have a page to redirect the user to if they attempt to view the page but aren't logged in (presumably a registration page).

 
iamwally

Joined: 2011-06-19
Posts: 9
Posted: Fri, 2011-06-24 12:56

I think you have stumbled onto the answer to my problem! The .htaccess thing sounds like exactly what I need! But I am thinking maybe there is a better way. I am no php programmer and very new to all this but maybe someone with php programming experience can tell me what I need to add to my theme code to be able to check for registration or not. Like an if<>then statement. If logged in then continue to albums. If not logged in take them to login/registration page. I would probably have to add the code to all album and photo pages to make sure no one could gain direct access but I am thinking this might work or would it be too cumbersome to add to all pages under the main page? Can this be done?

Thanks,

John

 
tempg

Joined: 2005-12-17
Posts: 1857
Posted: Fri, 2011-06-24 14:13

Again, I thought this was already possible somewhere. If not, it may have been mentioned in the Gallery roadmap somewhere; you may want to check to see before investing time into a custom solution.

iamwally wrote:
I am no php programmer and very new to all this

You don't need php to use the htaccess method (except for the design/functionality of the page the un-logged-in user is redirected to); it's all done in the htaccess--but you do have to have a firm handle on htaccess.

tempg wrote:
The albumpassword description comes close and may work, but I've never used it or seen it in operation. Have you tried that?
http://codex.gallery2.org/Gallery3:Modules:albumpassword

Have you tried this?
If it doesn't work alone, a more complicated solution is to combine this module with the htaccess idea. Logged-in users go straight to the album; users not logged in get the password prompt. (Note that you'll likely need htaccess and php for this one.)

 
iamwally

Joined: 2011-06-19
Posts: 9
Posted: Fri, 2011-06-24 14:31

I took a quick look at that module but it just seems to be a way to password protect an album. I do not want to have a password per album. i just want to have anyone who tries to go past the opening page of my gallery to need to be a logged in registered user. I don't think that is what that module does unless I am misinterpreting its description.

Thanks,

John

 
tempg

Joined: 2005-12-17
Posts: 1857
Posted: Fri, 2011-06-24 14:41

Yeah, but you can pass the password via the URL. Basically, you'd add an if-statement to the php file that generates the link to the album. If the user is logged in, the password would be supplied for them, transparent to the user; they won't even know there was a password. If they are not logged in, they'll be asked for a password.

 
iamwally

Joined: 2011-06-19
Posts: 9
Posted: Mon, 2011-06-27 15:17

I would like to try this idea and see if it works the way I want but not sure how to do it. Can you elaborate a litte.

Thanks,

John

 
tempg

Joined: 2005-12-17
Posts: 1857
Posted: Mon, 2011-06-27 20:29

I can't really elaborate on the php code right now.
You can check the module's thread for info on the URL you should use: http://gallery.menalto.com/node/98856