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™

Restrict Access But Only For A Few Days...

s2Member Plugin. A Membership plugin for WordPress®.

Restrict Access But Only For A Few Days...

Postby godrob » October 5th, 2011, 6:04 am

Hi Cristian, Jason

Is there a way in S2Member/Pro to restrict access to a specific URI (I'm using BuddyPress here) but only for a small period of time?

Here's what I'm trying to achieve...

Unfortunately, I'm getting quite a few scammers creating profiles on my site (I'm using a free 14 day trial pro form at level 1) and then instantly spamming my members by sending spam messages.

So, what I would like to do is restrict access to the messaging functionality within BuddyPress but just for a few days. This would give our Site Admins the chance to verify if the their profile is legitimate of not without them being able to spam our members.

Any help appreciated?

Thanks
Rob
User avatar
godrob
Registered User
Registered User
 
Posts: 33
Joined: August 26, 2011

Re: Restrict Access But Only For A Few Days...

Postby Eduan » October 5th, 2011, 7:52 am

Well you could restrict the URI and then after 14 days unblock it again.
Now officially accepting Professional s2Member installations along with Bruce C (a.k.a. Ace).

If you're interested in a Professional s2Member Installation, or a Custom Coding Job, you can send your request here.
User avatar
Eduan
Experienced User
Experienced User
 
Posts: 1154
Joined: August 27, 2011
Location: Taxco de Alarcón, Guerrero, México.

Re: Restrict Access But Only For A Few Days...

Postby godrob » October 5th, 2011, 9:41 am

Thanks for your reply.

Yes, I could, but then that would mean no members would have access to messaging, which is not what I want to achieve.

Any other ideas apart from creating a new level?

Rob.
User avatar
godrob
Registered User
Registered User
 
Posts: 33
Joined: August 26, 2011

Re: Restrict Access But Only For A Few Days...

Postby Eduan » October 5th, 2011, 9:45 am

Oh so you want to restrict access only to the spammers?
Now officially accepting Professional s2Member installations along with Bruce C (a.k.a. Ace).

If you're interested in a Professional s2Member Installation, or a Custom Coding Job, you can send your request here.
User avatar
Eduan
Experienced User
Experienced User
 
Posts: 1154
Joined: August 27, 2011
Location: Taxco de Alarcón, Guerrero, México.

Re: Restrict Access But Only For A Few Days...

Postby godrob » October 5th, 2011, 10:03 am

That's right.

I only want to disable the messaging function for very limited time

Rob.
User avatar
godrob
Registered User
Registered User
 
Posts: 33
Joined: August 26, 2011

Re: Restrict Access But Only For A Few Days...

Postby Eduan » October 5th, 2011, 10:06 am

Well you could identify the spammers and restrict their access by lowering their level only for a few days until you find the culprit.
Now officially accepting Professional s2Member installations along with Bruce C (a.k.a. Ace).

If you're interested in a Professional s2Member Installation, or a Custom Coding Job, you can send your request here.
User avatar
Eduan
Experienced User
Experienced User
 
Posts: 1154
Joined: August 27, 2011
Location: Taxco de Alarcón, Guerrero, México.

Re: Restrict Access But Only For A Few Days...

Postby Cristián Lávaque » October 6th, 2011, 2:43 am

You could try something like this:

Create the dir and file /wp-content/mu-plugins/s2hacks.php
Code: Select all
<?php

add_action
('ws_plugin__s2member_before_check_ruri_level_access', 'add_my_uri_restriction');
function add_my_uri_restriction($vars) {
    if (S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS < 15)
        $GLOBALS['WS_PLUGIN__']['s2member']['o']['level1_ruris'] = 'messages';
}

?>


viewtopic.php?f=40&t=13059&src_doc_v=111003#src_doc_line_38

I haven't tested this at all, but I hope it gets you closer to what you want. :)
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: Restrict Access But Only For A Few Days...

Postby godrob » October 6th, 2011, 6:58 am

Great, thanks Cristian, I'll have a play.

Out of interest though, wouldn't the member already need to be a paid subscriber in order for this to work? Remember, I'm using the free pro form to offer a free 14 day trial on level 1. Therefore, would S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS still work?

Thanks
Rob.
User avatar
godrob
Registered User
Registered User
 
Posts: 33
Joined: August 26, 2011

Re: Restrict Access But Only For A Few Days...

Postby Cristián Lávaque » October 7th, 2011, 12:12 am

I'm not sure, but you could try it. You could even create a paget to echo all the constants or variables that may help you achieve this, and see what they output with the different kind of users. :)
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


Return to s2Member Plugin

Who is online

Users browsing this forum: No registered users and 2 guests

cron