Page 1 of 1

s2member does not protect page?

PostPosted: June 4th, 2011, 7:20 pm
by Margruss
Hello,

I am getting acquainted with s2Member, it is really a nice plugin. Because I am in the beginning of the learning curve, maybe I am missing something, but here you have:

1. I created 3 pages in my Wordpress website
2. I added those 3 pages using the Wordpress menu feature
3. 2 of those pages, are redirected to a subdomain which is protected by SSL
4. 1 of those pages is not redirected.

I configured s2Member to protect those three pages. I added the pages IDs to the respective field in s2Member, separated by a comma (142, 2045, 3084 - not the real IDs).

s2Member protects only the page that is not redirected. The two pages that are redirected, are not protected, they will redirect to the HTTPS subdomain.

I checked in each page, and the three are configured to be protected using their membership levels.

Is there any way to solve this?

Thank you in advance

Re: s2member does not protect page?

PostPosted: June 6th, 2011, 1:22 am
by Cristián Lávaque
What do you mean two are redirected? Do you use a plugin to forward from those pages to the subdomain?

Re: s2member does not protect page?

PostPosted: June 6th, 2011, 2:13 am
by Margruss
Hello Cristián,

Yes, I use a plugin to redirect to another page, in this case a HTTPS page. When there is no redirection, s2Member blocks access and takes the user to the register page. When there is redirection, s2Member does not blocks access. Is there any way to solve this? :-)

Thank you

Re: s2member does not protect page?

PostPosted: June 6th, 2011, 4:46 am
by Cristián Lávaque
Hmm... Then try redirecting the person with JavaScript instead of that plugin, that way if the person can't access the page he'll be sent to the Membership Options Page, but if he can access it the JavaScript will send him to where you want. Be sure to use the HTML editor instead of the Visual one.

Code: Select all
<script type="text/javascript">window.location = 'https://secure.yoursite.com/';</script>


I hope that helps. :)

Re: s2member does not protect page?

PostPosted: June 6th, 2011, 5:22 am
by Margruss
Thank you Cristián. Any hints on how to hardlink this javascript in my wordpress menu? I looked into the theme files, did not find where. Has this to be done in the wp config files instead of the theme files?

Re: s2member does not protect page?

PostPosted: June 6th, 2011, 5:26 am
by Harty
You may have to log out to see s2member working as expected.

Re: s2member does not protect page?

PostPosted: June 6th, 2011, 5:34 am
by Cristián Lávaque
Margruss wrote:Thank you Cristián. Any hints on how to hardlink this javascript in my wordpress menu? I looked into the theme files, did not find where. Has this to be done in the wp config files instead of the theme files?


You'd add this to the page using the WordPress editor.

And Harty's right, try this logged in and out to see the difference.

Re: s2member does not protect page?

PostPosted: June 6th, 2011, 7:55 am
by Margruss
Hi Harty, thank you, yes I am logged out when testing s2Member. Cristián, Wordpress 3.0 menu feature will not accept javascript links only http/s. My theme has js enabled because it has a slideshow working in it (Nivoslider). The theme header.php where it calls the menu is this one:

Code: Select all
<?php } ?>
</div><!-- /xs-header -->
   <div id="xs-primary-menu">
      <?php
      if ( function_exists('wp_nav_menu') ) {
         wp_nav_menu( array(
         'theme_location' => 'primary',
         'sort_column' => 'menu_order',
         'menu_class' => 'sf-menu'
         
         ));
      }
      ?>
   <div class="clear"></div>
   </div><!-- /xs-primary-menu -->
<div id="xs-container">


Where exactly I should insert the javascript hardlink code you provided me?

Thank you in advance :)

Re: s2member does not protect page?

PostPosted: June 6th, 2011, 7:57 am
by Margruss
Sorry, forgot to tell that I am using Google Analytics to track this redirection link, will this impeach s2Member from blocking access?

Re: s2member does not protect page?

PostPosted: June 6th, 2011, 1:45 pm
by Cristián Lávaque
The JavaScript I showed you is not a link and doesn't go in a link, it goes in the page's body, you know, the one you edit with WordPress with the edit form, but use the HTML editor, not the Visual one.

It's most likely that the Google Analytics code at the bottom of the page won't have a chance, so you could track with the redirection URL, add a variable or do something you can pick up in the target page, that will let you know when the redirection happened.