The problem we had is that '_ldapgroups_filter' @ldapgroups.inc isn't evaluating correctly php filter.

This is our configuration:

- 389 directory server,
- we are using Group by DN, attribute 'ou',
- use automatic mapping,
- php filter:

function _fing_filter_ldapgroup($group) {
$filter_groups = array('People', 'ens', 'posgrado', 'externos');
return ! in_array($group,$filter_groups);
}

$groups = array_filter($groups, '_fing_filter_ldapgroup');
return $groups;

When evaluated, array $groups, which is supposed to be passed to that code, isn't available.

I've switched to eval, and suddenly began to work. There should be another problem here, but I din't realize where.

Find the attached patch.

CommentFileSizeAuthor
not_evaling.patch518 bytesfzipi

Comments

cgmonroe’s picture

Status: Needs review » Closed (duplicate)

This is a duplicate of:

#618388: LDAP Groups: "PHP to filter roles by" broken

which is already fixed in the dev code.