forked from misd-service-development/drupal-raven
-
Notifications
You must be signed in to change notification settings - Fork 0
/
raven.install
81 lines (70 loc) · 2 KB
/
raven.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
<?php
/**
* @file
* Install, update, and uninstall functions for the Raven authentication module.
*/
/**
* Implements hook_requirements().
*/
function raven_requirements($phase) {
$requirements = array();
if (function_exists("openssl_verify") === FALSE) {
$requirements['openssl'] = array(
'title' => st('PHP OpenSSL library'),
'value' => st('Not installed'),
'description' => st('The <a href="@url">PHP OpenSSL library</a> is not installed', array('@url' => 'http://php.net/openssl')),
'severity' => REQUIREMENT_ERROR,
);
}
return $requirements;
}
/**
* Implements hook_install().
*/
function raven_install() {
// Insert variables
variable_set('raven_login_override', FALSE);
variable_set('raven_backdoor_login', TRUE);
variable_set('raven_website_description', NULL);
variable_set('raven_login_fail_redirect', NULL);
variable_set('raven_logout_on_browser_close', TRUE);
variable_set('raven_override_administrator_approval', FALSE);
variable_set('raven_allow_raven_for_life', FALSE);
variable_set('raven_service', 'live');
}
/**
* Implements hook_uninstall().
*/
function raven_uninstall() {
// Delete set variables
variable_del('raven_login_override');
variable_del('raven_backdoor_login');
variable_del('raven_website_description');
variable_del('raven_login_fail_redirect');
variable_del('raven_logout_on_browser_close');
variable_del('raven_override_administrator_approval');
variable_del('raven_allow_raven_for_life');
variable_del('raven_service');
// Delete authmap entries
db_delete('authmap')
->condition('module', 'raven')
->execute();
}
/**
* Set the Raven for Life variable.
*/
function raven_update_7100() {
if (NULL !== variable_get('raven_allow_raven_for_life')) {
return;
}
variable_set('raven_allow_raven_for_life', FALSE);
}
/**
* Set the Raven service variable.
*/
function raven_update_7101() {
if (NULL !== variable_get('raven_service')) {
return;
}
variable_set('raven_service', 'live');
}