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; } /** * add 'create_consumers field to ldap_authorization table */ function ldap_authorization_update_7100() { if (!db_field_exists('ldap_authorization', 'create_consumers')) { db_add_field('ldap_authorization', 'create_consumers', array( 'type' => 'int', 'size' => 'tiny', 'not null' => TRUE, 'default' => 0, )); return t('"create_consumers" field added to ldap_authorization table'); } else { return t('No database changes made.'); } } /** * add derive_from_attr_use_first_attr field to ldap_authorization table */ function ldap_authorization_update_7101() { if (!db_field_exists('ldap_authorization', 'derive_from_attr_use_first_attr')) { db_add_field('ldap_authorization', 'derive_from_attr_use_first_attr', array( 'type' => 'int', 'size' => 'tiny', 'not null' => TRUE, 'default' => 0, )); return t('"derive_from_attr_use_first_attr" field added to ldap_authorization table'); } else { return t('No database changes made.'); } } /** * Add derive_from_entry_search_all column to ldap_authorization */ function ldap_authorization_update_7102() { if (!db_field_exists('ldap_authorization', 'derive_from_entry_search_all')) { db_add_field('ldap_authorization', 'derive_from_entry_search_all', array( 'type' => 'int', 'size' => 'tiny', 'not null' => TRUE, 'default' => 0, )); return t('"derive_from_entry_search_all" field added to ldap_authorization table'); } else { return t('No database changes made.'); } } /** * change derive_from_attr_attr and derive_from_entry fields to text instead of varchar 2555 */ function ldap_authorization_update_7103() { foreach (array('derive_from_dn_attr', 'derive_from_attr_attr', 'derive_from_entry_entries') as $field_name) { db_change_field('ldap_authorization', $field_name, $field_name, array( 'type' => 'text', 'not null' => FALSE, )); } } /** * change derive_from_attr_attr and derive_from_entry fields to text instead of varchar 2555 * applied second time because beta6 and 7 were wrong. */ function ldap_authorization_update_7104() { foreach (array('derive_from_dn_attr', 'derive_from_attr_attr', 'derive_from_entry_entries') as $field_name) { db_change_field('ldap_authorization', $field_name, $field_name, array( 'type' => 'text', 'not null' => FALSE, )); } } /** * add derive_from_entry_user_ldap_attr field to allow user specification of dn or other identifier. */ function ldap_authorization_update_7105() { if (!db_field_exists('ldap_authorization', 'derive_from_entry_user_ldap_attr')) { db_add_field('ldap_authorization', 'derive_from_entry_user_ldap_attr', array( 'type' => 'varchar', 'length' => 255, 'default' => NULL, )); return t('"derive_from_entry_user_ldap_attr" field added to ldap_authorization table'); } else { return t('No database changes made.'); } } /** * add nested checkboxes to derive from entry and attributes strategies. */ function ldap_authorization_update_7106() { if (!db_field_exists('ldap_authorization', 'derive_from_attr_nested')) { db_add_field('ldap_authorization', 'derive_from_attr_nested', array( 'type' => 'int', 'size' => 'tiny', 'not null' => TRUE, 'default' => 0, )); $msg = t('"derive_from_attr_nested" field added to ldap_authorization table'); } if (!db_field_exists('ldap_authorization', 'derive_from_entry_nested')) { db_add_field('ldap_authorization', 'derive_from_entry_nested', array( 'type' => 'int', 'size' => 'tiny', 'not null' => TRUE, 'default' => 0, )); $msg .= t('"derive_from_entry_nested" field added to ldap_authorization table'); } return ($msg) ? $msg : t('No database changes made.'); } /** * add derive_from_entry_use_first_attr field to and remove description field from ldap_authorization table */ function ldap_authorization_update_7107() { $changes = ''; if (!db_field_exists('ldap_authorization', 'derive_from_entry_use_first_attr')) { db_add_field('ldap_authorization', 'derive_from_entry_use_first_attr', array( 'type' => 'int', 'size' => 'tiny', 'not null' => TRUE, 'default' => 0, )); $changes .= t('"derive_from_entry_use_first_attr" field added to ldap_authorization table'); } if (db_field_exists('ldap_authorization', 'description')) { db_drop_field('ldap_authorization', 'description'); $changes .= t('"description" field dropped from to ldap_authorization table'); } return ($changes) ? $changes : t('No database changes made.'); } /** * add derive_from_entry_entries_attr field to allow user specification of attribute representing group in queries. */ function ldap_authorization_update_7108() { if (!db_field_exists('ldap_authorization', 'derive_from_entry_entries_attr')) { db_add_field('ldap_authorization', 'derive_from_entry_entries_attr', array( 'type' => 'varchar', 'length' => 255, 'default' => NULL, )); return t('"derive_from_entry_entries_attr" field added to ldap_authorization table'); } else { return t('No database changes made.'); } }