You are here

function ldap_servers_admin_enable_disable in Lightweight Directory Access Protocol (LDAP) 7

Same name and namespace in other branches
  1. 8.2 ldap_servers/ldap_servers.admin.inc \ldap_servers_admin_enable_disable()
  2. 7.2 ldap_servers/ldap_servers.admin.inc \ldap_servers_admin_enable_disable()

Implements the LDAP server delete page.

Parameters

$form_state: A form state array.

$sid: A LDAP server ID.

Return value

The form structure.

1 string reference to 'ldap_servers_admin_enable_disable'
ldap_servers_menu in ldap_servers/ldap_servers.module

File

ldap_servers/ldap_servers.admin.inc, line 199
Defines functions for administrative interface for servers

Code

function ldap_servers_admin_enable_disable($form, &$form_state, $action = NULL, $sid = NULL) {
  if ($ldap_server = ldap_servers_get_servers($sid, 'all', TRUE)) {
    $variables = array(
      'ldap_server' => $ldap_server,
      'actions' => FALSE,
      'type' => 'detail',
    );
    $form['#prefix'] = "<div>" . theme('ldap_servers_server', $variables) . "</div>";
    $form['sid'] = array(
      '#type' => 'hidden',
      '#value' => $sid,
    );
    $form['name'] = array(
      '#type' => 'hidden',
      '#value' => $ldap_server->name,
    );
    $form['action'] = array(
      '#type' => 'hidden',
      '#value' => $action,
    );
    return confirm_form($form, t('Are you sure you want to') . t($action) . ' ' . t('the LDAP server named <em><strong>%name</strong></em>?', array(
      '%name' => $ldap_server->name,
    )), LDAP_SERVERS_MENU_BASE_PATH . '/servers/list', t('<p></p>'), t($action), t('Cancel'));
  }
}