Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
New members getting custom role but also GUEST
Avatar
Kelly Brady
Member
sp_UserOfflineSmall Offline
Sep 25, 2016 - 11:38 pm

I have my site set up to map new users to a custom Wordpress role (managed by the Memberpress plugin), and there is a corresponding User Group in Simplepress, with a 1-to-1 mapping.

New users are correctly getting their custom role, and being mapped into the corresponding SP User Group, however they are also going into Guests.  It isn't causing any permissions issues, however, it then displays their main custom role AND "Guests" in their profile on messages.

I can't figure out how prevent these new registrants from being assigned to the Guests group.  

Also, is it "safe" to remove them from Guests by moving them from Guest to their custom group, which seems to remove them and not affect anything? The DELETE from role function doesn't do anything even if they are members of another group.

Thanks,

Kelly

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Sep 26, 2016 - 4:11 am

Needless to say this is not something we have heard happening before and a quick check ensures we can not replicate either! So - puzzling.

Can I assume that on your user group mapping admin panel, the 'Default user group for 'guests' IS in fact the 'Guests' user group and the default for 'Members' is 'Members'? And if that is the case and, for some reason, it wanted to put them in to two groups it should be Members not Guests!

The only logical explanation I can come up with here is that MemberPress is making two calls - one when the user registers and is not yet an actual member of the website - and again after the registration process is verified - by which time they are a member and have a WP  role. It would be worth asking the MemberPress team if this might be the case. Well - the exact question would be are they firing the WP new user hooks twice. I would argue that they should not be fired until registration is verified.

So - if that is happening and MemberPress can correct this that would solve the problem. But...

Have you tried checking the option to only allow users in a single user group? Or do you need this option turned off for the way you arrange things? If this is turned on then user group assignment will perform a 'move' operation if the specified user is already in a different user group. 

As to manually moving and/or deleting then again, I can not replicate any issues with deleting a user from a group. Can you talk me through what you are doing, step by step, to try and do this?

andy-signature.png
YELLOW
SWORDFISH
Avatar
Kelly Brady
Member
sp_UserOfflineSmall Offline
Sep 27, 2016 - 4:02 pm

Ok, I think I found the cause of the double groups. When setting a Memberpress membership to set a custom role, it sets it as a secondary role; the user created ALSO gets the Primary role as set in the Wordpress settings for the default user role.

In my case, the Wordpress default user role is "subscriber" which I had mapped to "Guest" in Simplepress. My membership scheme is set up so that a membership is required in order to access the forums, and it will always be based on a custom user role; so a "subscriber" would not normally be a valid user with any access.

It is fair to say that Memberpress is the "cause" of my problem, however it would be a nice Simplepress feature (and be a workaround for my Memberpress issue) to be able to map default SP user groups to "no usergroup membership" instead of having to assign one for each and every existing role.  For instance, it would be great to map "Subscriber" to "No membership" in SP.

I have submitted a support request to Memberpress about the dual-settings, as their docs imply only 1 role is set when using custom user roles.

Now that we know what is going on here, I'll make a separate posting about my inability to delete someone from a group in SP after I reconfirm what is happening and document it.

Thanks,

Kelly

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Sep 27, 2016 - 4:57 pm

Just make a new user group, like 'no access' for example, and put these people in there. And then just make sure that you do not grant them any permissions to any forum, or just do that with the Guests user group.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Kelly Brady
Member
sp_UserOfflineSmall Offline
Sep 27, 2016 - 5:48 pm

Yes, that works as far as permissions go because being in a group with "no rights" doesn't impede the user from getting rights form the additional membership group.  However, the problem for me is that it then lists the member as part of both groups in their profile, using the name of the group.  So the subtle difference here is between being in an extra group with no rights vs. not being in an extra group...

Thanks,

Kelly 

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Sep 27, 2016 - 9:12 pm

not a lot we can do with the membership plugin doing things a bit non standard (but of course supported by wp)...

we do have a filter on the membership display routine so you can use that to remove the one that you dont want to show... we can provide some guidance on this if you want to do it..

and the members list also allows you to exclude a usergroup...

Avatar
Kelly Brady
Member
sp_UserOfflineSmall Offline
Sep 28, 2016 - 6:05 pm

I got clarification from Memberpress that they do indeed set two roles if using their custom roles add-on; they don't want to change that behavior as they feel many customers use it.& it will break them.

I am going to play with solving this for me by one of two ways:

1. Map the default user role of "subscriber" to the SP "Member" group (which won't have any forum access permissions); user will get permissions from their custom role, and the badge I'll show for the member will relate to the custom role/user group. So on the default reboot theme it will show their badge (for the custom role), and the word "Member" below.

OR

2. Filter the membership display as you mention so only the custom roles that I've assigned badges to will show. This all depends on what determines which user group shows... is it alphabetic? Primary Group?  I'd need to figure out how to just show the secondary group.

You also just mentioned something I didn't know: "and the members list also allows you to exclude a usergroup"; I'll look at this too and see how that might help.

Thanks!

Kelly

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Sep 28, 2016 - 9:23 pm

depends on how fancy you want to get...

using the filter 'sph_UserMemberships' you could simply replace the usergroup name with a blank string...

or you could search for usergroup in the filter string and then 'back up' to the p tag element and add a display:none...

both those assume you know the name of the usergroup you want to hide - from your posts, I thought that was known...

for the members list, see the members view class, instantiated by

sp_has_member_groups($groupBy='usergroup', $orderBy='id', $sortBy='asc', $number=15, $limitUG=false, $ugids='')

in the spMembersView.php template file, the last argument lets specifically list the usergroup IDs you want list (rest will be hidden)...

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17361
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625