You are here

function shib_auth_edit_rule_submit in Shibboleth Authentication 5.3

Same name and namespace in other branches
  1. 6.4 shib_auth_roles_forms.inc \shib_auth_edit_rule_submit()
  2. 7.4 shib_auth_roles_forms.inc \shib_auth_edit_rule_submit()

Submit the edited rule.

Parameters

$form_id: Id of the form.

$form_values: Values of the POSTed form.

File

./shib_auth_admin.inc, line 163
Generate the administration form of the Shibboleth authentication module

Code

function shib_auth_edit_rule_submit($form_id, $form_values) {
  $roles = _role_normalize($form_values['roles']);
  $result = db_query("UPDATE {shib_auth} SET field = '%s', regexpression = '%s', role = '%s' WHERE id = %d", $form_values['field'], $form_values['regexpression'], serialize($roles), arg(5));
  if ($result) {
    drupal_set_message(t('Rule was save.'));
    drupal_goto('admin/user/shib_auth/rules');
  }
  else {
    $message = 'Rule was not save into database!';
    drupal_set_message(t($message));
    watchdog('shib_auth_error', $message, WATCHDOG_ERROR);
  }
}