You are here

function commons_trusted_contacts_user_presave in Drupal Commons 7.3

Implements hook_user_presave().

File

modules/commons/commons_trusted_contacts/commons_trusted_contacts.module, line 29

Code

function commons_trusted_contacts_user_presave(&$edit, $account, $category) {

  // Ensure that a value is always set for the user's group_access field,
  // so that the user remains public while content shared with the user's
  // trusted contacts group is private. If the value of $user->group_access
  // is not set, og_access.module will throw an exception in
  // _og_access_verify_access_field_existence().
  if (empty($edit['group_access'][LANGUAGE_NONE])) {
    $edit['group_access'][LANGUAGE_NONE][0]['value'] = 0;
  }
}