Download & Extend

Add a hook_detect_ldapgroups for detecting groups.

Project:LDAP integration
Version:6.x-1.0-beta2
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs review
Issue tags:hooks, ldapgroups

Issue Summary

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.

AttachmentSize
hook_detect_ldapgroups.patch1.4 KB

Comments

#1

Status:patch (to be ported)» needs review

#2

Assigned to:ccw» Anonymous

Unassigning. Someone else should review this.

#3

Version:5.x-1.5» 6.x-1.0-beta2

Ported to Drupal 6.x.

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

AttachmentSize
hook_detect_ldapgroups-6.x-1.0-beta2.patch 1.95 KB

#4

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.

AttachmentSize
hook_detect_ldapgroups-6.x-1.0-beta2_fix_style.patch 2.19 KB

#5

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)

nobody click here