forked from catalyst/moodle-tool_emailutils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.php
103 lines (92 loc) · 3.42 KB
/
settings.php
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
99
100
101
102
103
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Add admin settings
*
* @package tool_emailutils
* @copyright 2018 onwards Catalyst IT {@link http://www.catalyst-eu.net/}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @author Harry Barnard <[email protected]>
*/
defined('MOODLE_INTERNAL') || die;
if ($hassiteconfig) {
$ADMIN->add('tools', new admin_category(
'tool_emailutils',
new lang_string('pluginname', 'tool_emailutils')
));
$ADMIN->add('email', new admin_externalpage(
'tool_emailutils_dkim',
new lang_string('dkimmanager', 'tool_emailutils'),
new moodle_url('/admin/tool/emailutils/dkim.php')
));
$ADMIN->add('tool_emailutils', new admin_externalpage(
'tool_emailutils_list',
new lang_string('list', 'tool_emailutils'),
new moodle_url('/admin/tool/emailutils/index.php')
));
// DNS check settings.
$settings = new admin_settingpage(
'tool_emailutils_dns',
new lang_string('dnssettings', 'tool_emailutils')
);
$settings->add(new admin_setting_configtext(
'tool_emailutils/dnsspfinclude',
new lang_string('dnsspfinclude', 'tool_emailutils'),
new lang_string('dnsspfinclude_help', 'tool_emailutils'),
'')
);
$ADMIN->add('tool_emailutils', $settings);
// Plugin Settings Page.
$settings = new admin_settingpage(
'tool_emailutils_options',
new lang_string('settings', 'tool_emailutils')
);
// Enable Endpoint.
$settings->add(new admin_setting_configcheckbox(
'tool_emailutils/enabled',
new lang_string('enabled', 'tool_emailutils'),
new lang_string('enabled_help', 'tool_emailutils'),
0)
);
// Auth Settings.
$settings->add(new admin_setting_heading(
'authorisation',
new lang_string('authorisationcategory', 'tool_emailutils'),
'')
);
// Auth Header.
$settings->add(new admin_setting_configtext(
'tool_emailutils/authorisation_header',
new lang_string('header', 'tool_emailutils'),
new lang_string('header_help', 'tool_emailutils'),
'WWW-Authenticate: Basic realm="SNS Client"')
);
// Auth Username.
$settings->add(new admin_setting_configtext(
'tool_emailutils/authorisation_username',
new lang_string('username', 'tool_emailutils'),
new lang_string('username_help', 'tool_emailutils'),
null)
);
// Auth Password.
$settings->add(new \tool_emailutils\admin_setting_configpasswordhashed(
'tool_emailutils/authorisation_password',
new lang_string('password', 'tool_emailutils'),
new lang_string('password_help', 'tool_emailutils'),
null)
);
$ADMIN->add('tool_emailutils', $settings);
}