You are here

function ldap_servers_schema in Lightweight Directory Access Protocol (LDAP) 8.2

Same name and namespace in other branches
  1. 7.2 ldap_servers/ldap_servers.install \ldap_servers_schema()
  2. 7 ldap_servers/ldap_servers.install \ldap_servers_schema()

Implements hook_schema().

2 calls to ldap_servers_schema()
ldap_servers_update_7201 in ldap_servers/ldap_servers.install
upgrade as much as feasible for 7.1 to 7.2 branch
ldap_servers_update_7203 in ldap_servers/ldap_servers.install
make all schema field names lowercase in ldap server to deal with cronic case sensitivity issues

File

ldap_servers/ldap_servers.install, line 64
Install, update and uninstall functions for the LDAP API module.

Code

function ldap_servers_schema() {
  module_load_include('inc', 'ldap_servers', 'ldap_servers.functions');
  module_load_include('module', 'ldap_servers', 'ldap_servers');

  // to get the LDAP_SERVERS_ENC_TYPE_CLEARTEXT constants issue#1209576
  module_load_include('php', 'ldap_servers', 'LdapServerAdmin.class');
  $schema['ldap_servers'] = array(
    'export' => array(
      'key' => 'sid',
      'key name' => 'Server ID',
      'primary key' => 'numeric_sid',
      'identifier' => 'ldap_servers_conf',
      'api' => array(
        'owner' => 'ldap_servers',
        'api' => 'ldap_servers',
        'minimum_version' => 1,
        'current_version' => 1,
      ),
    ),
    'primary key' => array(
      'numeric_sid',
    ),
    'unique keys' => array(
      'name' => array(
        'name',
      ),
    ),
  );
  $fields = LdapServerAdmin::fields();
  foreach ($fields as $name => $props) {
    if (isset($props['schema'])) {
      $schema['ldap_servers']['fields'][$name] = $props['schema'];
    }
  }
  return $schema;
}