latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Password protection for Membership Options

Home Forums Community Forum Password protection for Membership Options

This topic contains 10 replies, has 3 voices. Last updated by  Bruce 4 years, 1 month ago.

Topic Author Topic
Posted: Thursday Dec 6th, 2012 at 8:14 am #33694
Ayurveda
Username: panchakarma

Hi Guys,
Our site is a for Ayurvedic Practitioners and we need to pre-approve members and validate their documentation before they can be allowed to access the membership options. It doesn’t need to be high security, just a generic key which we will send out with the link to the membership options page (which we would need not to be public). How could we set this up please?

List Of Topic Replies

Viewing 10 replies - 1 through 10 (of 10 total)
Author Replies
Author Replies
Posted: Thursday Dec 6th, 2012 at 8:33 am #33701
Ayurveda
Username: panchakarma

For clarity, if I password protect the page will this mess with the S2 requirement that the options page must always be public. Might it cause a conflict?

Posted: Thursday Dec 6th, 2012 at 2:16 pm #33727
Bruce
Username: Bruce
Staff Member

Hi Ayurveda,

For clarity, if I password protect the page will this mess with the S2 requirement that the options page must always be public. Might it cause a conflict?

Yes, this may cause conflicts for the page. Instead of using default WordPress functionality for this, you can set up an if() statement for this. Download and install a PHP Execution plugin on your site, and put something like this at the top of your page:

<?php
if($_REQUEST&#91;'s2hack_access_page'&#93; !== 'xxxyyyzzz') { ?>
	You do not have access to this page.
<?php } else { ?>
	They have access to the page. Put content here
<?php } ?>

With this, you can send users to

http://yoursite.com/my-membership-options-page/?s2hack_access_page=xxxyyyzzz

This will allow users to then sign up.

Posted: Thursday Dec 6th, 2012 at 5:16 pm #33790
Ayurveda
Username: panchakarma

Great, thanks Bruce.

Posted: Thursday Dec 6th, 2012 at 6:53 pm #33812
Ayurveda
Username: panchakarma

Hi Bruce,
I’ve tried this with a few of the php plugins but I can’t get the code to function with the link. The page remains blank and the text ‘You do not have access to this page.’ does not appear and when I use the link :

http://yoursite.com/my-membership-options-page/?s2hack_access_page=xxxyyyzzz

it refreshes as :

http://yoursite.com/my-membership-options-page?s2hack_access_page=xxxyyyzzz

but the page remains blank. Any ideas what may be going wrong?

Thank you.

Posted: Thursday Dec 6th, 2012 at 6:55 pm #33813
Ayurveda
Username: panchakarma

For clarity, I am inserting my site prefix and page name into the url.

Posted: Friday Dec 7th, 2012 at 7:40 am #33867

Could you try this?

[hilite pre_code]

You do not have access to this page.

They have access to the page. Put content here

[/hilite]
Posted: Friday Dec 7th, 2012 at 6:10 pm #33938
Ayurveda
Username: panchakarma

Hi Cristian,
With this I can see the text:

“They have access to the page. Put content here”

But I see it without using the password.

Posted: Saturday Dec 8th, 2012 at 5:35 am #33975
Ayurveda
Username: panchakarma

*UPDATE*

The fault was my end guys. It was plugin related. For anyone facing this requirement and issue, try:

php-execution

plugin from the wordpress.org repository. Although it came with a warning that it hadn’t been updated for 2 years and may not work with the current version of wordpress, it is the only one that has worked correctly. I guess it was just well coded in the first place!

I used the original code supplied to me by Bruce and the token/key url is now functioning perfectly.

Thanks.

Posted: Saturday Dec 8th, 2012 at 6:33 am #33980
Ayurveda
Username: panchakarma

Yep, works like a dream.

  • This reply was modified 4 years, 1 month ago by  Ayurveda.
Posted: Saturday Dec 8th, 2012 at 2:26 pm #34003
Bruce
Username: Bruce
Staff Member

Glad to hear you got this resolved.

Viewing 10 replies - 1 through 10 (of 10 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.