3 // Is Auth/RADIUS really there?
4 if (!extension_loaded('radius')) {
5 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>';
7 include_once 'Auth/RADIUS.php';
8 if (!class_exists('Auth_RADIUS')) {
9 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>';
12 // set to defaults if undefined
13 if (!isset($config->host
)) {
14 $config->host
= '127.0.0.1';
16 if (!isset($config->nasport
)) {
17 $config->nasport
= '1812';
19 if (!isset($config->radiustype
)) {
20 $config->radiustype
= 'PAP';
22 if (!isset($config->secret
)) {
25 if (!isset($config->changepasswordurl
)) {
26 $config->changepasswordurl
= '';
30 <table cellspacing=
"0" cellpadding=
"5" border=
"0">
33 <td align=
"right"><?php print_string('auth_radiushost_key', 'auth_radius') ?>:
</td>
35 <input name=
"host" type=
"text" size=
"30" value=
"<?php echo $config->host ?>" />
38 if (isset($err['host'])) {
39 echo $OUTPUT->error_text($err['host']);
44 <td><?php print_string('auth_radiushost', 'auth_radius') ?></td>
48 <td align=
"right"><?php print_string('auth_radiusnasport_key', 'auth_radius') ?>:
</td>
50 <input name=
"nasport" type=
"text" size=
"6" value=
"<?php echo $config->nasport ?>" />
53 if (isset($err['nasport'])) {
54 echo $OUTPUT->error_text($err['nasport']);
59 <td><?php print_string('auth_radiusnasport', 'auth_radius') ?></td>
63 <td align=
"right"><?php print_string('auth_radiustype_key', 'auth_radius') ?>:
</td>
67 $radiustype = array();
68 $radiustype['PAP'] = get_string('auth_radiustypepap', 'auth_radius');
69 $radiustype['CHAP_MD5'] = get_string('auth_radiustypechapmd5', 'auth_radius');
70 $radiustype['MSCHAPv1'] = get_string('auth_radiustypemschapv1', 'auth_radius');
71 $radiustype['MSCHAPv2'] = get_string('auth_radiustypemschapv2', 'auth_radius');
72 echo html_writer
::select($radiustype, 'radiustype', $config->radiustype
, false);
74 if (isset($err['radiustype'])) {
75 echo $OUTPUT->error_text($err['radiustype']);
80 <td><?php print_string('auth_radiustype', 'auth_radius') ?></td>
85 <td align=
"right"><?php print_string('auth_radiussecret_key', 'auth_radius') ?>:
</td>
87 <input name=
"secret" type=
"text" size=
"6" value=
"<?php echo $config->secret ?>" />
90 if (isset($err['secret'])) {
91 echo $OUTPUT->error_text($err['secret']);
96 <td><?php print_string('auth_radiussecret', 'auth_radius') ?></td>
100 <td align=
"right"><?php print_string('auth_radiuschangepasswordurl_key', 'auth_radius') ?>:
</td>
102 <input name=
"changepasswordurl" type=
"text" value=
"<?php echo $config->changepasswordurl ?>" />
105 if (isset($err['changepasswordurl'])) {
106 echo $OUTPUT->error_text($err['changepasswordurl']);
111 <td><?php print_string('changepasswordhelp', 'auth') ?></td>