function ldap_user_ldap_exclude in Lightweight Directory Access Protocol (LDAP) 8.2
Same name and namespace in other branches
- 7.2 ldap_user/ldap_user.module \ldap_user_ldap_exclude()
Parameters
stdClass $account as drupal user object:
array $edit is a drupal user edit array:
enum int $direction indicating which directions to test for association:
Return value
boolean TRUE if user should be excluded from ldap provision/synching
4 calls to ldap_user_ldap_exclude()
- ldap_user_user_insert in ldap_user/
ldap_user.module - Implements hook_user_insert().
- ldap_user_user_login in ldap_user/
ldap_user.module - Implements hook_user_login().
- ldap_user_user_presave in ldap_user/
ldap_user.module - Implements hook_user_presave()
- ldap_user_user_update in ldap_user/
ldap_user.module - Implements hook_user_update()
1 string reference to 'ldap_user_ldap_exclude'
- ldap_user_user_entity_fields in ldap_user/
ldap_user.install
File
- ldap_user/
ldap_user.module, line 636 - Module for the LDAP User Entity
Code
function ldap_user_ldap_exclude($account = NULL, $edit = NULL, $direction = LDAP_USER_PROV_DIRECTION_ALL) {
// always exclude user 1
if (is_object($account) && isset($account->uid) && $account->uid == 1) {
return TRUE;
}
// exclude users who have the field ldap_user_ldap_exclude set to 1
if (is_object($account) && isset($account->ldap_user_ldap_exclude['und'][0]['value']) && $account->ldap_user_ldap_exclude[LANGUAGE_NONE][0]['value'] == 1) {
return TRUE;
}
// exclude new users who have the value set to 1 in their $edit array
if (is_array($edit) && isset($edit['ldap_user_ldap_exclude']['und'][0]['value']) && $edit['ldap_user_ldap_exclude'][LANGUAGE_NONE][0]['value'] == 1) {
return TRUE;
}
// everyone else is fine
return FALSE;
}