A A A

Please consider registering
guest

Log In Register

Register | Lost password?
Advanced Search:

— Forum Scope —



— Match —



— Forum Options —




Wildcard usage:
*  matches any number of characters    %  matches exactly one character

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS
Prevent forum access for some users
Jul 7, 2010
2:30 pm
Rookie
Forum Posts: 3
Member Since:
Jul 7, 2010
Offline

We are using MagicMembers software for our membership site, and want to restrict access to our forum for some users who have only bought an intro product. I can easily identify them using this code:

$mgm_user_data = get_user_option('mgm_user');
if($mgm_user_data->account_type != 'AccountTypeA')
{

/* Restrict access here */
}

 

I have tried to put some of this code in sf_extend_current_user() , but can't seem to get the right mix of $current_user->member, ->guest, etc.

Any insight as to where I might put some code like this, to treat those members as if they are not even logged into the forum (i.e. show "You must be logged in to post", "Access Denied" screen)?

For these members, we don't even show a /forum link, but if they somehow make it there, we need to prevent all access.

Jul 7, 2010
3:02 pm

SP Master
Forum Posts: 22221
Member Since:
Nov 9, 2008
Offline

Why can't you use the built in permissions/user groups and roles? It will do a much better job than trying to hack code…

Yellow Swordfish
Jul 7, 2010
4:20 pm
Rookie
Forum Posts: 3
Member Since:
Jul 7, 2010
Offline

I guess I'm not clear on how to make the connection between product purchased and SPF User Group. If I create two new SPF User Groups, one for each product, is there an automated way to add the users to their respective User Group? Currently, any user that buys a product has WordPress Role 'Subscriber'. Do I need to create a new WordPress role per product, and then have the WordPress role map to an SPF User Group?

Jul 7, 2010
10:48 pm

SP Master
Forum Posts: 23688
Member Since:
Dec 10, 2006
Offline

there is provide your product implementation uses the standard wp api for roles… you can map a role to a sp user group… this can be set up to auto occur too… see forum – options – member settings…

Jul 8, 2010
10:43 pm
Rookie
Forum Posts: 3
Member Since:
Jul 7, 2010
Offline

Excellent, thanks for your help.

Jul 9, 2010
7:59 am

SP Master
Forum Posts: 23688
Member Since:
Dec 10, 2006
Offline

np. glad to help.

Forum Timezone: America/Chicago

Most Users Ever Online: 444

Currently Online: chaiavi, steve.engelking
69 Guest(s)

Currently Browsing this Page:
1 Guest(s)

See All Online Activity

Top Posters:

-Radio-: 1251

Lee H: 606

Luffer: 535

Conrad_Farlow: 502

jim: 478

neon: 263

ovizii: 240

Tal: 240

Member Stats:

Guest Posters: 2625

Members: 7361

Moderators: 1

Admins: 2

Forum Stats:

Groups: 5

Forums: 16

Topics: 10890

Posts: 79531

Moderators: Brandon C (162)

Administrators: Yellow Swordfish (22211), Mr Papa (23688)