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; } /** * rename ldap_servers type field to ldap_type */ function ldap_servers_update_7100() { db_change_field('ldap_servers', 'type', 'ldap_type', array( 'type' => 'varchar', 'length' => 20, 'not null' => FALSE )); return t('ldap_servers table field "type" renamed to "ldap_type"'); } /** * ldap_server table field changes */ function ldap_servers_update_7101() { db_add_field( 'ldap_servers', 'allow_conflicting_drupal_accts', array( 'type' => 'int', 'size' => 'tiny', 'not null' => FALSE, 'default' => 0, ) ); db_add_field( 'ldap_servers', 'unique_persistent_attr', array( 'type' => 'varchar', 'length' => '64', 'not null' => FALSE, ) ); db_add_field( 'ldap_servers', 'mail_template', array( 'type' => 'varchar', 'length' => '255', 'not null' => FALSE, ) ); db_change_field('ldap_servers', 'ldap_to_drupal_user', 'ldap_to_drupal_user', array( 'type' => 'varchar', 'length' => 1024, 'not null' => FALSE )); db_change_field('ldap_servers', 'binddn', 'binddn', array( 'type' => 'varchar', 'length' => 511, )); return t('Updated LDAP Server to include "allow_conflicting_drupal_accts" and "unique_persistent_attr" fields.'); } /** * add bind_method field to ldap_servers table */ function ldap_servers_update_7102() { if (!db_field_exists('ldap_servers', 'bind_method')) { db_add_field('ldap_servers', 'bind_method', array( 'type' => 'int', 'size' => 'tiny', 'not null' => TRUE, 'default' => 0, )); $msg = t('"bind_method" field added to ldap_servers table'); } return ($msg) ? $msg : t('No database changes made.'); } /** * add group_object_category field to ldap_servers table */ function ldap_servers_update_7103() { if (!db_field_exists('ldap_servers', 'group_object_category')) { db_add_field('ldap_servers', 'group_object_category', array( 'type' => 'varchar', 'length' => 64, 'not null' => FALSE, )); $msg = t('"group_object_category" field added to ldap_servers table'); } return ($msg) ? $msg : t('No database changes made.'); } /** * add pagination fields to ldap_servers table */ function ldap_servers_update_7104() { if (!db_field_exists('ldap_servers', 'search_pagination')) { db_add_field('ldap_servers', 'search_pagination', array( 'type' => 'int', 'size' => 'tiny', 'not null' => FALSE, 'default' => 0, )); $msg = t('"search_pagination" field added to ldap_servers table'); } if (!db_field_exists('ldap_servers', 'search_page_size')) { db_add_field('ldap_servers', 'search_page_size', array( 'type' => 'int', 'size' => 'medium', 'not null' => FALSE, 'default' => 1000, )); $msg .= '
' . t('"search_page_size" field added to ldap_servers table'); } return ($msg) ? $msg : t('No database changes made.'); } /** * add account_name_attr field to ldap_servers table */ function ldap_servers_update_7105() { if (!db_field_exists('ldap_servers', 'account_name_attr')) { db_add_field('ldap_servers', 'account_name_attr', array( 'description' => 'The attribute to be used as the account name if not the user_attr', 'type' => 'varchar', 'length' => 255, 'not null' => FALSE, )); $msg = t('"account_name_attr" field added to ldap_servers table'); } return ($msg) ? $msg : t('No database changes made.'); } /** * Change ldap_servers "bind_method" field to small int. */ function ldap_servers_update_7106() { db_change_field('ldap_servers', 'bind_method', 'bind_method', array( 'type' => 'int', 'size' => 'small', 'not null' => TRUE, 'default' => 0, )); $msg = t('ldap_servers "bind_method" field changed to small int'); return ($msg) ? $msg : t('No database changes made.'); }