function user_edit_attribute_form_submit

7.x user.module user_edit_attribute_form_submit($form, $form_state)
6.x user.module user_edit_attribute_form_submit($form, $form_state)

File

modules/user/user.module, line 902

Code

function user_edit_attribute_form_submit($form, $form_state) {

  $values = $form_state ['values'];
  $name = $values ['attribute_name'];
  $user_id = intval($values ['user_id']);



  // Find and save the values from the form....
  foreach ($values as $key => $val) {
    if (str_starts_with($key, $name . "__")) {
      user_set_attribute($user_id, $key, $val);
    }
  }

  fp_add_message(t("User attributes have been updated successfully."));


}