You are here

function ldapauth_admin_activate_submit in LDAP integration 6

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

Activates the LDAP server.

File

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

Code

function ldapauth_admin_activate_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 = '1' WHERE sid = %d", $sid);
    drupal_set_message(t('LDAP Configuration %name has been activated.', array(
      '%name' => $row->name,
    )));
    watchdog('ldapauth', 'LDAP server %name was activated.', array(
      '%name' => $row->name,
    ));
  }
  drupal_goto('admin/settings/ldap/ldapauth/list');
}