user_profile_form_submit

Versions
mediamosa-21
user_profile_form_submit($form, &$form_state)

Submit function for the user account and profile editing form.

Code

modules/user/user.pages.inc, line 286

<?php
function user_profile_form_submit($form, &$form_state) {
  $account = $form['#user'];
  $category = $form['#user_category'];
  // Remove unneeded values.
  form_state_values_clean($form_state);

  $edit = (object)$form_state['values'];
  field_attach_submit('user', $edit, $form, $form_state);
  $edit = (array)$edit;

  user_save($account, $edit, $category);
  $form_state['values']['uid'] = $account->uid;

  if ($category == 'account' && !empty($edit['pass'])) {
    // Remove the password reset tag since a new password was saved.
    unset($_SESSION['pass_reset_'. $account->uid]);
  }
  // Clear the page cache because pages can contain usernames and/or profile information:
  cache_clear_all();

  drupal_set_message(t('The changes have been saved.'));
}
?>