You are here

function contact_user_presave in Drupal 7

Implements hook_user_presave().

File

modules/contact/contact.module, line 236
Enables the use of personal and site-wide contact forms.

Code

function contact_user_presave(&$edit, $account, $category) {
  if (isset($edit['contact'])) {

    // Set new value.
    $edit['data']['contact'] = $edit['contact'];
  }
  elseif (!isset($account->data['contact'])) {

    // Use default if none has been set.
    $edit['data']['contact'] = variable_get('contact_default_status', 1);
  }
}