-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Roles removed if user has multiple roles in WP #121
Comments
Thanks for spotting and reporting! Looks like a good solution. I'll check that and might implement it. Stay tuned! |
exactly what I was about to open as an issue. Currently, I commented it out Can you add an option in the settings page where we can choose whether to update the roles or not? or at least have the previous multiple roles reassigned? |
I have encountered very similar issue with the plugin version 2.1.1 (LDAP groups are not used). I am using various bbPress and WPML plugins. One of the site Administrator got his
I did not find why, and I do not know this is correct, but the administrator is at the end of the list!! at line 471 in function authLdap_user_role():
Are you assuming that the main role is the first one in the list, which is not the case on my setup. So you drop the Administrator role for this user... Then at line 329:
$roles->is_role($role) failed as "translate" is a capability, not a role => User login rejected with wrong password. |
Thank you for this information! That helps narrowing this problem down! |
I am not an expert in Wordpress development, is there someone with some knowledge about capabilities to tell me if the order in the database is important or not? I am tracking down the issue in other plugins too! |
hi everyone. I got the same problem with this module. |
I'm having this same issue, users with multiple roles are reduced to one when logging in (not optimal!) |
Greetings!
If an user has multiple roles in WP, the plugin will remove all of them and keep only the first one. The function authLdap_user_role($uid) only returns the first index of the array and then its value is being used to overwrite the usermeta.
My current workaround is to add a condition in line 333 of authLdap.php:
if ($authLDAPGroupEnable && $authLDAPGroupOverUser) {
$user_info['role'] = $role;
}
The idea is to modify the usermeta only when is absolutely necessary.
Regards,
Luis
The text was updated successfully, but these errors were encountered: