Hi,

While trying out the A2 version of ldap_integration, I came across a slight bug in ldapdata.module. I'm not sure why it was doing this (must be particular to my setup), but line 351 of ldapdata.module is the following:
$allowed_attrs = _ldapdata_ldap_info($user, 'ldapdata_roattrs');
Line 355 expects $allowed_attrs to be an array, since it's being used as the haystack for an in_array search. However, in my setup, I don't have any read-only attributes set up, and so $allowed_attrs is coming back as a boolean. That being the case, I created a little patch that adds an "is_array" check around the foreach loop so it won't spit out a bunch of errors saying that in_array was passed the wrong type in parameter 2 (like I was getting).

Cheers,

Dave

(This is, btw, my first attempt at making a patch, and it looked ok to me, so hopefully it is)

CommentFileSizeAuthor
ldapdata.module.patch1.34 KBdavedelong

Comments

equipages’s picture

I've applied these changes to my installation and it seems to work.

miglius’s picture

Version: 6.x-1.0-alpha2 » 6.x-1.x-dev

I have fixed this issue in the dev version. Please, verify it.

miglius’s picture

Status: Needs review » Closed (fixed)
yesakmac’s picture

Hate to bring this back up, but how do you apply this patch? I copy/pasted the text from lines 351 to 379 and saved it, but i'm still getting this error. (oh and the i was getting a unexpected $end error because what i think was there wasn't a an ending bracket under the line : $items[$attr_name] = $item;