You are here

function user_admin_role_submit in Drupal 7

Same name and namespace in other branches
  1. 5 modules/user/user.module \user_admin_role_submit()
  2. 6 modules/user/user.admin.inc \user_admin_role_submit()

Form submit handler for the user_admin_role() form.

1 string reference to 'user_admin_role_submit'
user_admin_roles in modules/user/user.admin.inc
Form to re-order roles or add a new one.

File

modules/user/user.admin.inc, line 1013
Admin page callback file for the user module.

Code

function user_admin_role_submit($form, &$form_state) {
  $role = (object) $form_state['values'];
  if ($form_state['values']['op'] == t('Save role')) {
    user_role_save($role);
    drupal_set_message(t('The role has been renamed.'));
  }
  elseif ($form_state['values']['op'] == t('Add role')) {
    user_role_save($role);
    drupal_set_message(t('The role has been added.'));
  }
  $form_state['redirect'] = 'admin/people/permissions/roles';
  return;
}