function redhen_contact_entity_delete in RedHen CRM 7
Implements hook_entity_delete().
Allow users to be deleted automatically when their associated contacts are deleted, based on a setting.
File
- modules/
redhen_contact/ redhen_contact.module, line 1020 - Module file for RedHen contacts.
Code
function redhen_contact_entity_delete($entity, $type) {
if (variable_get(REDHEN_CONTACT_DELETE_USER_WITH_CONTACT, FALSE)) {
if ($type == 'redhen_contact' && !empty($entity->uid)) {
// Delete associated user when the contact is deleted.
user_delete($entity->uid);
}
}
}