Skip to content
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

Issue when using with bbPress #246

Open
HueTayLt opened this issue Dec 5, 2023 · 12 comments
Open

Issue when using with bbPress #246

HueTayLt opened this issue Dec 5, 2023 · 12 comments

Comments

@HueTayLt
Copy link

HueTayLt commented Dec 5, 2023

Hi Heiglandreas
Thank you very much for distribute this plugin.
I have problem when using this plugin with bbPress plugin, pls help me.
When a LDAP user signup, it create new user in wordpress with 'null' Site Role and Default bbPress ForumRole. But I cannot use WordPress Admin Account to change user Site Role and ForumRole because the plugin always change User role back to default role (in plugin setting) when LDAP user sign in . In plugin setting, i uncheck option "Map LDAP Groups to wordpress Roles?"
Sorry for my English. Pls let me know if you need more information. Tks in advance.

@heiglandreas
Copy link
Owner

Hey there.

Thanks for raising this issue!

Have you checked the "LDAP group overwrite existing group" setting? Please uncheck that and see whether it works then.

Looks like I need to check in what order the checks are done. Looks like in that specific case checks are done in the wrong order.

@HueTayLt
Copy link
Author

HueTayLt commented Dec 5, 2023

Tks for your reply. I can't find the setting "LDAP group overwrite existing group" in plugin setting. I'm using plugin version 2.5.9 on WordPress 6.3.2. And All plugin setting I see as pictures below

image
image

@heiglandreas
Copy link
Owner

Ah dammit. Looks like you need to activate the "Map LDAP groups to WordPress roles" checkbox to see it. 🙈

I do need to fix that in the code. Sorry for the inconvenience!

@HueTayLt
Copy link
Author

HueTayLt commented Dec 5, 2023

Tks. And I can see setting now 👍 . But after uncheck setting which you mention. Issue is still remain.

@HueTayLt
Copy link
Author

HueTayLt commented Dec 7, 2023

Hi Heiglandreas !
I'm still waiting information from you. Thank you very much.

@heiglandreas
Copy link
Owner

Ah! The edit didn't trigger a new notification. Will dig into that then

@heiglandreas
Copy link
Owner

Can you please check the debug authLdap checkbox, run a login again and send me the output of the logfile? Everything that starts with authldap. Feel free to send it to authldap@heigl.org if you do not want to post it here.

@HueTayLt
Copy link
Author

HueTayLt commented Dec 7, 2023

Hi there.
This is the output of logfile start with authldap:
[Thu Dec 07 14:29:06.938229 2023] [php7:notice] [pid 2266726] [client 127.0.0.1:59874] [AuthLDAP] User 'test' logging in, referer: http://sandbox.local
[Thu Dec 07 14:29:06.938305 2023] [php7:notice] [pid 2266726] [client 127.0.0.1:59874] [AuthLDAP] connect to LDAP server, referer: http://sandbox.local
[Thu Dec 07 14:29:07.208925 2023] [php7:notice] [pid 2266726] [client 127.0.0.1:59874] [AuthLDAP] LDAP authentication successful, referer: http://sandbox.local
[Thu Dec 07 14:29:07.210505 2023] [php7:notice] [pid 2266726] [client 127.0.0.1:59874] [AuthLDAP] Existing user, uid = 53, referer: http://sandbox.local
[Thu Dec 07 14:29:07.211100 2023] [php7:notice] [pid 2266726] [client 127.0.0.1:59874] [AuthLDAP] Existing user's role: bbp_participant, referer: http://sandbox.local
[Thu Dec 07 14:29:07.211345 2023] [php7:notice] [pid 2266726] [client 127.0.0.1:59874] [AuthLDAP] The LDAP user has an entry in the WP-Database, referer: http://sandbox.local
[Thu Dec 07 14:29:07.219711 2023] [php7:notice] [pid 2266726] [client 127.0.0.1:59874] [AuthLDAP] user id = 53, referer: http://sandbox.local

@heiglandreas
Copy link
Owner

Ah dammit. I think I know what the issue is. Can it be that the user in question has multiple roles? And the bbp_participant is the first one?

@HueTayLt
Copy link
Author

HueTayLt commented Dec 8, 2023

Hi,
Yes. As I mentioned in the first post, in my site, one user may have two role. And when LDAP user sign up, authLdap plugin create new user with 'null' Site Role and Default bbPress ForumRole.

@heiglandreas
Copy link
Owner

I just released a new version that should fix part of your issue. It should now leave the WordPress-Roles that you assigned in WordPress intact on login.

This will only happen though when you disabled the "LDAP Groups override role of existing users?" option in the AuthLDAP settings! Otherwise the LDAP-Roles will take precedence and overwrite (as the Option-name already suggests) the WordPress roles so that you can do the role-assignements solely in WordPress.

Though currently the plugin only allows to assign one WordPress role to a user. SO even when the user is member of an LDAP-ROle that is assigned to multiple WordPress groups only the first WordPress-role will be assigned.

Changing that is planned for one of the next versions.

I hope this helps at lesat a bit.

@HueTayLt
Copy link
Author

HueTayLt commented Jan 9, 2024

Thank you very much. I'll try this new version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants