Closed (fixed)
Project:
Lightweight Directory Access Protocol
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
6 Feb 2012 at 19:18 UTC
Updated:
9 Mar 2012 at 01:00 UTC
I have a functioning LDAP server. I added another LDAP server and to test the second configuration I disabled the first LDAP server on the server listing page. When I attempt a login I get the following crash report:
Fatal error: Call to a member function connect() on a non-object in /opt/acquia-drupal-7.10.10/sites/all/modules/ldap/ldap_authentication/ldap_authentication.inc on line 213
The problem is that in the $auth_conf->servers list, the disabled server is listed as myserver->false, instead of having a valid object. But the value of FALSE is never handled so the call to $ldap_server->connect() is an improper lookup.
Comments
Comment #1
johnbarclay commentedBe sure to test with 7.x-1.x-dev. If this is still in it, should be an easy fix.
Comment #2
resplin commentedI see the same behaviour in version 7.x-1.x-dev. The problematic test is on line 220.
Comment #3
resplin commentedAfter further testing, I think it is because the server is disabled on the ldap_servers page, but remains enabled on the authentication page.
Comment #4
johnbarclay commentedA simple fix is the following, but the best solution is implement a hook such as hook_ldap_server_updated() so all the ldap modules can act on changes in ldap server configurations as well as when they are disabled. Otherwise ldap_servers would need to be aware of how other modules were using ldap servers. So I'm marking this as needs work and assigning it to myself.
Comment #5
johnbarclay commentedI implemented a hook_ldap_server_in_use() function so modules using an ldap server can throw validation errors when an ldap server is disabled or deleted. I've implemeneted in ldap_authorization and ldap_authorization and will push out next dev that I push out.
I'm changing this to a task/feature because it needs to be implemented in ldap_feeds, ldap_query, and ldap_views also.
Comment #6
johnbarclay commentedComment #7
johnbarclay commented