You are here

function ldap_authorization_schema in Lightweight Directory Access Protocol (LDAP) 7.2

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 ldap_authorization/ldap_authorization.install \ldap_authorization_schema()

Implements hook_schema().

3 calls to ldap_authorization_schema()
ldap_authorization_update_7203 in ldap_authorization/ldap_authorization.install
Make all schema field names lowercase in ldap server to deal with cronic case sensitivity issues.
ldap_authorization_update_7204 in ldap_authorization/ldap_authorization.install
Make all schema field names lowercase in ldap server to deal with cronic case sensitivity issues.
ldap_servers_update_7201 in ldap_servers/ldap_servers.install
Upgrade as much as feasible for 7.1 to 7.2 branch.

File

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

Code

function ldap_authorization_schema() {
  $schema['ldap_authorization'] = [
    'export' => [
      'key' => 'consumer_type',
      'key name' => 'Mapping ID',
      'identifier' => 'consumer_type',
      'primary key' => 'numeric_consumer_conf_id',
      'api' => [
        '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' => [
      'numeric_consumer_conf_id',
    ],
    'foreign keys' => [
      'sid' => [
        'table' => 'ldap_servers',
        'columns' => [
          'sid' => 'sid',
        ],
      ],
    ],
  ];
  module_load_include('inc', 'ldap_servers', 'ldap_servers.functions');
  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;
}