function ldap_authorization_cleanse_empty_og_fields in Lightweight Directory Access Protocol (LDAP) 7
Same name and namespace in other branches
- 8.2 ldap_authorization/ldap_authorization.module \ldap_authorization_cleanse_empty_og_fields()
- 7.2 ldap_authorization/ldap_authorization.module \ldap_authorization_cleanse_empty_og_fields()
this is a workaround for og 7.x-2.x bug I believe
1 call to ldap_authorization_cleanse_empty_og_fields()
- _ldap_authorizations_user_authorizations_set in ldap_authorization/
ldap_authorization.inc
File
- ldap_authorization/
ldap_authorization.module, line 23 - ldap authorization module
Code
function ldap_authorization_cleanse_empty_og_fields(&$user) {
if (property_exists($user, 'og_user_group_ref') && is_array($user->og_user_group_ref) && count($user->og_user_group_ref) == 0) {
unset($user->og_user_group_ref);
}
if (property_exists($user, 'og_other_user_group_ref') && is_array($user->og_other_user_group_ref) && count($user->og_other_user_group_ref) == 0) {
unset($user->og_other_user_group_ref);
}
}