Not trying to revive an old post intentionally, but I've been working on a new Piwigo site and wanted to implement the Ldap plugin. Couple minor errors when first configuring it but got it to work just fine with 2.9.1. Some of the initial config errors I believe I can resolve by modifying the code, but they were minor annoyances at most. However, one BIG issue I ran into was the in the default behavior of ldap_bind and Active Directory. Basically, entering a valid AD user but leaving the password field blank would still allow the user to log in. Has to do with how AD (and LDAP following established specs) will bind anonymously if no password is provided but the username is valid.
After researching on several sites, the conclusion I came to in order to resolve this was to modify a bit of the code.....
In the Ldap_Login directory, I modified line 144 in class.ldap.php
Original line
if($bind){
Modified line
if($bind && !(strlen(trim($user_passwd)) == 0)){
This seems to have resolved the issue and now blank passwords, including passwords that are all spaces, do not authenticate the user.
I'm using the latest version of the code from
https://gitlab.lindenaar.net/piwigo/Ldap_Login, with the bracket fix that thefc posted about on 12-2-2015.
With the above info, if anyone has a more graceful fix or suggestion on a better way to handle blank passwords, I'm all ears. I'm a systems guy (engineer) at heart but have a decent programming background, and am working with PHP more and more.....but by no means smooth at it yet. Always willing to learn some pointers.
Thanks!