On the latest ldap-7.x-1.x-dev I get this message for each mapped role when a user logs in for the first time and the account is created.
All my role names are mixed case. I have tracked this down to the LdapAuthorizationConsumerDrupalRole class lowercasing the roles as array keys in drupalRolesByName[] and then using the unlowercased rolename to index the array in grantSingleAuthorization(). A patch is attached.

CommentFileSizeAuthor
ldap-role-case.patch898 bytesjzornig

Comments

lavamind’s picture

Using ldap-7.x-1.x-dev, that error message appeared every time a user was assigned a role by LDAP at login. I can confirm the patch fixes the problem. Thanks!

johnbarclay’s picture

Title: Notice: Undefined index: SomeRole in LdapAuthorizationConsumerDrupalRole->grantSingleAuthorization() » LDAP Authorization: Notice: Undefined index: SomeRole in LdapAuthorizationConsumerDrupalRole->grantSingleAuthorization()
Status: Needs review » Fixed

Thanks. I committed this. It was fixed in the 7.x-2.x branch already so I didn't need to do so there.

Status: Fixed » Closed (fixed)

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

sunwukong’s picture

Issue summary: View changes

Thank you, you saved my time.