I have a drupal site using LDAP_integration & LDAP Groups with the authentication set to LDAP only. I was surprised to discover that removing a role in LDAP didn't remove it from the Drupal user. I had assumed that the group info from LDAP groups was "authoritative".

I'm thinking about adding a checkbox to the LDAP Groups admin page offering to re-parse the LDAP Groups on each successful logon. Any thoughts?

Comments

zewa’s picture

this would be a very important feature, because our admins want to delete a user from AD, that he also has no access to the drupal pages any more.

Greetings
Zewa

miglius’s picture

This is addressed in the drupal 6 version. LDAP groups are mapped (and revoked) with the Drupal roles on each user login.

zewa’s picture

well thats not right ... i tried it in V6 and it doesnt work.

Added my account to a group -> this works as usual.
Removed my account from that group --> doesnt work.

First i thought its because of some Domaincontroller issues, so i waited, but after a day its still not done

Greetings
Zewa

zewa’s picture

Status: Postponed (maintainer needs more info) » Needs review

got the problem ...

in ldapgroups.module
function ldapgroups_user_login

there is somewhere this code specified

foreach ($account->ldap_drupal_roles as $role) {
    _ldapgroups_deny_role($account, $role);
}

must be a nasty mistake, cause ldap_drupal_roles holds the new roles gathered
not the existing ones.

so changing the stuff to

foreach ($account->roles as $role) {
    _ldapgroups_deny_role($account, $role);
}

fixes the problem.

Greetings
Zewa

johnbarclay’s picture

Status: Needs review » Closed (won't fix)

Closing 5.x issues to clean out issue queue.