You are here

function _user_save_revision in User Revision 7

Same name and namespace in other branches
  1. 7.2 user_revision.module \_user_save_revision()

Save record to the database.

1 call to _user_save_revision()
user_revision_user_presave in ./user_revision.module
Implements hook_user_presave().

File

./user_revision.module, line 434
Enables user revision.

Code

function _user_save_revision(&$edit, $update = NULL) {
  $picture = NULL;
  if (isset($edit['picture']) && is_object($edit['picture'])) {
    $picture = $edit['picture'];
    $edit['picture'] = $picture->fid;
  }

  // Add timestamp and author.
  if (isset($update)) {
    drupal_write_record('user_revision', $edit, $update);
  }
  else {
    drupal_write_record('user_revision', $edit);
  }
  if (is_object($picture)) {
    file_usage_add($picture, 'user_revision', 'user', $edit['vid']);
    $edit['picture'] = $picture;
  }

  // Pass new vid to user_save?
}