Form submit handler for the user_admin_role() form.
function user_admin_role_submit($form, &$form_state) {
$role = (object) $form_state['values']['role'];
$status = user_role_save($role);
if ($status === SAVED_UPDATED) {
drupal_set_message(t('The role has been renamed.'));
}
else {
drupal_set_message(t('The role has been added.'));
}
$form_state['redirect'] = 'admin/people/roles';
}