1 user.admin.inc user_admin_roles_order_submit($form, &$form_state)

Form submit function. Update the role weights.

File

core/modules/user/user.admin.inc, line 678
Admin page callbacks for the User module.

Code

function user_admin_roles_order_submit($form, &$form_state) {
  // Save admin role and anon name.
  $config = config('system.core');
  $config->set('anonymous', $form_state['values']['anonymous']);
  $config->set('user_admin_role', $form_state['values']['user_admin_role']);
  $config->set('user_editor_role', $form_state['values']['user_editor_role']);
  $config->save();

  // Save roles.
  foreach ($form_state['values']['roles'] as $role_name => $role_values) {
    $role = $form['roles'][$role_name]['#role'];
    $role->weight = $role_values['weight'];
    user_role_save($role);
  }
  backdrop_set_message(t('The role settings have been updated.'));
}