Page 1 of 1
Restrict Access But Only For A Few Days...
Posted:
October 5th, 2011, 6:04 am
by godrob
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
Re: Restrict Access But Only For A Few Days...
Posted:
October 5th, 2011, 7:52 am
by Eduan
Well you could restrict the URI and then after 14 days unblock it again.
Re: Restrict Access But Only For A Few Days...
Posted:
October 5th, 2011, 9:41 am
by godrob
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.
Re: Restrict Access But Only For A Few Days...
Posted:
October 5th, 2011, 9:45 am
by Eduan
Oh so you want to restrict access only to the spammers?
Re: Restrict Access But Only For A Few Days...
Posted:
October 5th, 2011, 10:03 am
by godrob
That's right.
I only want to disable the messaging function for very limited time
Rob.
Re: Restrict Access But Only For A Few Days...
Posted:
October 5th, 2011, 10:06 am
by Eduan
Well you could identify the spammers and restrict their access by lowering their level only for a few days until you find the culprit.
Re: Restrict Access But Only For A Few Days...
Posted:
October 6th, 2011, 2:43 am
by Cristián Lávaque
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_38I haven't tested this at all, but I hope it gets you closer to what you want.
Re: Restrict Access But Only For A Few Days...
Posted:
October 6th, 2011, 6:58 am
by godrob
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.
Re: Restrict Access But Only For A Few Days...
Posted:
October 7th, 2011, 12:12 am
by Cristián Lávaque
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.