-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtrezor_connect.module
98 lines (84 loc) · 2.82 KB
/
trezor_connect.module
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
95
96
97
98
<?php
/**
* @file
* Provides TREZOR connect functionality.
*/
require_once 'trezor_connect.helpers.inc';
require_once 'trezor_connect.user.inc';
require_once 'trezor_connect.forms.inc';
require_once 'trezor_connect.register.inc';
require_once 'trezor_connect.login.inc';
require_once 'trezor_connect.cron.inc';
require_once 'trezor_connect.theme.inc';
/**
* Implements hook_permission().
*/
function trezor_connect_permission() {
$output = array();
$output[TREZOR_CONNECT_PERMISSION] = array(
'title' => t('Administer TREZOR Connect'),
'description' => t('Administer TREZOR connect functionality.'),
);
$output[TREZOR_CONNECT_PERMISSION_USE] = array(
'title' => t('Use TREZOR Connect'),
'description' => t('Use TREZOR connect functionality.'),
);
return $output;
}
/**
* Implements hook_menu().
*/
function trezor_connect_menu() {
$output = array();
$output[TREZOR_CONNECT_PREFIX] = array(
'title' => 'TREZOR Connect',
'page callback' => 'drupal_get_form',
'page arguments' => array('trezor_connect_admin_form'),
'access arguments' => array(TREZOR_CONNECT_PERMISSION),
'file' => 'trezor_connect.admin.inc',
);
$output[TREZOR_CONNECT_PREFIX . '/settings'] = array(
'title' => 'Settings',
'description' => 'Configure TREZOR connect settings.',
'type' => MENU_DEFAULT_LOCAL_TASK,
);
$output[TREZOR_CONNECT_URL_REGISTER] = array(
'title' => 'Register',
'page callback' => 'trezor_connect_page_callback_register',
'access arguments' => array(TREZOR_CONNECT_PERMISSION_USE),
'type' => MENU_CALLBACK,
);
$output[TREZOR_CONNECT_URL_LOGIN] = array(
'title' => 'Login',
'page callback' => 'trezor_connect_page_callback_login',
'access arguments' => array(TREZOR_CONNECT_PERMISSION_USE),
'type' => MENU_CALLBACK,
);
$output[TREZOR_CONNECT_URL_MANAGE] = array(
'title' => 'Authenticated Devices',
'page callback' => 'drupal_get_form',
'page arguments' => array('trezor_connect_manage_form', 1),
'access arguments' => array(TREZOR_CONNECT_PERMISSION_USE),
'type' => MENU_LOCAL_TASK,
'weight' => 5,
'file' => 'trezor_connect.manage.inc',
);
$output[TREZOR_CONNECT_URL_MANAGE_JS] = array(
'title' => 'Manage',
'page callback' => 'trezor_connect_page_callback_manage',
'page arguments' => array(1),
'access arguments' => array(TREZOR_CONNECT_PERMISSION_USE),
'type' => MENU_CALLBACK,
'file' => 'trezor_connect.manage.inc',
);
$output[TREZOR_CONNECT_URL_MANAGE . '/forget'] = array(
'title' => 'Forget Authenticated Devices',
'page callback' => 'drupal_get_form',
'page arguments' => array('trezor_connect_forget_form', 1),
'access arguments' => array(TREZOR_CONNECT_PERMISSION_USE),
'type' => MENU_CALLBACK,
'weight' => 0,
'file' => 'trezor_connect.manage.inc',
);
return $output;
}