Describe the bug
If a BookStack installation is configured with the default role matching something that already exists in LDAP (ie. Editor is the default role and an Editor group exists in LDAP), users are added to that role twice on login, which causes an exception.
Steps To Reproduce
Steps to reproduce the behavior:
- Install BookStack, including using LDAP for authentication and group sync
- Set the default role to 'Editor'
- Create an 'Editor' role in LDAP and add a user to it
- Try to log in as that user
Expected behavior
Roles in LDAP should not conflict with the default role. Before creating a new entry for the user with the default role, attachDefaultRole() should check whether such an entry already exists.
Configuration:
- Bookstack 0.23.2
- PHP 7.2.7
- Apache
Kudos
BookStack is really useful and its development has moved at a furious pace. Looking though the code, for the first time today, I am really impressed. If there were a way to donate cash to support it's development, I would. In the meantime, I'll help where I can, starting with this bug report.
Describe the bug
If a BookStack installation is configured with the default role matching something that already exists in LDAP (ie. Editor is the default role and an Editor group exists in LDAP), users are added to that role twice on login, which causes an exception.
Steps To Reproduce
Steps to reproduce the behavior:
Expected behavior
Roles in LDAP should not conflict with the default role. Before creating a new entry for the user with the default role,
attachDefaultRole()should check whether such an entry already exists.Configuration:
Kudos
BookStack is really useful and its development has moved at a furious pace. Looking though the code, for the first time today, I am really impressed. If there were a way to donate cash to support it's development, I would. In the meantime, I'll help where I can, starting with this bug report.