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™

Unable to protect bbpress forum

s2Member Plugin. A Membership plugin for WordPress®.

Unable to protect bbpress forum

Postby drcoach » May 28th, 2010, 5:05 pm

Hello,
I am having difficulty getting s2member to protect a bbpress forum. I have asked it to protect all pages, I have also put in uri level access restrictions.

I have tried several versions of uri level access restrictions. I have tried /forum/, forum/ and
/members/%%current_user_login%%/forum/

None of these attempts has resulted in the forum being protected. The url is http://www.nunomad.com/tribe

Can someone help? I've had several questions here on the forum and have only received one answer so far by another member.
Last edited by drcoach on May 30th, 2010, 10:26 am, edited 1 time in total.
User avatar
drcoach
Registered User
Registered User
 
Posts: 23
Joined: May 22, 2010

Re: Unable to protect bbpress forum

Postby ryannagy » May 28th, 2010, 10:26 pm

Does this help:
-----
Re: Can I protect a Buddypress group?
by Jason Caldwell » May 13th, 2010, 12:01 am

Yep! Go to: s2Member -> General Options -> URI Level Access.

Put in these two lines:
CODE: SELECT ALL
/groups
/forums

In the latest version of s2Member, you can also use some Replacement Codes in this field, which are specifically designed for plugins like BuddyPress. See URI Level Access for full details.
User avatar
ryannagy
Registered User
Registered User
 
Posts: 68
Joined: May 18, 2010

Re: Unable to protect bbpress forum

Postby drcoach » May 30th, 2010, 9:40 am

Nope, I've already tried that. It makes no difference - but thanks for the suggestion. It's nice to get a response.
User avatar
drcoach
Registered User
Registered User
 
Posts: 23
Joined: May 22, 2010

Re: Unable to protect bbpress forum

Postby Elizabeth » June 2nd, 2010, 4:17 am

I think it's because bbPress is not part of WordPress, and s2Member does not recognize it.
In order words bbPress and WordPress work together, but they are 2 separate pieces of software; s2member is designed to work with WordPress.
User avatar
Elizabeth
Moderator
Moderator
 
Posts: 160
Joined: May 12, 2010

Re: Unable to protect bbpress forum

Postby drcoach » June 2nd, 2010, 10:00 pm

Thanks for your reply, Elizabeth. Let me see if I understand correctly. then the URI Level Access codes will only work for pages within Wordpress?
User avatar
drcoach
Registered User
Registered User
 
Posts: 23
Joined: May 22, 2010

Re: Unable to protect bbpress forum

Postby wood2695 » June 3rd, 2010, 6:37 am

Hey drcoach. I am trying to accomplish similar things using WP+s2M+bbPress, but going about it a different way. Just thought that I'd share what I know in hopes that you and I can solve our issues together.

First, regarding your specific question (both originally and to Elizabeth)... I don't have a certified answer on whether or not it will work on bbPress since that is really a stand alone platform, but I can say that I have got a deep integration of bbPress on my WP site and I just tried doing what you are attempting, by defining (several variations) URIs in s2M to protect '/forum'. Like you, it did not work, so I suspect that Elizabeth is absolutely correct.

Now let me explain what I'm attempting to do... likely a similar reason to yours, with a different approach. I've got s2M installed for members to (pay and) join. Some content will be accessible only if you're a member and logged in. But my real goal for s2M was to protect the forum. So I am also using a bbPress plugin called 'zaerl Visibility' that gives you control to show/hide/lock any forums/topics/posts based on a users role. So in theory, as long as you've got your bbPress install deep integrated, any user that is logged in could have access to what you define and those that aren't, couldn't. The problem with this is that s2M assigns users to custom roles based on their s2M level (ie. s2Member Level 4), which don't translate to standard WP roles, which in turn do not translate into your standard bbPress roles.

So if you are like me and sign up members using s2M and have a forum that you'd like to protect, I suggest using that zaerl plugin and then all we have to do is find a way to make s2M automatically populate an additional bbPress role into our user table (the SQL stuff is just over my head). Then again, if your forum is not deep integrated (sharing cookies and whatnot) then this wouldn't really work for you either.

If nothing else, I can confirm that s2M will not protect my (bbPress) '/forum' directory.
wood2695
Guest User
Guest User
 

Re: Unable to protect bbpress forum

Postby wood2695 » June 3rd, 2010, 6:43 am

Furthermore, I am working the forums as well as you and have a few threads started if you were interested in my solution.

viewtopic.php?f=4&t=185 (nothing but a friendly marketing message from Helping Hand at the moment)

http://bbpress.org/forums/topic/s2membe ... post-69389 (A good theory discussion with no actionable solutions yet. The guys at bbPress seem keen on figuring this out too since it only helps strengthen their platform. Maybe ping that thread to show there's more interest than just lil' old me)

I've got another started on WP.org, with no replies. I'll post here if anything come up.

Cheers.
wood2695
Guest User
Guest User
 

Re: Unable to protect bbpress forum

Postby wood2695 » June 4th, 2010, 9:15 am

drcoach et al.

I've finally landed on a solution for my particular setup. Here it is (you can go straight to the last few posts as there were several theories discussed)...

http://bbpress.org/forums/topic/s2member-integration
wood2695
Guest User
Guest User
 

Re: Unable to protect bbpress forum

Postby ryannagy » June 4th, 2010, 10:03 am

Thanks for the tip. That's way beyond my ability level but at least now I know that it's possible. I hope that when I am ready to integrate my forum the functionality will be available. If not, I can hire someone to do the coding.

- Ryan
User avatar
ryannagy
Registered User
Registered User
 
Posts: 68
Joined: May 18, 2010

Re: Unable to protect bbpress forum

