I've written a patch that introduces a posibility for arbitrary ldap group
detection.

Our particular ldap setup couldn't be catered by the existing 3 strategies so
I implemented a 4th strategy: hook_detect_ldapgroups($ldap_connection, $user)
It enables anyone to write a custom module that implements the hook to cater
any weird scheme for detecting extra groups from LDAP.

I suspect it needs review, but it's a very simple patch with no side-effects,
so I hope it will be included in future releases.

Comments

ccw’s picture

Status: Patch (to be ported) » Needs review
ccw’s picture

Assigned: ccw » Unassigned

Unassigning. Someone else should review this.

ccw’s picture

Version: 5.x-1.5 » 6.x-1.0-beta2
StatusFileSize
new1.95 KB

Ported to Drupal 6.x.

The 1st patch attached was for Drupal 5.x.

ccw’s picture

Fix some minor style issues in the previous patch.

Moved the example implementation of the hook to ldapgroups.api.php
This leaves just 3 lines of active code changed in the patch... Shouldn't be to hard to review.

johnbarclay’s picture

In ldap authorization for D7, the hook may look like this:

hook_ldap_authorization_maps_alter(&$user, &$user_ldap_entry, &$ldap_server, &$ldap_authz_map_config, &$authz_ids)

this will allow the modules implementing the hook to:
- have $user, $user_ldap_entry, $ladap_server, and $ldap authorization configuration to work with
- affect mappings from other authorization modules ($authz_ids).

See #807432: LDAP Authorization: Groups only allows single level OU in users's DN (does not allow multiple level OU)

cgmonroe’s picture

Version: 6.x-1.0-beta2 » 6.x-1.x-dev
Status: Needs review » Fixed

The dev version now has an ldap_user_groups_alter hook that supports this along with an ldap_user_roles_alter hook.

For details see: #1475272: 6.x-1.0 Release Candidate 1 Status

Status: Fixed » Closed (fixed)
Issue tags: -hooks, -ldapgroups

Automatically closed -- issue fixed for 2 weeks with no activity.