-
Notifications
You must be signed in to change notification settings - Fork 1
/
lookup.install
71 lines (65 loc) · 1.88 KB
/
lookup.install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
/**
* @file
* Install, update, and uninstall functions for the Lookup details module.
*/
/**
* Implements hook_requirements().
*/
function lookup_requirements($phase) {
$requirements = array();
if (function_exists('ldap_connect') == FALSE) {
$requirements['ldap'] = array(
'title' => st('PHP LDAP library'),
'value' => st('Not installed'),
'description' => st('The <a href="@url">PHP LDAP library</a> is not installed', array('@url' => 'http://php.net/manual/en/book.ldap.php')),
'severity' => REQUIREMENT_ERROR,
);
}
return $requirements;
}
/**
* Implements hook_schema().
*/
function lookup_schema() {
$schema['users_lookup_detail'] = array(
'description' => st('User details taken from Lookup that are not stored in the users table.'),
'fields' => array(
'uid' => array(
'description' => st('User ID, links to User table.'),
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'name' => array(
'description' => st('The display name of the user.'),
'type' => 'varchar',
'length' => '255',
'not null' => FALSE,
),
'staff' => array(
'description' => 'Boolean value if the user is a member of staff (1) or not (0).',
'type' => 'int',
'size' => 'tiny',
'not null' => TRUE,
'default' => 0,
),
'student' => array(
'description' => 'Boolean value if the user is a student (1) or not (0).',
'type' => 'int',
'size' => 'tiny',
'not null' => TRUE,
'default' => 0,
),
),
'primary key' => array('uid'),
'foreign keys' => array(
'users' => array(
'table' => 'users',
'columns' => array('uid' => 'uid'),
),
),
);
return $schema;
}