function user_profile_form_validate

7.x user.pages.inc user_profile_form_validate($form, &$form_state)
6.x user.pages.inc user_profile_form_validate($form, &$form_state)

Validation function for the user account and profile editing form.

1 string reference to 'user_profile_form_validate'
user_edit_form in drupal-6.x/modules/user/user.module

File

drupal-6.x/modules/user/user.pages.inc, line 273
User page callback file for the user module.

Code

function user_profile_form_validate($form, &$form_state) {
  user_module_invoke('validate', $form_state['values'], $form_state['values']['_account'], $form_state['values']['_category']);
  // Validate input to ensure that non-privileged users can't alter protected data.
  if ((!user_access('administer users') && array_intersect(array_keys($form_state['values']), array('uid', 'init', 'session'))) || (!user_access('administer permissions') && isset($form_state['values']['roles']))) {
    watchdog('security', 'Detected malicious attempt to alter protected user fields.', array(), WATCHDOG_WARNING);
    // set this to a value type field
    form_set_error('category', t('Detected malicious attempt to alter protected user fields.'));
  }
}