Projet

Général

Profil

Paste
Télécharger (1,66 ko) Statistiques
| Branche: | Révision:

root / htmltest / sites / all / modules / cas / cas_server.install @ c12e7e6a

1
<?php
2

    
3
/**
4
 * @file
5
 * Installation hooks for the CAS Server module.
6
 */
7

    
8
/**
9
 * Implements hook_schema().
10
 */
11
function cas_server_schema() {
12
  $schema = array();
13

    
14
  $schema['cas_server_tickets'] = array(
15
    'description' => 'Stores CAS server tickets.',
16
    'fields' => array(
17
      'service' => array(
18
        'type' => 'varchar',
19
        'length' => 255,
20
        'not null' => TRUE,
21
        'default' => '',
22
      ),
23
      'ticket' => array(
24
        'type' => 'varchar',
25
        'length' => 255,
26
        'not null' => TRUE,
27
        'default' => '',
28
      ),
29
      'uid' => array(
30
        'type' => 'int',
31
        'unsigned' => TRUE,
32
        'not null' => TRUE,
33
      ),
34
      'timestamp' => array(
35
        'type' => 'int',
36
        'not null' => TRUE,
37
      ),
38
    ),
39
    'primary key' => array('ticket'),
40
  );
41

    
42
  return $schema;
43
}
44

    
45

    
46
/**
47
 * Creates CAS server tickets table.
48
 */
49
function cas_server_update_1() {
50
  $schema = array();
51

    
52
  $schema['cas_server_tickets'] = array(
53
    'description' => 'Stores CAS server tickets.',
54
    'fields' => array(
55
      'service' => array(
56
        'type' => 'varchar',
57
        'length' => 255,
58
        'not null' => TRUE,
59
        'default' => '',
60
      ),
61
      'ticket' => array(
62
        'type' => 'varchar',
63
        'length' => 255,
64
        'not null' => TRUE,
65
        'default' => '',
66
      ),
67
      'uid' => array(
68
        'type' => 'int',
69
        'unsigned' => TRUE,
70
        'not null' => TRUE,
71
      ),
72
      'timestamp' => array(
73
        'type' => 'int',
74
        'not null' => TRUE,
75
      ),
76
    ),
77
    'primary key' => array('ticket'),
78
  );
79

    
80
  $ret = array();
81
  db_create_table($ret, 'cas_server_tickets', $schema['cas_server_tickets']);
82
  return $ret;
83
}