HOW ARE YOU GENTLEMEN?

I'm currently developing a website for my company, and we've integrated Drupal and LDAP using the LDAP_Integration modules. I've got LDAP user groups mapped to roles via the ldapgroups.conf.php file, and login works perfectly, but there's another problem:

The group->role map is intermittent, and when I do finally get a role mapped, only the default "authenticated user" permissions map to that person. The workaround is to open the role permissions for the assigned roles, and save. Only then are they applied.

Has this been encountered before by anyone? If so, does anyone have a fix, or might they tell me where I can look for a hack to fix this?

Thank you!

Comments

bigwayne’s picture

UPDATE:

Just so you know, I've got LDAP groups mapping to roles on the first login. Permission application is still broken, though.

norlan’s picture

So i seem to have the same problem ...

I added a few msg_r() to track the role assignment. the one i want to reference in the following is in "function ldapgroups_user_login(&$user)" at the very end of the func

  ...
  msg_r($roles);
  // Store roles in the user object so we know which ones
  // were granted here
  user_save($user, array('ldap_drupal_roles' => $roles));

STEP 1:
the user does not exist in drupal but on LDAP. there is no ouput from the msg_r
so i logged out and check the user with the adminuser - no role is assigned to the now existing user

STEP 2:
i logged in a second time with the new user and voila a get the right role at the login site.
also the role is shown in the user management but the role is not assigned when i am logged in as the user

STEP 3:
as admin i edit the role to the user ... everything works as i want it

where is the bug??
please let me know if you need further informations!

regards norlan

norlan’s picture

Title: LDAP Group Permissions » LDAP Groups mapping to roles
Version: master » 5.x-1.3
Assigned: Unassigned » norlan
Category: support » bug
Status: Active » Postponed (maintainer needs more info)

Hi, it seems that taking the roles from my ldap groups does not work at the first login of the user. The right role is shown at the second login but the rights are not adopted.

I added a few msg_r() to track the role assignment. the one i want to reference in the following is in "function ldapgroups_user_login(&$user)" at the very end of the func


...
msg_r($roles);
// Store roles in the user object so we know which ones
// were granted here
user_save($user, array('ldap_drupal_roles' => $roles));

STEP 1:
the user does not exist in drupal but on LDAP. there is no ouput from the msg_r
so i logged out and check the user with the adminuser - no role is assigned to the now existing user

STEP 2:
i logged in a second time with the new user and voila a get the right role at the login site.
also the role is shown in the user management but the role is not assigned when i am logged in as the user

STEP 3:
as admin i edit the role to the user ... everything works as i want it

where is the bug??
please let me know if you need further informations!

regards norlan

scafmac’s picture

Status: Postponed (maintainer needs more info) » Closed (duplicate)

Guys,

This looks suspiciously like http://drupal.org/node/171092 - could you try the fix in #14. Marking as dup & closing. If the fix on the other thread doesn't fix, please continue commenting on that post.