operasoftware / dns-ui

Opera's LDAP-authenticated PowerDNS user interface
Apache License 2.0
282 stars 58 forks source link

AD LDAP connection failure with solution #132

Closed PisikeSipelgas closed 5 years ago

PisikeSipelgas commented 5 years ago

I wanted to share my experience connecting to Active Directory. Looked all the open and closed issues here, tried almost everything without any luck. Finally i managed to solve this mystery. All i needed was to add this line (41) to ldap.php:

 39                 if(!empty($this->bind_dn)) {
 40                         ldap_set_option($this->conn, LDAP_OPT_PROTOCOL_VERSION, 3);
 41                         ldap_set_option($this->conn, LDAP_OPT_REFERRALS, 0);

Both lines, 40 and 41, are needed. Maybe it's good to have some kind of configurational parameters in config/config.ini for that?

thomas-pike commented 5 years ago

Thank you for reporting this and finding the fix. I'd actually already fixed this in a different project some time ago but had failed to port the fix over to this one. Fixed now.