You are here

function shib_auth_delete_rule in Shibboleth Authentication 5.3

Delete a rule from the list.

Parameters

$rule_id Id of the rule what will be delete.:

1 string reference to 'shib_auth_delete_rule'
shib_auth_menu in ./shib_auth.module
Generate the menu element to access the Shibboleth authentication module's administration page @returns HTML text of the administer menu element

File

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

Code

function shib_auth_delete_rule($rule_id) {
  $result = db_query("DELETE FROM {shib_auth} WHERE id = %d", $rule_id);
  if ($result) {
    drupal_set_message('Rule <span style="font-weight: bold;">#' . $rule_id . '</span> has been deleted.', 'warning');
  }
  else {
    $message = 'Rule has not been deleted!';
    drupal_set_message(t($message), 'error');
    watchdog('shub_auth', $message, WATCHDOG_ERROR);
  }
  drupal_goto('admin/user/shib_auth/rules');
}