2007-01-04 04:52:42 +00:00
< ?php
2006-01-16 05:21:50 +00:00
2007-01-04 04:52:42 +00:00
// Is Auth/RADIUS really there?
2008-12-12 04:44:53 +00:00
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 > ';
2007-02-20 17:03:36 +00:00
}
2007-01-04 04:52:42 +00:00
// set to defaults if undefined
if (!isset($config->host)) {
$config->host = '127.0.0.1';
}
if (!isset($config->nasport)) {
$config->nasport = '1812';
}
2008-12-12 04:44:53 +00:00
if (!isset($config->radiustype)) {
$config->radiustype = 'PAP';
}
2007-01-04 04:52:42 +00:00
if (!isset($config->secret)) {
$config->secret = '';
}
if (!isset($config->changepasswordurl)) {
$config->changepasswordurl = '';
}
2006-01-16 05:21:50 +00:00
?>
2007-04-20 07:54:42 +00:00
< table cellspacing = "0" cellpadding = "5" border = "0" >
2007-01-04 04:52:42 +00:00
< tr valign = "top" >
2012-07-27 18:12:47 +08:00
< td align = "right" > < label for = "host" > <?php print_string('auth_radiushost_key', 'auth_radius') ?> : < / label > < / td >
2006-01-16 05:21:50 +00:00
< td >
2012-07-27 18:12:47 +08:00
< input name = "host" id = "host" type = "text" size = "30" value = "<?php echo $config->host ?>" / >
2007-01-04 04:52:42 +00:00
< ?php
if (isset($err['host'])) {
2009-08-20 13:14:05 +00:00
echo $OUTPUT->error_text($err['host']);
2007-01-04 04:52:42 +00:00
}
?>
< / td >
2009-06-11 03:34:46 +00:00
< td > <?php print_string('auth_radiushost', 'auth_radius') ?> < / td >
2007-01-04 04:52:42 +00:00
< / tr >
< tr valign = "top" >
2012-07-27 18:12:47 +08:00
< td align = "right" > < label for = "nasport" > <?php print_string('auth_radiusnasport_key', 'auth_radius') ?> : < / label > < / td >
2006-01-16 05:21:50 +00:00
< td >
2012-07-27 18:12:47 +08:00
< input name = "nasport" id = "nasport" type = "text" size = "6" value = "<?php echo $config->nasport ?>" / >
2007-01-04 04:52:42 +00:00
< ?php
2007-02-20 17:03:36 +00:00
2007-01-04 04:52:42 +00:00
if (isset($err['nasport'])) {
2009-08-20 13:14:05 +00:00
echo $OUTPUT->error_text($err['nasport']);
2007-01-04 04:52:42 +00:00
}
2007-02-20 17:03:36 +00:00
2007-01-04 04:52:42 +00:00
?>
2006-01-16 05:21:50 +00:00
< / td >
2009-06-11 03:34:46 +00:00
< td > <?php print_string('auth_radiusnasport', 'auth_radius') ?> < / td >
2007-01-04 04:52:42 +00:00
< / tr >
2006-01-16 05:21:50 +00:00
2008-12-12 04:44:53 +00:00
< tr valign = "top" >
2015-10-02 16:34:14 -07:00
< td align = "right" > <?php echo html_writer::label(get_string('auth_radiustype_key', 'auth_radius') . ':', 'menuradiustype'); ?> < / td >
2008-12-12 04:44:53 +00:00
< td >
< ?php
$radiustype = array();
2009-06-11 03:34:46 +00:00
$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');
2010-01-16 18:29:51 +00:00
echo html_writer::select($radiustype, 'radiustype', $config->radiustype, false);
2008-12-12 04:44:53 +00:00
if (isset($err['radiustype'])) {
2009-08-20 13:14:05 +00:00
echo $OUTPUT->error_text($err['radiustype']);
2008-12-12 04:44:53 +00:00
}
?>
< / td >
2009-06-11 03:34:46 +00:00
< td > <?php print_string('auth_radiustype', 'auth_radius') ?> < / td >
2008-12-12 04:44:53 +00:00
< / tr >
2007-01-04 04:52:42 +00:00
< tr valign = "top" >
2012-07-27 18:12:47 +08:00
< td align = "right" > < label for = "secret" > <?php print_string('auth_radiussecret_key', 'auth_radius') ?> : < / label > < / td >
2006-01-16 05:21:50 +00:00
< td >
2012-07-27 18:12:47 +08:00
< input name = "secret" id = "secret" type = "text" size = "6" value = "<?php echo $config->secret ?>" / >
2007-01-04 04:52:42 +00:00
< ?php
2007-02-20 17:03:36 +00:00
2007-01-04 04:52:42 +00:00
if (isset($err['secret'])) {
2009-08-20 13:14:05 +00:00
echo $OUTPUT->error_text($err['secret']);
2007-01-04 04:52:42 +00:00
}
2007-01-11 01:41:44 +00:00
2007-01-04 04:52:42 +00:00
?>
2006-01-16 05:21:50 +00:00
< / td >
2009-06-11 03:34:46 +00:00
< td > <?php print_string('auth_radiussecret', 'auth_radius') ?> < / td >
2007-01-04 04:52:42 +00:00
< / tr >
< tr valign = "top" >
2012-07-27 18:12:47 +08:00
< td align = "right" > < label for = "changepasswordurl" > <?php print_string('auth_radiuschangepasswordurl_key', 'auth_radius') ?> : < / label > < / td >
2006-01-16 05:21:50 +00:00
< td >
2012-07-27 18:12:47 +08:00
< input name = "changepasswordurl" id = "changepasswordurl" type = "text" value = "<?php echo $config->changepasswordurl ?>" / >
2007-01-04 04:52:42 +00:00
< ?php
if (isset($err['changepasswordurl'])) {
2009-08-20 13:14:05 +00:00
echo $OUTPUT->error_text($err['changepasswordurl']);
2007-01-04 04:52:42 +00:00
}
?>
2006-01-16 05:21:50 +00:00
< / td >
2007-01-04 04:52:42 +00:00
< td > <?php print_string('changepasswordhelp', 'auth') ?> < / td >
< / tr >
2006-01-16 05:21:50 +00:00
2007-01-04 04:52:42 +00:00
< / table >