Commit b5cd617e authored by Ad Schellevis's avatar Ad Schellevis

(legacy) quick refactor of vpn_pptp.php

parent bec1cc37
<?php <?php
/* /*
Copyright (C) 2014-2015 Deciso B.V. Copyright (C) 2014-2016 Deciso B.V.
Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>. Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
All rights reserved. All rights reserved.
...@@ -41,31 +41,31 @@ if (!is_array($config['pptpd']['radius'])) { ...@@ -41,31 +41,31 @@ if (!is_array($config['pptpd']['radius'])) {
} }
$pptpcfg = &$config['pptpd']; $pptpcfg = &$config['pptpd'];
$pconfig['remoteip'] = $pptpcfg['remoteip']; if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$pconfig['localip'] = $pptpcfg['localip']; $pconfig['remoteip'] = $pptpcfg['remoteip'];
$pconfig['redir'] = $pptpcfg['redir']; $pconfig['localip'] = $pptpcfg['localip'];
$pconfig['mode'] = $pptpcfg['mode']; $pconfig['redir'] = $pptpcfg['redir'];
$pconfig['wins'] = $pptpcfg['wins']; $pconfig['mode'] = $pptpcfg['mode'];
$pconfig['req128'] = isset($pptpcfg['req128']); $pconfig['wins'] = $pptpcfg['wins'];
$pconfig['n_pptp_units'] = $pptpcfg['n_pptp_units']; $pconfig['req128'] = isset($pptpcfg['req128']);
$pconfig['pptp_dns1'] = $pptpcfg['dns1']; $pconfig['n_pptp_units'] = $pptpcfg['n_pptp_units'];
$pconfig['pptp_dns2'] = $pptpcfg['dns2']; $pconfig['pptp_dns1'] = $pptpcfg['dns1'];
$pconfig['radiusenable'] = isset($pptpcfg['radius']['server']['enable']); $pconfig['pptp_dns2'] = $pptpcfg['dns2'];
$pconfig['radiusissueips'] = isset($pptpcfg['radius']['radiusissueips']); $pconfig['radiusenable'] = isset($pptpcfg['radius']['server']['enable']);
$pconfig['radiussecenable'] = isset($pptpcfg['radius']['server2']['enable']); $pconfig['radiusissueips'] = isset($pptpcfg['radius']['radiusissueips']);
$pconfig['radacct_enable'] = isset($pptpcfg['radius']['accounting']); $pconfig['radiussecenable'] = isset($pptpcfg['radius']['server2']['enable']);
$pconfig['radiusserver'] = $pptpcfg['radius']['server']['ip']; $pconfig['radacct_enable'] = isset($pptpcfg['radius']['accounting']);
$pconfig['radiusserverport'] = $pptpcfg['radius']['server']['port']; $pconfig['radiusserver'] = $pptpcfg['radius']['server']['ip'];
$pconfig['radiusserveracctport'] = $pptpcfg['radius']['server']['acctport']; $pconfig['radiusserverport'] = $pptpcfg['radius']['server']['port'];
$pconfig['radiussecret'] = $pptpcfg['radius']['server']['secret']; $pconfig['radiusserveracctport'] = $pptpcfg['radius']['server']['acctport'];
$pconfig['radiusserver2'] = $pptpcfg['radius']['server2']['ip']; $pconfig['radiussecret'] = $pptpcfg['radius']['server']['secret'];
$pconfig['radiusserver2port'] = $pptpcfg['radius']['server2']['port']; $pconfig['radiusserver2'] = $pptpcfg['radius']['server2']['ip'];
$pconfig['radiusserver2acctport'] = $pptpcfg['radius']['server2']['acctport']; $pconfig['radiusserver2port'] = $pptpcfg['radius']['server2']['port'];
$pconfig['radiussecret2'] = $pptpcfg['radius']['server2']['secret2']; $pconfig['radiusserver2acctport'] = $pptpcfg['radius']['server2']['acctport'];
$pconfig['radius_acct_update'] = $pptpcfg['radius']['acct_update']; $pconfig['radiussecret2'] = $pptpcfg['radius']['server2']['secret2'];
$pconfig['radius_nasip'] = $pptpcfg['radius']['nasip']; $pconfig['radius_acct_update'] = $pptpcfg['radius']['acct_update'];
$pconfig['radius_nasip'] = $pptpcfg['radius']['nasip'];
if ($_POST) { } elseif ($_SERVER['REQUEST_METHOD'] === 'POST') {
if (isset($input_errors) && count($input_errors) > 0) { if (isset($input_errors) && count($input_errors) > 0) {
unset($input_errors); unset($input_errors);
} }
...@@ -197,112 +197,16 @@ if ($_POST) { ...@@ -197,112 +197,16 @@ if ($_POST) {
} }
$service_hook = 'pptpd'; $service_hook = 'pptpd';
legacy_html_escape_form_data($pconfig);
include("head.inc"); include("head.inc");
?> ?>
<body> <body>
<?php include("fbegin.inc"); ?> <?php include("fbegin.inc"); ?>
<script type="text/javascript">
//<![CDATA[
function get_radio_value(obj)
{
for (i = 0; i < obj.length; i++) {
if (obj[i].checked)
return obj[i].value;
}
return null;
}
function enable_change(enable_over) {
if ((get_radio_value(document.iform.mode) == "server") || enable_over) {
document.iform.remoteip.disabled = 0;
document.iform.localip.disabled = 0;
document.iform.req128.disabled = 0;
document.iform.radiusenable.disabled = 0;
document.iform.radiusissueips.disabled = 0;
document.iform.wins.disabled = 0;
document.iform.n_pptp_units.disabled = 0;
document.iform.pptp_dns1.disabled = 0;
document.iform.pptp_dns2.disabled = 0;
if (document.iform.radiusenable.checked || enable_over) {
document.iform.radiussecenable.disabled = 0;
document.iform.radacct_enable.disabled = 0;
document.iform.radiusserver.disabled = 0;
document.iform.radiusserverport.disabled = 0;
document.iform.radiusserveracctport.disabled = 0;
document.iform.radiussecret.disabled = 0;
document.iform.radius_nasip.disabled = 0;
document.iform.radius_acct_update.disabled = 0;
document.iform.radiusissueips.disabled = 0;
if (document.iform.radiussecenable.checked || enable_over) {
document.iform.radiusserver2.disabled = 0;
document.iform.radiussecret2.disabled = 0;
document.iform.radiusserver2port.disabled = 0;
document.iform.radiusserver2acctport.disabled = 0;
} else {
document.iform.radiusserver2.disabled = 1;
document.iform.radiussecret2.disabled = 1;
document.iform.radiusserver2port.disabled = 1;
document.iform.radiusserver2acctport.disabled = 1;
}
} else {
document.iform.radacct_enable.disabled = 1;
document.iform.radiusserver.disabled = 1;
document.iform.radiusserverport.disabled = 1;
document.iform.radiusissueips.disabled = 1;
document.iform.radiusserveracctport.disabled = 1;
document.iform.radiussecret.disabled = 1;
document.iform.radius_nasip.disabled = 1;
document.iform.radius_acct_update.disabled = 1;
document.iform.radiusissueips.disabled = 1;
document.iform.radiusserver2.disabled = 1;
document.iform.radiussecret2.disabled = 1;
document.iform.radiusserver2port.disabled = 1;
document.iform.radiusserver2acctport.disabled = 1;
}
} else {
document.iform.remoteip.disabled = 1;
document.iform.localip.disabled = 1;
document.iform.req128.disabled = 1;
document.iform.n_pptp_units.disabled = 1;
document.iform.pptp_dns1.disabled = 1;
document.iform.pptp_dns2.disabled = 1;
document.iform.radiusenable.disabled = 1;
document.iform.radacct_enable.disabled = 1;
document.iform.radiusserver.disabled = 1;
document.iform.radiusserverport.disabled = 1;
document.iform.radiusissueips.disabled = 1;
document.iform.radiusserveracctport.disabled = 1;
document.iform.radiussecret.disabled = 1;
document.iform.radius_nasip.disabled = 1;
document.iform.radius_acct_update.disabled = 1;
document.iform.radiussecenable.disabled = 1;
document.iform.radiusserver2.disabled = 1;
document.iform.radiusserver2port.disabled = 1;
document.iform.radiusserver2acctport.disabled = 1;
document.iform.radiussecret2.disabled = 1;
document.iform.wins.disabled = 1;
document.iform.radiusissueips.disabled = 1;
}
if ((get_radio_value(document.iform.mode) == "redir") || enable_over) {
document.iform.redir.disabled = 0;
} else {
document.iform.redir.disabled = 1;
}
}
//]]>
</script>
<section class="page-content-main"> <section class="page-content-main">
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<?php if (isset($input_errors) && count($input_errors) > 0) { <?php if (isset($input_errors) && count($input_errors) > 0) {
print_input_errors($input_errors); print_input_errors($input_errors);
} ?> } ?>
...@@ -319,54 +223,48 @@ function enable_change(enable_over) { ...@@ -319,54 +223,48 @@ function enable_change(enable_over) {
gettext('Read more') . '</a>.', gettext('Read more') . '</a>.',
'danger' 'danger'
); ?> ); ?>
<section class="col-xs-12"> <section class="col-xs-12">
<div class="tab-content content-box col-xs-12"> <div class="tab-content content-box col-xs-12">
<form method="post" name="iform" id="iform">
<form action="vpn_pptp.php" method="post" name="iform" id="iform">
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped table-sort"> <table class="table table-striped">
<tr> <tr>
<td width="22%" valign="top" class="vtable">&nbsp;</td> <td width="22%"><b><?=gettext("PPTP settings"); ?></b></td>
<td width="78%" class="vtable"> <td width="78%" align="right">
<input name="mode" type="radio" onclick="enable_change(false)" value="off" <small><?=gettext("full help"); ?> </small>
<?php if (($pconfig['mode'] != "server") && ($pconfig['mode'] != "redir")) { <i class="fa fa-toggle-off text-danger" style="cursor: pointer;" id="show_all_help_page" type="button"></i>
echo "checked=\"checked\""; </td>
}?> />
<?=gettext("Off"); ?></td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vtable">&nbsp;</td> <td></td>
<td width="78%" class="vtable"> <td>
<input name="mode" type="radio" value="off" <?=(($pconfig['mode'] != "server") && ($pconfig['mode'] != "redir")) ? "checked=\"checked\"" : "";?>/>
<input type="radio" name="mode" value="redir" onclick="enable_change(false)" <?php if ($pconfig['mode'] == "redir") { <?=gettext("Off"); ?><br/>
echo "checked=\"checked\""; <input type="radio" name="mode" value="redir" <?=($pconfig['mode'] == "redir") ? "checked=\"checked\"" : "";?>/>
} ?> /> <?=gettext("Redirect incoming PPTP connections to");?>:
<?=gettext("Redirect incoming PPTP connections to");?>:</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("PPTP redirection");?></td> <td><a id="help_for_redir" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("PPTP redirection");?></td>
<td width="78%" class="vtable"> <td>
<input name="redir" type="text" class="form-control unknown" id="redir" size="20" value="<?=htmlspecialchars($pconfig['redir']);?>" /> <input name="redir" type="text" id="redir" value="<?=$pconfig['redir'];?>" />
<br /> <div class="hidden" for="help_for_redir">
<?=gettext("Enter the IP address of a host which will accept incoming " . <?=gettext("Enter the IP address of a host which will accept incoming PPTP connections."); ?>
"PPTP connections"); ?>.</td> </div>
</td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vtable">&nbsp;</td> <td></td>
<td width="78%" class="vtable"> <td>
<input type="radio" name="mode" value="server" onclick="enable_change(false)" <?php if ($pconfig['mode'] == "server") { <input type="radio" name="mode" value="server" <?=($pconfig['mode'] == "server") ? "checked=\"checked\"" : "";?>/>
echo "checked=\"checked\""; <?=gettext("Enable PPTP server"); ?>
} ?> /> </td>
<?=gettext("Enable PPTP server"); ?></td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("No. PPTP users"); ?></td> <td><a id="help_for_n_pptp_units" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("No. PPTP users"); ?></td>
<td width="78%" class="vtable"> <td>
<select id="n_pptp_units" name="n_pptp_units"> <select id="n_pptp_units" name="n_pptp_units">
<?php <?php
$toselect = ($pconfig['n_pptp_units'] > 0) ? $pconfig['n_pptp_units'] : 16; $toselect = ($pconfig['n_pptp_units'] > 0) ? $pconfig['n_pptp_units'] : 16;
for ($x=1; $x<255; $x++) { for ($x=1; $x<255; $x++) {
if ($x == $toselect) { if ($x == $toselect) {
...@@ -378,160 +276,190 @@ function enable_change(enable_over) { ...@@ -378,160 +276,190 @@ function enable_change(enable_over) {
} }
?> ?>
</select> </select>
<br /><?=gettext("Hint: 10 is ten PPTP clients"); ?> <div class="hidden" for="help_for_n_pptp_units">
<?=gettext("Hint: 10 is ten PPTP clients"); ?>
</div>
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Server address"); ?></td> <td><a id="help_for_localip" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Server address"); ?></td>
<td width="78%" class="vtable"> <td>
<input name="localip" type="text" class="form-control unknown" id="localip" size="20" value="<?=htmlspecialchars($pconfig['localip']);?>" /> <input name="localip" type="text" id="localip" value="<?=$pconfig['localip'];?>" />
<div class="hidden" for="help_for_localip">
<?=gettext("Enter the IP address the PPTP server should give to clients for use as their \"gateway\"."); ?>
<br /> <br />
<?=gettext("Enter the IP address the PPTP server should give to clients for use as their \"gateway\""); ?>. <?=gettext("Typically this is set to an unused IP just outside of the client range."); ?>
<br /> <br />
<?=gettext("Typically this is set to an unused IP just outside of the client range"); ?>.
<br /> <br />
<br /> <?=gettext("NOTE: This should NOT be set to any IP address currently in use on this firewall."); ?>
<?=gettext("NOTE: This should NOT be set to any IP address currently in use on this firewall"); ?>.</td> </div>
</td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Remote address " . <td><a id="help_for_remoteip" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Remote address range"); ?></td>
"range"); ?></td> <td>
<td width="78%" class="vtable"> <input name="remoteip" type="text" id="remoteip" value="<?=htmlspecialchars($pconfig['remoteip']);?>" />
<input name="remoteip" type="text" class="form-control unknown" id="remoteip" size="20" value="<?=htmlspecialchars($pconfig['remoteip']);?>" /> <div class="hidden" for="help_for_remoteip">
<br /> <?=gettext("Specify the starting address for the client IP subnet."); ?>
<?=gettext("Specify the starting address for the client IP subnet"); ?>.<br /> </div>
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncell"><?=gettext("PPTP DNS Servers"); ?></td> <td><a id="help_for_pptp_dns" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("PPTP DNS Servers"); ?></td>
<td width="78%" class="vtable"> <td>
<input name="pptp_dns1" type="text" class="form-control unknown" id="pptp_dns1" size="20" value="<?=htmlspecialchars($pconfig['pptp_dns1']);?>" /> <input name="pptp_dns1" type="text" id="pptp_dns1" value="<?=$pconfig['pptp_dns1'];?>" /><br />
<br /> <input name="pptp_dns2" type="text" id="pptp_dns2" value="<?=$pconfig['pptp_dns2'];?>" />
<input name="pptp_dns2" type="text" class="form-control unknown" id="pptp_dns2" size="20" value="<?=htmlspecialchars($pconfig['pptp_dns2']);?>" /> <div class="hidden" for="help_for_pptp_dns">
<br /> <?=gettext("primary and secondary DNS servers assigned to PPTP clients"); ?>
<?=gettext("primary and secondary DNS servers assigned to PPTP clients"); ?><br /> </div>
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncell"><?=gettext("WINS Server"); ?></td> <td><i class="fa fa-info-circle text-muted"></i> <?=gettext("WINS Server"); ?></td>
<td width="78%" valign="top" class="vtable"> <td>
<input name="wins" class="form-control unknown" id="wins" size="20" value="<?=htmlspecialchars($pconfig['wins']);?>" /> <input name="wins" type="text" id="wins" value="<?=htmlspecialchars($pconfig['wins']);?>" />
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncell"><?=gettext("RADIUS"); ?></td> <td><a id="help_for_radius" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("RADIUS"); ?></td>
<td width="78%" class="vtable"> <td>
<input name="radiusenable" type="checkbox" id="radiusenable" onclick="enable_change(false)" value="yes" <?php if ($pconfig['radiusenable']) { <input name="radiusenable" type="checkbox" id="radiusenable" value="yes" <?=($pconfig['radiusenable']) ? "checked=\"checked\"" : "";?>/>
echo "checked=\"checked\""; <strong><?=gettext("Use a RADIUS server for authentication"); ?></strong><br/>
} ?> /> <div class="hidden" for="help_for_radius">
<strong><?=gettext("Use a RADIUS server for authentication"); ?></strong><br />
<?=gettext("When set, all users will be authenticated using " . <?=gettext("When set, all users will be authenticated using " .
"the RADIUS server specified below. The local user database " . "the RADIUS server specified below. The local user database " .
"will not be used"); ?>.<br /> "will not be used."); ?>
<br /> </div>
<input name="radacct_enable" type="checkbox" id="radacct_enable" onclick="enable_change(false)" value="yes" <?php if ($pconfig['radacct_enable']) { <input name="radacct_enable" type="checkbox" id="radacct_enable" value="yes" <?=($pconfig['radacct_enable']) ? "checked=\"checked\"" : "";?>/>
echo "checked=\"checked\""; <strong><?=gettext("Enable RADIUS accounting"); ?></strong><br/>
} ?> /> <div class="hidden" for="help_for_radius">
<strong><?=gettext("Enable RADIUS accounting"); ?> <br /> <?=gettext("Sends accounting packets to the RADIUS server."); ?>
</strong><?=gettext("Sends accounting packets to the RADIUS server"); ?>.<br /> </div>
<br /> <input name="radiussecenable" type="checkbox" id="radiussecenable" value="yes" <?=($pconfig['radiussecenable']) ? "checked=\"checked\"" : "";?>/>
<input name="radiussecenable" type="checkbox" id="radiussecenable" onclick="enable_change(false)" value="yes" <?php if ($pconfig['radiussecenable']) {
echo "checked=\"checked\"";
} ?> />
<strong><?=gettext("Secondary RADIUS server for failover authentication"); ?></strong><br /> <strong><?=gettext("Secondary RADIUS server for failover authentication"); ?></strong><br />
<?=gettext("When set, all requests will go to the secondary server when primary fails"); ?><br /> <div class="hidden" for="help_for_radius">
<br /> <?=gettext("When set, all requests will go to the secondary server when primary fails"); ?>
<input name="radiusissueips" value="yes" type="checkbox" class="form-control" id="radiusissueips"<?php if ($pconfig['radiusissueips']) { </div>
echo " checked=\"checked\""; <input name="radiusissueips" value="yes" type="checkbox" id="radiusissueips"<?=($pconfig['radiusissueips']) ? " checked=\"checked\"" : "";?>/>
} ?> />
<strong><?=gettext("RADIUS issued IPs"); ?></strong> <strong><?=gettext("RADIUS issued IPs"); ?></strong>
<br /><?=gettext("Issue IP addresses via RADIUS server"); ?>. <div class="hidden" for="help_for_radius">
<?=gettext("Issue IP addresses via RADIUS server."); ?>
</div>
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncell"><?=gettext("RADIUS NAS IP"); ?></td> <td><i class="fa fa-info-circle text-muted"></i> <?=gettext("RADIUS NAS IP"); ?></td>
<td width="78%" valign="top" class="vtable"> <td>
<input name="radius_nasip" class="form-control unknown" id="radius_nasip" size="20" value="<?=htmlspecialchars($pconfig['radius_nasip']);?>" /> <input name="radius_nasip" type="text" id="radius_nasip" value="<?=$pconfig['radius_nasip'];?>" />
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncell"><?=gettext("RADIUS Accounting Update"); ?></td> <td><a id="help_for_radius_acct_update" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("RADIUS Accounting Update"); ?></td>
<td width="78%" valign="top" class="vtable"> <td>
<input name="radius_acct_update" class="form-control unknown" id="radius_acct_update" size="20" value="<?=htmlspecialchars($pconfig['radius_acct_update']);?>" /> <input name="radius_acct_update" type="text" id="radius_acct_update" value="<?=$pconfig['radius_acct_update'];?>" />
<div class="hidden" for="help_for_radius_acct_update">
<?=gettext("RADIUS accounting update period in seconds"); ?>
</div>
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncell"><?=gettext("RADIUS Server"); ?> </td> <td><a id="help_for_radiusserver" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("RADIUS server Primary"); ?></td>
<td width="78%" class="vtable"> <td>
<input name="radiusserver" type="text" class="form-control unknown" id="radiusserver" size="20" value="<?=htmlspecialchars($pconfig['radiusserver']);?>" /> <table class="table table-condensed">
<input name="radiusserverport" type="text" class="form-control unknown" id="radiusserverport" size="4" value="<?=htmlspecialchars($pconfig['radiusserverport']);?>" /> <thead>
<input name="radiusserveracctport" type="text" class="form-control unknown" id="radiusserveracctport" size="4" value="<?=htmlspecialchars($pconfig['radiusserveracctport']);?>" /> <tr>
<br /> <th><?=gettext("Server");?></th>
<?=gettext("Enter the IP address, RADIUS port, and RADIUS accounting port of the RADIUS server"); ?>.</td> <th><?=gettext("Port");?></th>
<th><?=gettext("AccPort");?></th>
</tr> </tr>
</thead>
<tbody>
<tr> <tr>
<td width="22%" valign="top" class="vncell"><?=gettext("RADIUS shared secret"); ?></td> <td><input name="radiusserver" type="text" value="<?=$pconfig['radiusserver'];?>" /></td>
<td width="78%" valign="top" class="vtable"> <td><input name="radiusserverport" type="text" value="<?=$pconfig['radiusserverport'];?>" /></td>
<input name="radiussecret" type="password" class="form-control pwd" id="radiussecret" size="20" value="<?=htmlspecialchars($pconfig['radiussecret']);?>" /> <td><input name="radiusserveracctport" type="text" value="<?=$pconfig['radiusserveracctport'];?>" /></td>
<br /> </tr>
</tbody>
</table>
<div class="hidden" for="help_for_radiusserver">
<?=gettext("Enter the IP address, authentication port and accounting port (optional) of the RADIUS server."); ?><br />
<br /> <?=gettext("standard port 1812 and 1813 accounting"); ?>
</div>
</td>
</tr>
<tr>
<td><a id="help_for_radiussecret" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("RADIUS primary shared secret"); ?></td>
<td>
<input name="radiussecret" type="password" value="<?=$pconfig['radiussecret'];?>" />
<div class="hidden" for="help_for_radiussecret">
<?=gettext("Enter the shared secret that will be used to authenticate " . <?=gettext("Enter the shared secret that will be used to authenticate " .
"to the RADIUS server"); ?>.</td> "to the RADIUS server"); ?>.
</div>
</td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Secondary RADIUS server"); ?> </td> <td><a id="help_for_radiusserver2" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("RADIUS server Secondary"); ?></td>
<td width="78%" class="vtable"> <td>
<input name="radiusserver2" type="text" class="form-control unknown" id="radiusserver2" size="20" value="<?=htmlspecialchars($pconfig['radiusserver2']);?>" /> <table class="table table-condensed">
<input name="radiusserver2port" type="text" class="form-control unknown" id="radiusserver2port" size="4" value="<?=htmlspecialchars($pconfig['radiusserver2port']);?>" /> <thead>
<input name="radiusserver2acctport" type="text" class="form-control unknown" id="radiusserver2acctport" size="4" value="<?=htmlspecialchars($pconfig['radiusserver2acctport']);?>" /> <tr>
<br /> <th><?=gettext("Server");?></th>
<?=gettext("Enter the IP address, RADIUS port, and RADIUS accounting port of the RADIUS server"); ?>.</td> <th><?=gettext("Port");?></th>
<th><?=gettext("AccPort");?></th>
</tr> </tr>
</thead>
<tbody>
<tr> <tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Secondary RADIUS shared secret"); ?></td> <td><input name="radiusserver2" type="text" value="<?=$pconfig['radiusserver2'];?>" /></td>
<td width="78%" valign="top" class="vtable"> <td><input name="radiusserver2port" type="text" value="<?=$pconfig['radiusserver2port'];?>" /></td>
<input name="radiussecret2" type="password" class="form-control pwd" id="radiussecret2" size="20" value="<?=htmlspecialchars($pconfig['radiussecret2']);?>" /> <td><input name="radiusserver2acctport" type="text" value="<?=$pconfig['radiusserver2acctport'];?>" /></td>
<br /> </tr>
<?=gettext("Enter the shared secret that will be used to authenticate " . </tbody>
"to the secondary RADIUS server"); ?>.</td> </table>
<div class="hidden" for="help_for_radiusserver2">
<?=gettext("Enter the IP address, authentication port and accounting port (optional) of the backup RADIUS server."); ?><br />
<br /> <?=gettext("standard port 1812 and 1813 accounting"); ?>
</div>
</td>
</tr> </tr>
<tr> <tr>
<td height="16" colspan="2" valign="top"></td> <td><a id="help_for_radiussecret2" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("RADIUS secondary shared secret"); ?></td>
<td>
<input name="radiussecret2" type="password" id="radiussecret2" size="20" value="<?=htmlspecialchars($pconfig['radiussecret2']);?>" />
<div class="hidden" for="help_for_radiussecret2">
<?=gettext("Enter the shared secret that will be used to authenticate " ."to the RADIUS server"); ?>.
</div>
</td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="middle">&nbsp;</td> <td><a id="help_for_req128" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Security");?></td>
<td width="78%" class="vtable"> <td>
<input name="req128" type="checkbox" id="req128" value="yes" <?php if ($pconfig['req128']) { <input name="req128" type="checkbox" id="req128" value="yes" <?=($pconfig['req128']) ? "checked=\"checked\"" : "";?> />
echo "checked=\"checked\""; <strong><?=gettext("Require 128-bit encryption"); ?></strong>
} ?> /> <div class="hidden" for="help_for_req128">
<strong><?=gettext("Require 128-bit encryption"); ?></strong><br />
<?=gettext("When set, only 128-bit encryption will be accepted. Otherwise " . <?=gettext("When set, only 128-bit encryption will be accepted. Otherwise " .
"40-bit and 56-bit encryption will be accepted as well. Note that " . "40-bit and 56-bit encryption will be accepted as well. Note that " .
"encryption will always be forced on PPTP connections (i.e. " . "encryption will always be forced on PPTP connections (i.e. " .
"unencrypted connections will not be accepted)"); ?>.</td> "unencrypted connections will not be accepted)."); ?>
</div>
</td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top">&nbsp;</td> <td></td>
<td width="78%"> <td>
<input name="Submit" type="submit" class="btn btn-primary" value="<?=gettext("Save"); ?>" onclick="enable_change(true)" /> <input name="Submit" type="submit" class="btn btn-primary" value="<?=gettext("Save"); ?>" />
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top">&nbsp;</td> <td></td>
<td width="78%"><?=sprintf(gettext("Note: don't forget to %sadd a firewall rule%s to permit traffic from PPTP clients!"),'<a href="firewall_rules.php?if=pptp">','</a>') ?></td> <td><?=sprintf(gettext("Note: don't forget to %sadd a firewall rule%s to permit traffic from PPTP clients!"),'<a href="firewall_rules.php?if=pptp">','</a>') ?></td>
</tr> </tr>
</table> </table>
</div> </div>
</form> </form>
</div> </div>
</section> </section>
</div> </div>
</div> </div>
</section> </section>
<script type="text/javascript">
//<![CDATA[
enable_change(false);
//]]>
</script>
<?php include("foot.inc"); <?php include("foot.inc");
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment