| 1 |
<?php
|
| 2 |
// $Id: ldapdirectory.install,v 1.6 2009/02/07 14:23:06 rmiddle Exp $
|
| 3 |
|
| 4 |
/**
|
| 5 |
* @file
|
| 6 |
* Ldap Directory install file
|
| 7 |
*/
|
| 8 |
|
| 9 |
/**
|
| 10 |
* Implementation of hook_install().
|
| 11 |
*/
|
| 12 |
function ldapdirectory_install() {
|
| 13 |
$result = drupal_install_schema('ldapdirectory');
|
| 14 |
|
| 15 |
if (count($result) > 0) {
|
| 16 |
drupal_set_message(t('Ldap Directory module installed.'));
|
| 17 |
}
|
| 18 |
else {
|
| 19 |
drupal_set_message(t('Ldap Directory table creation failed. Please "uninstall" the module and retry.'));
|
| 20 |
}
|
| 21 |
}
|
| 22 |
|
| 23 |
/**
|
| 24 |
* Implementation of hook_schema().
|
| 25 |
*/
|
| 26 |
function ldapdirectory_schema() {
|
| 27 |
$schema['ldapdirectory_config'] = array(
|
| 28 |
'module' => 'ldapdirectory',
|
| 29 |
'description' => t('Ldap Directory table that store config related information.'),
|
| 30 |
'fields' => array(
|
| 31 |
'did' => array(
|
| 32 |
'type' => 'serial',
|
| 33 |
'size' => 'tiny',
|
| 34 |
'not null' => TRUE,
|
| 35 |
'description' => t('did is an ID that holds the info regarding the block and search.'),
|
| 36 |
),
|
| 37 |
'sid' => array(
|
| 38 |
'type' => 'int',
|
| 39 |
'size' => 'tiny',
|
| 40 |
'not null' => TRUE,
|
| 41 |
'description' => t('sid links to ldapauth table for config related settings.'),
|
| 42 |
),
|
| 43 |
'ld_name' => array(
|
| 44 |
'type' => 'varchar',
|
| 45 |
'length' => 255,
|
| 46 |
'not null' => TRUE,
|
| 47 |
),
|
| 48 |
'enable_directory' => array(
|
| 49 |
'type' => 'int',
|
| 50 |
'size' => 'tiny',
|
| 51 |
'not null' => TRUE,
|
| 52 |
'defailt' => '0',
|
| 53 |
'description' => t('Enable Directory'),
|
| 54 |
),
|
| 55 |
'ou_on' => array(
|
| 56 |
'type' => 'int',
|
| 57 |
'size' => 'tiny',
|
| 58 |
'not null' => TRUE,
|
| 59 |
'defailt' => '0',
|
| 60 |
'description' => t('Display Organizational Unit in the block?'),
|
| 61 |
),
|
| 62 |
'ou_filter' => array(
|
| 63 |
'type' => 'varchar',
|
| 64 |
'length' => 255,
|
| 65 |
'description' => t('Organizational Unit filter.'),
|
| 66 |
),
|
| 67 |
'ou_label' => array(
|
| 68 |
'type' => 'varchar',
|
| 69 |
'length' => 50,
|
| 70 |
'description' => t('Organizational Unit label.'),
|
| 71 |
),
|
| 72 |
'ou_attribute' => array(
|
| 73 |
'type' => 'varchar',
|
| 74 |
'length' => 50,
|
| 75 |
'description' => t('Organizational Unit attribute.'),
|
| 76 |
),
|
| 77 |
'ou_userlink' => array(
|
| 78 |
'type' => 'varchar',
|
| 79 |
'length' => 50,
|
| 80 |
'description' => t('Organizational Unit userlink.'),
|
| 81 |
),
|
| 82 |
'ou_dn' => array(
|
| 83 |
'type' => 'varchar',
|
| 84 |
'length' => 50,
|
| 85 |
'description' => t('Organizational Unit dn.'),
|
| 86 |
),
|
| 87 |
'collapse_blocks' => array(
|
| 88 |
'type' => 'int',
|
| 89 |
'size' => 'tiny',
|
| 90 |
'not null' => TRUE,
|
| 91 |
'defailt' => '0',
|
| 92 |
'description' => t('Collapse Blocks'),
|
| 93 |
),
|
| 94 |
'search_field_enabled' => array(
|
| 95 |
'type' => 'int',
|
| 96 |
'size' => 'tiny',
|
| 97 |
'not null' => TRUE,
|
| 98 |
'defailt' => '0',
|
| 99 |
'description' => t('Search Field Enabled'),
|
| 100 |
),
|
| 101 |
'attributes' => array(
|
| 102 |
'type' => 'varchar',
|
| 103 |
'length' => 255,
|
| 104 |
'description' => t('Attributes'),
|
| 105 |
),
|
| 106 |
'weight' => array(
|
| 107 |
'type' => 'int',
|
| 108 |
'size' => 'tiny',
|
| 109 |
'not null' => TRUE,
|
| 110 |
'defailt' => '0',
|
| 111 |
'description' => t('Weight'),
|
| 112 |
),
|
| 113 |
'vcard_on' => array(
|
| 114 |
'type' => 'int',
|
| 115 |
'size' => 'tiny',
|
| 116 |
'not null' => TRUE,
|
| 117 |
'defailt' => '0',
|
| 118 |
'description' => t('Vcard On'),
|
| 119 |
),
|
| 120 |
'picture_on' => array(
|
| 121 |
'type' => 'int',
|
| 122 |
'size' => 'tiny',
|
| 123 |
'not null' => TRUE,
|
| 124 |
'defailt' => '0',
|
| 125 |
'description' => t('Picture On'),
|
| 126 |
),
|
| 127 |
'picture_on' => array(
|
| 128 |
'type' => 'int',
|
| 129 |
'size' => 'tiny',
|
| 130 |
'not null' => TRUE,
|
| 131 |
'defailt' => '0',
|
| 132 |
'description' => t('Picture On'),
|
| 133 |
),
|
| 134 |
'picture_attr' => array(
|
| 135 |
'type' => 'varchar',
|
| 136 |
'length' => 50,
|
| 137 |
'description' => t('Picture Attr.'),
|
| 138 |
),
|
| 139 |
'picture_default' => array(
|
| 140 |
'type' => 'varchar',
|
| 141 |
'length' => 50,
|
| 142 |
'description' => t('Picture Default'),
|
| 143 |
),
|
| 144 |
'maillink_on' => array(
|
| 145 |
'type' => 'int',
|
| 146 |
'size' => 'tiny',
|
| 147 |
'not null' => TRUE,
|
| 148 |
'defailt' => '0',
|
| 149 |
'description' => t('Maillink On'),
|
| 150 |
),
|
| 151 |
'maillink_attr' => array(
|
| 152 |
'type' => 'varchar',
|
| 153 |
'length' => 50,
|
| 154 |
'description' => t('Maillink Attr'),
|
| 155 |
),
|
| 156 |
'skypelink_on' => array(
|
| 157 |
'type' => 'int',
|
| 158 |
'size' => 'tiny',
|
| 159 |
'not null' => TRUE,
|
| 160 |
'defailt' => '0',
|
| 161 |
'description' => t('Skypelink On'),
|
| 162 |
),
|
| 163 |
'skypelink_attr' => array(
|
| 164 |
'type' => 'varchar',
|
| 165 |
'length' => 50,
|
| 166 |
'description' => t('Skypelink Attr'),
|
| 167 |
),
|
| 168 |
'vacationcheck_on' => array(
|
| 169 |
'type' => 'int',
|
| 170 |
'size' => 'tiny',
|
| 171 |
'not null' => TRUE,
|
| 172 |
'defailt' => '0',
|
| 173 |
'description' => t('VacationCheck On'),
|
| 174 |
),
|
| 175 |
'vacationcheck_status' => array(
|
| 176 |
'type' => 'varchar',
|
| 177 |
'length' => 50,
|
| 178 |
'description' => t('VacationCheck Status'),
|
| 179 |
),
|
| 180 |
'vacationcheck_message' => array(
|
| 181 |
'type' => 'varchar',
|
| 182 |
'length' => 50,
|
| 183 |
'description' => t('VacationCheck Message'),
|
| 184 |
),
|
| 185 |
),
|
| 186 |
'indexes' => array(
|
| 187 |
'sid' => array('sid'),
|
| 188 |
),
|
| 189 |
'primary key' => array('did')
|
| 190 |
);
|
| 191 |
return $schema;
|
| 192 |
}
|
| 193 |
|
| 194 |
/**
|
| 195 |
* Implementation of hook_uninstall().
|
| 196 |
*/
|
| 197 |
function ldapdirectory_uninstall() {
|
| 198 |
drupal_uninstall_schema('ldapdirectory');
|
| 199 |
variable_del('ldap_organizationalunits_block');
|
| 200 |
drupal_set_message(t('Ldap Directory module uninstalled.'));
|
| 201 |
}
|