function _ldapgroups_translate_role in LDAP integration 5
Depending on ldap schema, converts ldap group to drupal role
2 calls to _ldapgroups_translate_role()
File
- ./
ldapgroups.module, line 295
Code
function _ldapgroups_translate_role($ldap_role) {
global $ldap_group_role_mappings;
if ($friendly_role = $ldap_group_role_mappings[$ldap_role]) {
// Just that
}
else {
if (preg_match('/^[^=]*=([^,]*),.*$/', $ldap_role, $matches)) {
$friendly_role = $matches[1];
}
else {
$friendly_role = $ldap_role;
}
}
return $friendly_role;
}