Login twice required with LDAP (2.1.1)
I've done an upgrade from 1.8.5 to 2.1.1. The LDAP authentication is buggy and have to be manually fixed. After some fix, a problem still occurs : for a new user, the first login will told him : "login/pass incorrect" ; just click again on the "ENTER" button (without any change) and the user is now connected.
Here are fixes manually done (<dokeos>/main/auth/ldap/authldap.php) :
- [ldap_find_user_info] : use "sAMAccountName" instead of "uid" (we are using AD from Microsoft)
- [ldap_find_user_info] : comment out all "$result['courses'] =" which write error to Apache and is not required for us (Paris5???)
- [ldap_update_user] : commented out this line which will call (in another function) an undefined/unimplemented function : ldap_subscribe_user_to_session($login,$uinfo);
After that, login through LDAP works and record of new user too ... but should do it twice (I've watched in MySQL and my user is only recorded once).
Do you have any idea of what's going wrong ? I've tried to fix it but I'm not a PHP developer .. I also tried to copy code from "login.php" to "newUser.php" (past it after the locally recorded user) but it won't works :-/.
I'm recreating this post and I hope to get help and help other people which get same error.
I personally think the LDAP authentication is not well written and is buggy (even out of the box without any upgrade : see the "get_session_by_ldap_cursus" which is not provided ...). Should be fixed :)
Thanks for your help
EDIT: of course, I'm also here to help to debug ;)