This repository was archived by the owner on Jul 24, 2023. It is now read-only.

Description
- Laravel Version: 5.8.5
- Adldap2-Laravel Version: 6.0.1
- PHP Version: 7.3.3
- LDAP Type: OpenLDAP
Description:
I followed the upgrade guide to upgrade v6. After testing I found out that authentication is now broken. Upon examining the logs I found the following:
- The following query is executed:
select * from `users` where `objectguid` is null or `email` = my_email limit 1
- Then the following query is executed:
update `users` set `username` = foo, `first_name` = Foo, `last_name` = Bar, `email` = my_email, `password` = some_hash, `users`.`updated_at` = 2019-03-20 00:00:00 where `id` = 1
Integrity constraint violation: 1062 Duplicate entry 'foo' for key 'users_username_unique'
The reason is of course that the first query returns the first row in the users table (id=1) because all objectguid
fields are null
after just upgrading an existing users database. The following part of the query seems wrong:
where `objectguid` is null or
as that part will always cause the wrong user to be returned.