summaryrefslogtreecommitdiffstats
path: root/usr/local
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2007-04-29 23:24:39 +0000
committerScott Ullrich <sullrich@pfsense.org>2007-04-29 23:24:39 +0000
commit07cae4b26ec0cddc34efdf89d70bf87c120d6d59 (patch)
treeb72c4269949d026d22af643fc2d315c7f1684bd3 /usr/local
parent28b0b1a76f50182179d25bfea157699a139bddb9 (diff)
downloadpfsense-07cae4b26ec0cddc34efdf89d70bf87c120d6d59.zip
pfsense-07cae4b26ec0cddc34efdf89d70bf87c120d6d59.tar.gz
Switch over to mpd4 Code-submitted-by: alan_AT_radiowave.ie
Diffstat (limited to 'usr/local')
-rwxr-xr-xusr/local/www/vpn_pppoe.php73
-rwxr-xr-xusr/local/www/vpn_pptp.php134
2 files changed, 198 insertions, 9 deletions
diff --git a/usr/local/www/vpn_pppoe.php b/usr/local/www/vpn_pppoe.php
index 92904c5..fa6252d 100755
--- a/usr/local/www/vpn_pppoe.php
+++ b/usr/local/www/vpn_pppoe.php
@@ -43,9 +43,13 @@ $pconfig['radiusenable'] = isset($pppoecfg['radius']['enable']);
$pconfig['radacct_enable'] = isset($pppoecfg['radius']['accounting']);
$pconfig['radiusserver'] = $pppoecfg['radius']['server'];
$pconfig['radiussecret'] = $pppoecfg['radius']['secret'];
+$pconfig['radiusserver2'] = $pppoecfg['radius']['server2'];
+$pconfig['radiussecret2'] = $pppoecfg['radius']['secret2'];
$pconfig['radiusissueips'] = isset($pppoecfg['radius']['radiusissueips']);
$pconfig['n_pppoe_units'] = $pppoecfg['n_pppoe_units'];
$pconfig['pppoe_subnet'] = $pppoecfg['pppoe_subnet'];
+$pconfig['radius_nasip'] = $pppoecfg['radius_nasip'];
+$pconfig['radius_acct_update'] = $pppoecfg['radius_acct_update'];
if ($_POST) {
@@ -109,12 +113,21 @@ if ($_POST) {
$pppoecfg['pppoe_subnet'] = $_POST['pppoe_subnet'];
$pppoecfg['radius']['server'] = $_POST['radiusserver'];
$pppoecfg['radius']['secret'] = $_POST['radiussecret'];
+ $pppoecfg['radius']['server2'] = $_POST['radiusserver2'];
+ $pppoecfg['radius']['secret2'] = $_POST['radiussecret2'];
+ $pppoecfg['radius_nasip'] = $_POST['radius_nasip'];
+ $pppoecfg['radius_acct_update'] = $_POST['radius_acct_update'];
if($_POST['radiusenable'] == "yes")
$pppoecfg['radius']['enable'] = true;
else
unset($pppoecfg['radius']['enable']);
+ if($_POST['radiussecondnas'] == "yes")
+ $pppoecfg['radius']['secenable'] = true;
+ else
+ unset($pppoecfg['radius']['secenable']);
+
if($_POST['radacct_enable'] == "yes")
$pppoecfg['radius']['accounting'] = true;
else
@@ -170,11 +183,25 @@ function enable_change(enable_over) {
document.iform.radiusserver.disabled = 0;
document.iform.radiussecret.disabled = 0;
document.iform.radiusissueips.disabled = 0;
+ document.iform.radius_nasip.disabled = 0;
+ if (document.iform.radiussecondnas.checked || enable_over) {
+ document.iform.radiusserver2.disabled = 0;
+ document.iform.radiussecret2.disabled = 0;
+ document.iform.radiusissueips.disabled = 0;
+ document.iform.radius_nasip.disabled = 0;
+ document.iform.radius_acct_update = 0;
+ } else {
+
+ document.iform.radiusserver2.disabled = 1;
+ document.iform.radiussecret2.disabled = 1;
+ }
} else {
document.iform.radacct_enable.disabled = 1;
document.iform.radiusserver.disabled = 1;
document.iform.radiussecret.disabled = 1;
document.iform.radiusissueips.disabled = 1;
+ document.iform.radius_nasip.disabled = 1;
+ document.iform.radius_acct_update = 1;
}
} else {
document.iform.interface.disabled = 1;
@@ -186,7 +213,11 @@ function enable_change(enable_over) {
document.iform.radacct_enable.disabled = 1;
document.iform.radiusserver.disabled = 1;
document.iform.radiussecret.disabled = 1;
+ document.iform.radiusserver2.disabled = 1;
+ document.iform.radiussecret2.disabled = 1;
document.iform.radiusissueips.disabled = 1;
+ document.iform.radius_nasip.disabled = 1;
+ document.iform.radius_acct_update = 1;
}
}
//-->
@@ -307,20 +338,57 @@ function enable_change(enable_over) {
</strong>Sends accounting packets to the RADIUS server.</td>
</tr>
<tr>
- <td width="22%" valign="top" class="vncell">RADIUS server </td>
+ <td width="22%" valign="top" class="vncell">RADIUS server Primary</td>
<td width="78%" class="vtable">
<input name="radiusserver" type="text" class="formfld" id="radiusserver" size="20" value="<?=htmlspecialchars($pconfig['radiusserver']);?>">
<br>
Enter the IP address of the RADIUS server.</td>
</tr>
<tr>
- <td width="22%" valign="top" class="vncell">RADIUS shared secret</td>
+ <td width="22%" valign="top" class="vncell">RADIUS primary shared secret</td>
<td width="78%" valign="top" class="vtable">
<input name="radiussecret" type="password" class="formfld" id="radiussecret" size="20" value="<?=htmlspecialchars($pconfig['radiussecret']);?>">
<br>
Enter the shared secret that will be used to authenticate
to the RADIUS server.</td>
</tr>
+ <td width="78%" class="vtable">
+ <input name="radiussecondnas" type="checkbox" id="radiussecondnas" onclick="enable_change(false)" value="yes" <?php if ($pconfig['radiussecondnas']) echo "checked"; ?>>
+ <strong>Use Backup Radius Server<br>
+ </strong>When set, all users will be authenticated using
+ the RADIUS server specified below. The local user database
+ will not be used.</td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">RADIUS server Secondary</td>
+ <td width="78%" class="vtable">
+ <input name="radiusserver2" type="text" class="formfld" id="radiusserver2" size="20" value="<?=htmlspecialchars($pconfig['radiusserver2']);?>">
+ <br>
+ Enter the IP address of the RADIUS server.</td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">RADIUS secondary shared secret</td>
+ <td width="78%" valign="top" class="vtable">
+ <input name="radiussecret2" type="password" class="formfld" id="radiussecret2" size="20" value="<?=htmlspecialchars($pconfig['radiussecret2']);?>">
+ <br>
+ Enter the shared secret that will be used to authenticate
+ to the RADIUS server.</td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq">NAS IP ADDRESS</td>
+ <td width="78%" class="vtable">
+ <?=$mandfldhtml;?><input name="radius_nasip" type="text" class="formfld" id="radius_nasip" size="20" value="<?=htmlspecialchars($pconfig['radius_nasip']);?>">
+ <br>
+ radius server NAS ip Address<br>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq">Radius Accounting Update</td>
+ <td width="78%" class="vtable">
+ <?=$mandfldhtml;?><input name="radius_acct_update" type="text" class="formfld" id="radius_acct_update" size="20" value="<?=htmlspecialchars($pconfig['radius_acct_update']);?>">
+ <br>Radius accounting update period in seconds<br>
+ </td>
+ </tr>
<tr>
<td width="22%" valign="top" class="vncell">RADIUS issued IP's</td>
<td width="78%" valign="top" class="vtable">
@@ -358,3 +426,4 @@ enable_change(false);
<?php include("fend.inc"); ?>
</body>
</html>
+
diff --git a/usr/local/www/vpn_pptp.php b/usr/local/www/vpn_pptp.php
index 07b55a4..fe5f230 100755
--- a/usr/local/www/vpn_pptp.php
+++ b/usr/local/www/vpn_pptp.php
@@ -42,9 +42,17 @@ $pconfig['mode'] = $pptpcfg['mode'];
$pconfig['wins'] = $pptpcfg['wins'];
$pconfig['req128'] = isset($pptpcfg['req128']);
$pconfig['radiusenable'] = isset($pptpcfg['radius']['enable']);
+$pconfig['radiusissueips'] = isset($pptpdcfg['radius']['radiusissueips']);
+$pconfig['radiussecenable'] = isset($pptpcfg['radius']['secenable']);
$pconfig['radacct_enable'] = isset($pptpcfg['radius']['accounting']);
$pconfig['radiusserver'] = $pptpcfg['radius']['server'];
$pconfig['radiussecret'] = $pptpcfg['radius']['secret'];
+$pconfig['radiusserver2'] = $pptpcfg['radius']['server2'];
+$pconfig['radiussecret2'] = $pptpcfg['radius']['secret2'];
+$pconfig['n_pptp_units'] = $pptpcfg['n_pptp_units'];
+$pconfig['pptp_subnet'] = $pptpcfg['pptp_subnet'];
+$pconfig['radius_acct_update'] = $pptpcfg['radius_acct_update'];
+$pconfig['radius_nasip'] = $pptpcfg['radius_nasip'];
if ($_POST) {
@@ -105,17 +113,24 @@ if ($_POST) {
}
}
unset($config['pptpd']['mode']);
+
write_config();
}
if (!$input_errors) {
$pptpcfg['remoteip'] = $_POST['remoteip'];
$pptpcfg['redir'] = $_POST['redir'];
- $pptpcfg['localip'] = $_POST['localip'];
+ $pptp['localip'] = $_POST['localip'];
$pptpcfg['mode'] = $_POST['mode'];
$pptpcfg['wins'] = $_POST['wins'];
+ $pptpcfg['n_pptp_units'] = $_POST['n_pptp_units'];
+ $pptpcfg['pptp_subnet'] = $_POST['pptp_subnet'];
$pptpcfg['radius']['server'] = $_POST['radiusserver'];
$pptpcfg['radius']['secret'] = $_POST['radiussecret'];
+ $pptpcfg['radius']['server2'] = $_POST['radiusserver2'];
+ $pptpcfg['radius']['secret2'] = $_POST['radiussecret2'];
+ $pptpcfg['radius_nasip'] = $_POST['radius_nasip'];
+ $pptpcfg['radius_acct_update'] = $_POST['radius_acct_update'];
if($_POST['req128'] == "yes")
$pptpcfg['req128'] = true;
@@ -127,11 +142,21 @@ if ($_POST) {
else
unset($pptpcfg['radius']['enable']);
+ if($_POST['radiussecenable'] == "yes")
+ $pptpcfg['radius']['secenable'] = true;
+ else
+ unset($pptpcfg['radius']['secenable']);
+
if($_POST['radacct_enable'] == "yes")
$pptpcfg['radius']['accounting'] = true;
else
unset($pptpcfg['radius']['accounting']);
+ if($_POST['radiusissueips'] == "yes") {
+ $pptpcfg['radius']['radiusissueips'] = true;
+ } else
+ unset($pptpcfg['radius']['radiusissueips']);
+
write_config();
$retval = 0;
@@ -172,25 +197,51 @@ function enable_change(enable_over) {
document.iform.req128.disabled = 0;
document.iform.radiusenable.disabled = 0;
document.iform.wins.disabled = 0;
+ document.iform.n_pptp_units.disabled = 0;
+ document.iform.pptp_subnet.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.radiussecret.disabled = 0;
+ document.iform.radius_nasip.disabled = 0;
+ document.iform.radius_acct_update.disabled = 0;
+ document.iform.radiusissueips.disabled = 0;
} else {
document.iform.radacct_enable.disabled = 1;
document.iform.radiusserver.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;
+ }
+
+ if (document.iform.radiussecenable.checked || enable_over) {
+ document.iform.radiusserver2.disabled = 0;
+ document.iform.radiussecret2.disabled = 0;
+ } else {
+
+ document.iform.radiusserver2.disabled = 1;
+ document.iform.radiussecret2.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_subnet.disabled = 1;
document.iform.radiusenable.disabled = 1;
document.iform.radacct_enable.disabled = 1;
document.iform.radiusserver.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.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;
@@ -258,13 +309,42 @@ function enable_change(enable_over) {
range</td>
<td width="78%" class="vtable">
<?=$mandfldhtml;?><input name="remoteip" type="text" class="formfld" id="remoteip" size="20" value="<?=htmlspecialchars($pconfig['remoteip']);?>">
- /
- <?=$g['pptp_subnet'];?>
<br>
Specify the starting address for the client IP address subnet.<br>
- The PPTP server will assign
- <?=$g['n_pptp_units'];?>
- addresses, starting at the address entered above, to clients.</td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq">Subnet netmask</td>
+ <td width="78%" class="vtable">
+ <select id="pptp_subnet" name="pptp_subnet">
+ <?php
+ for($x=0; $x<33; $x++) {
+ if($x == $pconfig['pptp_subnet'])
+ $SELECTED = " SELECTED";
+ else
+ $SELECTED = "";
+ echo "<option value=\"{$x}\"{$SELECTED}>{$x}</option>\n";
+ }
+ ?>
+ </select>
+ <br>Hint: 24 is 255.255.255.0
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq">No. PPTP users</td>
+ <td width="78%" class="vtable">
+ <select id="n_pptp_units" name="n_pptp_units">
+ <?php
+ for($x=0; $x<255; $x++) {
+ if($x == $pconfig['n_pptp_units'])
+ $SELECTED = " SELECTED";
+ else
+ $SELECTED = "";
+ echo "<option value=\"{$x}\"{$SELECTED}>{$x}</option>\n";
+ }
+ ?>
+ </select>
+ <br>Hint: 10 is TEN pptp clients
+ </td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell">RADIUS</td>
@@ -294,7 +374,47 @@ function enable_change(enable_over) {
Enter the shared secret that will be used to authenticate
to the RADIUS server.</td>
</tr>
+ <td width="78%" class="vtable">
+ <input name="radiussecenable" type="checkbox" id="radiussecenable" onclick="enable_change(false)" value="yes" <?php if ($pconfig['radiussecenable']) echo "checked"; ?>>
+ <strong>Use a backup RADIUS server for failover authentication<br>
+ </strong>When set, all users will be authenticated using
+ the RADIUS server specified below. The local user database
+ will not be used</td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">BACKUP RADIUS server </td>
+ <td width="78%" class="vtable">
+ <input name="radiusserver2" type="text" class="formfld" id="radiusserver2" size="20" value="<?=htmlspecialchars($pconfig['radiusserver2']);?>">
+ <br>
+ Enter the IP address of the RADIUS server.</td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">BACKUP RADIUS shared secret</td>
+ <td width="78%" valign="top" class="vtable">
+ <input name="radiussecret2" type="password" class="formfld" id="radiussecret2" size="20" value="<?=htmlspecialchars($pconfig['radiussecret2']);?>">
+ <br>
+ Enter the shared secret that will be used to authenticate
+ to the RADIUS server.</td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">Radius NAS IP</td>
+ <td width="78%" valign="top" class="vtable">
+ <input name="radius_nasip" class="formfld" id="radius_nasip" size="20" value="<?=htmlspecialchars($pconfig['radius_nasip']);?>">
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">Radius Accounting Update</td>
+ <td width="78%" valign="top" class="vtable">
+ <input name="radius_acct_update" class="formfld" id="radius_acct_update" size="20" value="<?=htmlspecialchars($pconfig['radius_acct_update']);?>">
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell">RADIUS issued IP's</td>
+ <td width="78%" valign="top" class="vtable">
+ <input name="radiusissueips" value="yes" type="checkbox" class="formfld" id="radiusissueips"<?php if($pconfig['radiusissueips']) echo " CHECKED"; ?>>
+ <br>Issue IP Addresses via RADIUS server.
+ </td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell">WINS Server</td>
@@ -302,7 +422,6 @@ function enable_change(enable_over) {
<input name="wins" class="formfld" id="wins" size="20" value="<?=htmlspecialchars($pconfig['wins']);?>">
</td>
</tr>
-
<tr>
<td height="16" colspan="2" valign="top"></td>
</tr>
@@ -342,3 +461,4 @@ enable_change(false);
<?php include("fend.inc"); ?>
</body>
</html>
+
OpenPOWER on IntegriCloud