Postby drcoach » June 7th, 2010, 6:48 am

@ryannagy and @wood2695, Thanks so much for your input. My bbpress forum is deep integrated as far as I can tell. The cookies are shared and user names and passwords are being recognized so I guess I did that part right. It sounds like the Zaerl solution isn't really functional yet until roles can be defined more consistently and I'd like to have a solution that can be implemented now. I will go read the thread that wood2695 suggested and get back with you all.
User avatar
drcoach
Registered User
Registered User
 
Posts: 23
Joined: May 22, 2010

Re: Unable to protect bbpress forum

Postby drcoach » June 7th, 2010, 7:28 am

OK wood2695. First, thanks so much for passing on your work as you have. I went to the end of the thread you suggested
http://bbpress.org/forums/topic/s2member-integration

And I did what you said you had done, pasting the code you gave into functions.bb-users.php and options-wordpress.php.

Now I get a white page when I click to the forum whether I'm logged in as a user or not. Any ideas about what might be happening?
User avatar
drcoach
Registered User
Registered User
 
Posts: 23
Joined: May 22, 2010

Re: Unable to protect bbpress forum

Postby drbyte » June 7th, 2010, 10:29 am

"bbPress will not have access to WordPress’ functions unless you manually tell bbPress to load WordPress first. This integration step is also known as “deep” integration, it is a totally optional part of integration and is not required to get shared cookies and logins working. In order to do it, you need to put require_once(dirname(__FILE__) . '/path/to/wp-load.php'); in bbPress’ bb-config.php (wp-load.php is in the same directory as WordPress’ wp-config.php file, so if your bbPress folder is directly inside your WordPress folder, the command becomes require_once(dirname(__FILE__) . '/../wp-load.php');).

Doing this will add quite a lot of weight to your bbPress installation as it will cause WordPress to load in it’s entirety. Your best option is to try to emulate the functionality you require inside a bbPress plugin."

use

<iframe>

then use:

Code: Select all
<?php if(is_user_logged_in()){ ?>
    Content for anyone that is logged in, regardless of their Membership Level.
<?php } else { ?>
    Some public content.
<?php } ?>



Sam
User avatar
drbyte
Experienced User
Experienced User
 
Posts: 269
Joined: May 6, 2010

Re: Unable to protect bbpress forum

Postby drcoach » June 7th, 2010, 11:27 am

Thanks for the help drbyte. I hate to be completely clueless on you but if I am to insert the code you have recommended at the end of your post, what file should I insert it into and where?

Also, can you spell out what it means to use <iframe> and how that's done?
User avatar
drcoach
Registered User
Registered User
 
Posts: 23
Joined: May 22, 2010

Re: Unable to protect bbpress forum

Postby drbyte » June 7th, 2010, 8:57 pm

As Elizabeth Mentioned in her Rep, WP and bbpress are 2 different entity. s2Member will work (secure) WP but not bbpress. Not sure if Jason will include support for bbpress like buddypress in his future release, but what you can do in the mean time is force bbpress within an iFrame then protect that iFrame with the code below.

Code: Select all
<iframe src ="bbpress.index.php" width="100%" height="600">
  <p>Forum</p>
</iframe>


You have to create a new page within your template and force the code below

Code: Select all
<?php if(is_user_logged_in()){ ?>
    <iframe src ="bbpress" width="100%" height="500">
  <p>Forum</p>
</iframe>
<?php } else { ?>
    Please Log In
<?php } ?>


This will insure the security of your forum and left a huge weight on your WP.

To insure no body can access your forum directly (http://site.com/forums/index.php) you can use .htaccess to redirect to the new page your have created which includes your secure code

Code: Select all
Redirect 301 /bbpress.index(example).php http://www.example.com/yourpage/


You might want to have 2 index under your bbpress forum folder index.php and index1.php.
copy index.php and rename it index1.php then use the
Code: Select all
<meta http-equiv="refresh" content="2; url=http://example.com/forum/index1.php">

in your index.php

Hope that helps
User avatar
drbyte
Experienced User
Experienced User
 
Posts: 269
Joined: May 6, 2010

Re: Unable to protect bbpress forum

Postby drcoach » June 7th, 2010, 9:31 pm

Thanks so much for your help drbyte. Unfortunately, it is a bit beyond me but I imagine it may be helpful to others in the future.

As for my situation, and perhaps yours wood2695, I found a repaired version of Michael Adams Force Login Plugin at: http://bbpress.org/forums/topic/force-l ... bpress-101 and have implemented it. It appears to be working beautifully! I'm so excited!
User avatar
drcoach
Registered User
Registered User
 
Posts: 23
Joined: May 22, 2010

Re: Unable to protect bbpress forum

Postby drbyte » June 7th, 2010, 9:52 pm

Hey Drcoach

Glad you found that :) I would give it a try. Buy something and see if you can complete the transaction without any errors. Just to be in the safe side.

Good Luck

Sam
User avatar
drbyte
Experienced User
Experienced User
 
Posts: 269
Joined: May 6, 2010

Re: Unable to protect bbpress forum

Postby drcoach » June 20th, 2010, 3:50 pm

I've gone through a purchase and everything looks ok. Thanks for warning me, though
User avatar
drcoach
Registered User
Registered User
 
Posts: 23
Joined: May 22, 2010

Re: Unable to protect bbpress forum

Postby Jason Caldwell » June 23rd, 2010, 2:12 pm

Hey guys. The next release of s2Member is going to include a bbPress Bridge plugin, that can be auto-installed by the s2Member plugin. Look for this to pop up in the next release, under:
s2Member -> API / Bridges.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA


Return to s2Member Plugin

Who is online

Users browsing this forum: Google [Bot] and 0 guests

cron