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™

{BUG} bbPress bridge

s2Member Plugin. A Membership plugin for WordPress®.

{BUG} bbPress bridge

Postby dethier » October 8th, 2010, 9:47 pm

In testing I noticed that it didn't matter what you set as the minimum s2member level because as long as a person was a registered member (level) 0 they were able to get into the bbPress forums.

After doing some digging here is the problem:
Around line 102:
Code: Select all
if (($wp_cap === "subscriber" && $min > 0) || ($level = preg_replace("/[^0-9]/", "", $wp_cap)) < $min)


$level will actually return 2 + the member level because within $wp_cap we have "s2member_level{lvl}". So the conditional test will ALWAYS let a registered member through.

An easy fix is to do this to get rid of the 2:

Code: Select all
if (($wp_cap === "subscriber" && $min > 0) || ($level = preg_replace("/[^0-9]/", "", $wp_cap)-20) < $min)


And that should work.

If you could fix this in an update that'd be great :)
User avatar
dethier
Experienced User
Experienced User
 
Posts: 14
Joined: August 20, 2010

Return to s2Member Plugin

Who is online

Users browsing this forum: No registered users and 2 guests

cron