-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcriptopro_node.install
More file actions
90 lines (81 loc) · 2.15 KB
/
criptopro_node.install
File metadata and controls
90 lines (81 loc) · 2.15 KB
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
<?php
/**
* @file
* Install, update and uninstall functions for the criptopro_node module.
*/
/**
* Implements hook_uninstall().
*/
function criptopro_node_uninstall() {
$settings = db_query("SELECT name FROM {variable} WHERE name LIKE 'criptopro_%'");
foreach ($settings as $variable) {
variable_del($variable->name);
}
}
/**
* Implements hook_requirements().
*/
function criptopro_node_requirements($phase) {
$requirements = array();
// Ensure translations don't break during installation.
$t = get_t();
$requirements['criptopro'] = array(
'title' => $t('criptopro library'),
'value' => 'install',
);
try {
new CPSignedData();
} catch (\Throwable $th) {
$requirements['criptopro']['description'] = $t('To use the module, you need to install the CryptoPro application.');
$requirements['criptopro']['value'] = 'not install';
$requirements['criptopro']['severity'] = REQUIREMENT_ERROR;
}
return $requirements;
}
/**
* Implements hook_schema().
*/
function criptopro_node_schema() {
$schema['criptopro_node'] = array(
'description' => 'The base table for criptopro_node module.',
'fields' => array(
'id' => array(
'description' => 'The primary identifier for a criptopro.',
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
),
'nid' => array(
'description' => 'The primary identifier for a node.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
),
'vid' => array(
'description' => 'The node version identifier.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
),
'signature1' => array(
'description' => 'Signature author',
'type' => 'text',
),
'uid' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => "User uid for signature2.",
),
'signature2' => array(
'description' => 'Signature 2',
'type' => 'text',
),
),
'primary key' => array('id'),
'indexes' => array(
'nid' => array('nid'),
),
);
return $schema;
}