You are here

function ldapauth_admin_deactivate_submit in LDAP integration 6

Same name and namespace in other branches
  1. 5 ldapauth.module \ldapauth_admin_deactivate_submit()

De-activates the LDAP server.

File

./ldapauth.admin.inc, line 549
Module admin page callbacks.

Code

function ldapauth_admin_deactivate_submit($form, &$form_state) {
  $sid = $form_state['values']['sid'];
  $result = db_query("SELECT name from {ldapauth} WHERE sid = %d", $sid);
  if ($row = db_fetch_object($result)) {
    db_query("UPDATE {ldapauth} SET status = '0' WHERE sid = %d", $sid);
    drupal_set_message(t('LDAP Configuration %name has been de-activated.', array(
      '%name' => $row->name,
    )));
    watchdog('ldapauth', 'LDAP server %name was de-activated.', array(
      '%name' => $row->name,
    ));
  }
  drupal_goto('admin/settings/ldap/ldapauth/list');
}