user_edit_validate

Definition

user_edit_validate($form_id, $form_values)
modules/user.module, line 1437

Code

<?php
function user_edit_validate($form_id, $form_values) {
  user_module_invoke('validate', $form_values, $form_values['_account'], $form_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_values), array('uid', 'init', 'session'))) || (!user_access('administer access control') && isset($form_values['roles']))) {
    $message = t('Detected malicious attempt to alter protected user fields.');
    watchdog('security', $message, WATCHDOG_WARNING);
    // set this to a value type field
    form_set_error('category', $message);
  }
}
?>
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.