-
Notifications
You must be signed in to change notification settings - Fork 0
/
cas_server.install
94 lines (89 loc) · 2.53 KB
/
cas_server.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<?php
/**
* @file
* The CAS Server module install file.
*/
/**
* Implements hook_schema().
*/
function cas_server_schema() {
$schema = array();
$schema['cas_server_ticket_store'] = array(
'description' => "Store the CAS tickets that have been handed out.",
'fields' => array(
'id' => array(
'description' => 'The randomized data of the ticket.',
'type' => 'varchar_ascii',
'length' => 256,
'not null' => TRUE,
),
'expiration' => array(
'description' => 'Time after which the ticket is invalid.',
'type' => 'int',
'mysql_type' => 'datetime',
'not null' => TRUE,
),
'uid' => array(
'description' => 'The user that this ticket is for.',
'type' => 'int',
'not null' => FALSE,
'default' => 0,
),
'type' => array(
'description' => 'A machine identifier for the type of ticket.',
'type' => 'varchar',
'length' => 32,
'not null' => TRUE,
),
'session' => array(
'description' => 'The hashed session ID of the user requesting ticket.',
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
),
'user' => array(
'description' => 'The username of the user requesting ticket.',
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
),
'service' => array(
'description' => 'For service and proxy tickets, what service the ticket is valid for.',
'type' => 'text',
'size' => 'normal',
'not null' => FALSE,
),
'renew' => array(
'description' => 'Whether or not this ticket was generated with direct presentation of credentials.',
'type' => 'int',
'not null' => FALSE,
),
'proxy_chain' => array(
'description' => 'For proxy and proxy-granting tickets, the list of proxies for the ticket.',
'type' => 'text',
'length' => 4096,
'not null' => FALSE,
),
),
'primary key' => array(
'id',
),
'indexes' => array(
'ticket' => array('id'),
),
);
return $schema;
}
/**
* Add the uid to the ticket table.
*/
function cas_server_update_8001() {
if (!\Drupal::database()->schema()->fieldExists('cas_server_ticket_store', 'uid')) {
\Drupal::database()->schema()->addField('cas_server_ticket_store', 'uid', array(
'description' => 'The user that this ticket is for.',
'type' => 'int',
'not null' => FALSE,
'default' => 0,
));
}
}