You are here

function ldap_api_activate_server_form_submit in Lightweight Directory Access Protocol (LDAP) 6

Submit hook for the LDAP server form.

File

./ldap_server.admin.inc, line 339

Code

function ldap_api_activate_server_form_submit($form, &$form_state) {
  if ($form_state['values']['op'] == $form_state['values']['Cancel']) {
    return;
  }
  $sid = $form_state['values']['sid'];
  $result = db_query("SELECT name from {ldap_servers} WHERE sid = %d", $sid);
  if ($row = db_fetch_object($result)) {
    db_query("UPDATE {ldap_servers} SET active = '1' WHERE sid = %d", $sid);
    drupal_set_message(t('LDAP server %name has been activated.', array(
      '%name' => $row->name,
    )));
    watchdog('ldap', 'LDAP server %name was activated.', array(
      '%name' => $row->name,
    ));
  }
}