This repository has been archived by the owner on Apr 8, 2022. It is now read-only.
forked from moodle/moodle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.html
114 lines (93 loc) · 3.63 KB
/
config.html
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
104
105
106
107
108
109
110
111
112
113
114
<?php
// Is Auth/RADIUS really there?
if (!extension_loaded('radius')) {
print '<div class="box errorbox errorboxcontent"><p class="errormessage"><strong>Warning: The PHP RADIUS extension is not present. Please ensure it is installed and enabled.</strong></p></div>';
}
include_once 'Auth/RADIUS.php';
if (!class_exists('Auth_RADIUS')) {
print '<div class="box errorbox errorboxcontent"><p class="errormessage"><strong>Warning: There is a problem with the PHP Pear Auth_RADIUS package. Please ensure it is installed correctly.</strong></p></div>';
}
// set to defaults if undefined
if (!isset($config->host)) {
$config->host = '127.0.0.1';
}
if (!isset($config->nasport)) {
$config->nasport = '1812';
}
if (!isset($config->radiustype)) {
$config->radiustype = 'PAP';
}
if (!isset($config->secret)) {
$config->secret = '';
}
if (!isset($config->changepasswordurl)) {
$config->changepasswordurl = '';
}
?>
<table cellspacing="0" cellpadding="5" border="0">
<tr valign="top">
<td align="right"><label for="host"><?php print_string('auth_radiushost_key', 'auth_radius') ?>: </label></td>
<td>
<input name="host" id="host" type="text" size="30" value="<?php echo $config->host ?>" />
<?php
if (isset($err['host'])) {
echo $OUTPUT->error_text($err['host']);
}
?>
</td>
<td><?php print_string('auth_radiushost', 'auth_radius') ?></td>
</tr>
<tr valign="top">
<td align="right"><label for="nasport"><?php print_string('auth_radiusnasport_key', 'auth_radius') ?>: </label></td>
<td>
<input name="nasport" id="nasport" type="text" size="6" value="<?php echo $config->nasport ?>" />
<?php
if (isset($err['nasport'])) {
echo $OUTPUT->error_text($err['nasport']);
}
?>
</td>
<td><?php print_string('auth_radiusnasport', 'auth_radius') ?></td>
</tr>
<tr valign="top" >
<td align="right"><?php echo html_writer::label(get_string('auth_radiustype_key', 'auth_radius'), 'menuradiustype'); ?>: </td>
<td>
<?php
$radiustype = array();
$radiustype['PAP'] = get_string('auth_radiustypepap', 'auth_radius');
$radiustype['CHAP_MD5'] = get_string('auth_radiustypechapmd5', 'auth_radius');
$radiustype['MSCHAPv1'] = get_string('auth_radiustypemschapv1', 'auth_radius');
$radiustype['MSCHAPv2'] = get_string('auth_radiustypemschapv2', 'auth_radius');
echo html_writer::select($radiustype, 'radiustype', $config->radiustype, false);
if (isset($err['radiustype'])) {
echo $OUTPUT->error_text($err['radiustype']);
}
?>
</td>
<td><?php print_string('auth_radiustype', 'auth_radius') ?></td>
</tr>
<tr valign="top" >
<td align="right"><label for="secret"><?php print_string('auth_radiussecret_key', 'auth_radius') ?>: </label></td>
<td>
<input name="secret" id="secret" type="text" size="6" value="<?php echo $config->secret ?>" />
<?php
if (isset($err['secret'])) {
echo $OUTPUT->error_text($err['secret']);
}
?>
</td>
<td><?php print_string('auth_radiussecret', 'auth_radius') ?></td>
</tr>
<tr valign="top">
<td align="right"><label for="changepasswordurl"><?php print_string('auth_radiuschangepasswordurl_key', 'auth_radius') ?>: </label></td>
<td>
<input name="changepasswordurl" id="changepasswordurl" type="text" value="<?php echo $config->changepasswordurl ?>" />
<?php
if (isset($err['changepasswordurl'])) {
echo $OUTPUT->error_text($err['changepasswordurl']);
}
?>
</td>
<td><?php print_string('changepasswordhelp', 'auth') ?></td>
</tr>
</table>