You are here

function notifications_custom_user_save in Notifications 6

Save user subscription

1 call to notifications_custom_user_save()
notifications_custom_user in notifications_custom/notifications_custom.module
Implementation of hook_user().

File

notifications_custom/notifications_custom.module, line 155
Custom notifications module

Code

function notifications_custom_user_save(&$edit, $account, $category, $register = FALSE) {
  $enabled = array();
  if (!empty($edit['notifications_custom'])) {
    $enabled = $edit['notifications_custom'];
  }

  // If registering, add hidden forced subscription (register = 0, default_value = 1)
  if ($register && ($custom = notifications_custom_list(array(
    'register' => 0,
    'default_value' => 1,
  )))) {
    $enabled = array_merge($enabled, $custom);
  }
  notifications_custom_account_update($account, $enabled);
  $edit['notifications_custom'] = NULL;
}