A A A
Forum Scope


Match



Forum Options



Min search length: 3 characters / Max search length: 84 characters
Forum Login
Lost password?
coding-topic
User Groups and Forum Access
Avatar
Stan Dahl

75 Posts
(Offline)
1
Oct 20, 2015 - 4:38 pm
Print

Hi,

I’m working on some custom API coding and have things working as intended.

However, upon examining the database, I see in the sfmemberships table that my test user now belongs to 2 usergroups.

The newest group being the one my custom programming just added them to.

And the original group which is defined as “No Forum Access”

When I login and view the forum on this user I am not seeing anything.

Should I be removing this usergroup assignment in this case?

Avatar
Yellow Swordfish
Glinton, England

16436 Posts
(Offline)
2
Oct 20, 2015 - 4:42 pm
Print

Whether a user can be in one or multiple user groups is controlled by the User Group settings under the ‘Map Users to User Group’ Admin option. Can I assume you have that setting turned off? Does that help?

andy-signature.png
YELLOW
SWORDFISH
Avatar
Stan Dahl

75 Posts
(Offline)
3
Oct 20, 2015 - 6:06 pm
Print

Yes, that was turned off – figured out what I was doing wrong – now it works.

is there a way I can check that that option via the API?

Also, what’s the difference between these 2 options?


Avatar
Mr Papa
Simi Valley, CA

19448 Posts
(Offline)
4
Oct 21, 2015 - 12:02 am
Print

the difference is quite simple… if a user has a membership, and you add another membership (using the api vice direct db queries), if the single membership option is checked, all existing memberships are removed before the new one is added…

sorry, check what?  whether you have the single membership option check in your admin or not???  why would you need to check your site admin setting?  its forum wide, not user option… but, yes, you can query for the option if really needed.. something like this:

$sfmemberopts = sp_get_option(‘sfmemberopts’);
$single = $sfmemberopts[‘sfsinglemembership’];

then $single contains the state of the option…

Forum Timezone: America/New_York
All RSSShow Stats
Administrators: Blues Dancer, Simple Press, SP Community Support, Marcus (Simple:Press)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 630
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Newest Members:
Lorena Affleck
samantardh
PatrickAlawl
Hannelore Gaither
Margarito Nowacki
Elwood Mcclendon
samantaerx
Larue Cordeaux
Jerrold Stockman
Forum Stats:
Groups: 7
Forums: 17
Topics: 10071
Posts: 79393

 

Member Stats:
Guest Posters: 608
Members: 16976
Moderators: 0
Admins: 4

Most Users Ever Online
1170
Currently Online
Guest(s)
1
Currently Browsing this Page

1 Guest(s)