You are here

function ldap_authorization_schema in Lightweight Directory Access Protocol (LDAP) 7

Same name and namespace in other branches
  1. 8.2 ldap_authorization/ldap_authorization.install \ldap_authorization_schema()
  2. 6 ldap_authorization/ldap_authorization.install \ldap_authorization_schema()
  3. 7.2 ldap_authorization/ldap_authorization.install \ldap_authorization_schema()

Implements hook_schema().

File

ldap_authorization/ldap_authorization.install, line 33
Install, update and uninstall functions for the LDAP authorization module.

Code

function ldap_authorization_schema() {
  $schema['ldap_authorization'] = array(
    'export' => array(
      'key' => 'consumer_type',
      'key name' => 'Mapping ID',
      'identifier' => 'consumer_type',
      'primary key' => 'numeric_consumer_conf_id',
      'api' => array(
        'owner' => 'ldap_authorization',
        'api' => 'ldap_authorization',
        'minimum_version' => 1,
        'current_version' => 1,
      ),
    ),
    'description' => "Data used to map users ldap entry to authorization rights.",
    'primary key' => array(
      'numeric_consumer_conf_id',
    ),
    'foreign keys' => array(
      'sid' => array(
        'table' => 'ldap_servers',
        'columns' => array(
          'sid' => 'sid',
        ),
      ),
    ),
  );
  module_load_include('inc', 'ldap_servers', 'ldap_servers.functions');
  ldap_server_module_load_include('php', 'ldap_authorization', 'LdapAuthorizationConsumerConfAdmin.class');
  $fields = LdapAuthorizationConsumerConfAdmin::fields();
  foreach ($fields as $name => $props) {
    if (isset($props['schema'])) {
      $schema['ldap_authorization']['fields'][$name] = $props['schema'];
    }
  }
  return $schema;
}