You are here

function user_admin_edit_role_validate in Drupal 4

File

modules/user.module, line 1892
Enables the user registration and login system.

Code

function user_admin_edit_role_validate($form_id, $form_values) {
  if (drupal_valid_token($form_values['form_token'], 'user_admin_edit_role', TRUE)) {
    if (db_result(db_query("SELECT COUNT(*) FROM {role} WHERE name = '%s' AND rid != %d", $form_values['name'], $form_values['rid']))) {
      form_set_error('name', t('The role name %name already exists. Please choose another role name.', array(
        '%name' => $form_values['name'],
      )));
    }
  }
  else {
    form_set_error('form_token', t('Validation error, please try again.  If this error persists, please contact the site administrator.'));
  }
}