Page 1 of 1

Buddypress & S2Member, restricting through uri

PostPosted: January 9th, 2011, 3:46 am
by isisjade
I've tried restricting Buddypress groups, activity, forums, and members through restrict URI as posted about here: viewtopic.php?f=4&t=538&p=2263&hilit=buddypress+groups%2C+activity#p2263

However, it's not working for me. Even though I have it set to restrict those areas of buddypress for Level 0, it's restricting even level 1,2,& 3 from viewing these sections, even though I've not set them to be restricted. When I remove these from the URI restriction, it opens buddypress so even a visitor can see groups and users. I want these sections locked down.

So it seems to either be a bug or a config issue on my side. Has anyone else ran into this problem implementing S2Member on Buddypress, and can you tell me how to solve this problem?

Re: Buddypress & S2Member, restricting through uri

PostPosted: January 15th, 2011, 3:59 pm
by gwc_wd
I am using S2M with Buddypress and the URI restrictions:

/members/
/groups/
/forums/
/activity/

requiring level 0

and /create/

requiring level 1

I have no other restrictions for the other levels or elsewhere in S2M settings.

These are all working for me correctly.

The only difference I can see from your example is that I am enclosing the string in two / so I have
/groups/ while you have groups/

Note also that URIs are case sensitive so if you use /Groups/ it will not catch /groups/

So we would need more information to try to assist because what you are describing is not replicated -- at least not on my systems and I've fiddled with many convolutions of S2m +BP. What else might you have configured in S2M options that could be restricting access?

Re: Buddypress & S2Member, restricting through uri

PostPosted: January 29th, 2011, 10:06 pm
by Gayatriom
Hey. I'm having this exact same problem.
I'm enclosing everything in two /members/ slashes.
I don't know what I'm doing wrong.

Re: Buddypress & S2Member, restricting through uri

PostPosted: January 29th, 2011, 10:11 pm
by Gayatriom
/members/admin/messages/compose/
/members/admin/friend/add-friend/
/groups/create/
/forums/


This is what I have put in URI restriction.
However, everyone is able to access this!

Re: Buddypress & S2Member, restricting through uri

PostPosted: January 31st, 2011, 11:47 am
by gwc_wd
Gayatriom wrote:However, everyone is able to access this!


When you say "everyone" do you mean anonymous users who are not logged in?

Are you logging out, clearing your cookies and cache before trying to access restricted pages? Have you tried accessing the restricted pages from a different computer -- sometimes I find that the computer I'm using for configuring keeps me logged in, in unexpected circumstances.

I can't think of anything obvious that would be the problem. Are you running any other plugins that deal with membership or capabilities?

Have you designated a Member Options page?

Try this: Remove all of your Membership restrictions -- so delete the URI restrictions. Go to the Page Restrictions. Select a page from the drop down menu and restrict it to level 0.

The log out, clear cache and cookies. Then try to access that specific page.

If you can access it then you do have a bigger problem. If it you can't then we've confirmed that S2M is actually operational and the problem may be isolated to the URIs.

Don't know if any of this helps, but I'm trying <smile>.

Re: Buddypress & S2Member, restricting through uri

PostPosted: March 2nd, 2011, 1:21 pm
by GPMBuzz
Hello, finding similar.

I have set groups as private in buddypress but anybody can view my directory by adding /members/ to my url. Is there a way of specifying the url and requiring members to be registered and logged in to view?

Regards,

Gary

Re: Buddypress & S2Member, restricting through uri

PostPosted: September 5th, 2011, 8:08 am
by Mungo
I've been working on this and I discovered that depending on how your theme is set up (I am using Thesis) you may have to manually add in the code to force the URI check in your template code:

Code: Select all
<?php if(is_uri_permitted_by_s2member("/members/")) { ?>

BuddyPress template code

<?php } else {registration encouragement here} ?>


Took me a while to track this down so I hope this helps someone else
All the best
Mungo

Re: Buddypress & S2Member, restricting through uri

PostPosted: September 5th, 2011, 10:33 pm
by Cristián Lávaque
I wasn't aware that some themes may interfere with the URI restrictions. Thanks for the heads up, Mungo. :)

Re: Buddypress & S2Member, restricting through uri

PostPosted: September 6th, 2011, 5:45 am
by Mungo
Hi Cristián,

Since I posted this I have moved my install from the dev to the live server and the problem seems to have gone away! I am not sure what is causing this change in behaviour but it is probably a server setting.

Might be a red herring, i.e. my dev-server is configured in an odd way, and this is never an issue on live sites. Even so was an interesting exercise going through everything. If I ever get to the bottom of it i will return and post my findings. As it is, the code I added to force the check is never being called and S2Member is picking up on the URI restriction regardless.

Shrugs...

Re: Buddypress & S2Member, restricting through uri

PostPosted: September 7th, 2011, 2:18 am
by Cristián Lávaque
Got it. I look forward to your update. Thanks! :)