PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

NextGEN Gallery and s2Member

s2Member Plugin. A Membership plugin for WordPress®.

NextGEN Gallery and s2Member

Postby DominicWasserzug » November 12th, 2011, 8:48 pm

I am trying to use s2Member to protect the directory where all of my NextGEN galleries are located.

This is what I understand thus far:

1. s2Member has a directory called 's2Member-files' that already has an .htaccess file that will only allow logged-in users to access the files through the URI restrictions.

2. This directory requires that you use a special link that goes through s2Member because only s2Member has access to those files.

This is the problem:

I already have NextGEN galleries in another folder that are not being protected. If I use the .htaccess language that is already available in the 's2Member-files' directory in the folder with my images it will not work because NextGEN will always point to the actual file location instead of the s2member? location.

The question is this:

Is it possible to tell NextGEN to dynamically trim the file folders from the url, except for the file name, and include the required s2member? syntax?

OR

Is it possible to have an .htaccess for URI restrictions that works the opposite way.

Ex. I access /s2Member-files/protected_file.zip (The real location).

.htaccess says, okay hold on let me check with s2Member to make sure that you have access to this file

Have s2member respond to the .htaccess file with 'yes' or 'no'

It seems that it would be optimal if the .htaccess file worked this way. If so, then we would not have to modify every other plugin to conform to the s2member linking structure.

I am not even sure if it is possible for an .htaccess file to do this. I am a novice developer. I know enough to get me into trouble and not enough to get me out. ; )

Thank you in advance for your response Jason.
User avatar
DominicWasserzug
Registered User
Registered User
 
Posts: 4
Joined: July 28, 2011

Re: NextGEN Gallery and s2Member

Postby Cristián Lávaque » November 15th, 2011, 12:23 am

Hi Dominic.

You can change the directory s2Member protects using this hack: viewtopic.php?f=4&t=2719#p8017

See if protecting the directory that the gallery uses does the trick and let me know, please.

I hope that helps. :)
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: NextGEN Gallery and s2Member

Postby DominicWasserzug » November 15th, 2011, 5:14 pm

I thought up a temporary fix/solution. Having the .htaccess file check to see if the user is logged in.

("For other users:

1. open notepad
2. copy and paste this code (user beware)
3. save file as .htaccess
4. upload to the directory with files that non-users should not download.)

Options -Indexes
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_COOKIE} !^.*wordpress_logged_in_.*$ [NC]
RewriteRule .* http://www.google.com/ [NC,L]

If a user is logged into wordpress they will have unfettered access to the files in the directory where this .htaccess file is located, including sub-directories. If the user is not logged into wordpress then they get sent to Google.com. ; )

This would also be useful for users that want to prevent Google from indexing their protected content. I noticed in another post you mentioned "filetype" searches presenting problems to some users. This should be helpful there.
User avatar
DominicWasserzug
Registered User
Registered User
 
Posts: 4
Joined: July 28, 2011


Return to s2Member Plugin

Who is online

Users browsing this forum: No registered users and 3 guests

cron