Project

General

Profile

Download (23.2 KB) Statistics
| Branch: | Tag: | Revision:
1 5b237745 Scott Ullrich
<?php
2
/*
3
	vpn_pptp.php
4
	part of m0n0wall (http://m0n0.ch/wall)
5 e2411886 Scott Ullrich
	
6
	Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
7 5b237745 Scott Ullrich
	All rights reserved.
8 e2411886 Scott Ullrich
	
9 5b237745 Scott Ullrich
	Redistribution and use in source and binary forms, with or without
10
	modification, are permitted provided that the following conditions are met:
11 e2411886 Scott Ullrich
	
12 5b237745 Scott Ullrich
	1. Redistributions of source code must retain the above copyright notice,
13
	   this list of conditions and the following disclaimer.
14 e2411886 Scott Ullrich
	
15 5b237745 Scott Ullrich
	2. Redistributions in binary form must reproduce the above copyright
16
	   notice, this list of conditions and the following disclaimer in the
17
	   documentation and/or other materials provided with the distribution.
18 e2411886 Scott Ullrich
	
19 5b237745 Scott Ullrich
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
20
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
21
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
23
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28
	POSSIBILITY OF SUCH DAMAGE.
29
*/
30
31 6b07c15a Matthew Grooms
##|+PRIV
32
##|*IDENT=page-vpn-vpnpptp
33
##|*NAME=VPN: VPN PPTP page
34
##|*DESCR=Allow access to the 'VPN: VPN PPTP' page.
35
##|*MATCH=vpn_pptp.php*
36
##|-PRIV
37
38 5b237745 Scott Ullrich
require("guiconfig.inc");
39 7a927e67 Scott Ullrich
require_once("functions.inc");
40
require_once("filter.inc");
41
require_once("shaper.inc");
42 483e6de8 Scott Ullrich
require_once("vpn.inc");
43 5b237745 Scott Ullrich
44
if (!is_array($config['pptpd']['radius'])) {
45
	$config['pptpd']['radius'] = array();
46
}
47
$pptpcfg = &$config['pptpd'];
48
49
$pconfig['remoteip'] = $pptpcfg['remoteip'];
50
$pconfig['localip'] = $pptpcfg['localip'];
51
$pconfig['redir'] = $pptpcfg['redir'];
52
$pconfig['mode'] = $pptpcfg['mode'];
53 10d470b9 Scott Ullrich
$pconfig['wins'] = $pptpcfg['wins'];
54 5b237745 Scott Ullrich
$pconfig['req128'] = isset($pptpcfg['req128']);
55 07cae4b2 Scott Ullrich
$pconfig['n_pptp_units'] = $pptpcfg['n_pptp_units'];
56 c8c416db Scott Ullrich
$pconfig['pptp_dns1'] = $pptpcfg['dns1'];
57
$pconfig['pptp_dns2'] = $pptpcfg['dns2'];
58 71569a7e jim-p
$pconfig['radiusenable'] = isset($pptpcfg['radius']['server']['enable']);
59 c8c416db Scott Ullrich
$pconfig['radiusissueips'] = isset($pptpcfg['radius']['radiusissueips']);
60
$pconfig['radiussecenable'] = isset($pptpcfg['radius']['server2']['enable']);
61
$pconfig['radacct_enable'] = isset($pptpcfg['radius']['accounting']);
62
$pconfig['radiusserver'] = $pptpcfg['radius']['server']['ip'];
63
$pconfig['radiusserverport'] = $pptpcfg['radius']['server']['port'];
64
$pconfig['radiusserveracctport'] = $pptpcfg['radius']['server']['acctport'];
65
$pconfig['radiussecret'] = $pptpcfg['radius']['server']['secret'];
66
$pconfig['radiusserver2'] = $pptpcfg['radius']['server2']['ip'];
67
$pconfig['radiusserver2port'] = $pptpcfg['radius']['server2']['port'];
68
$pconfig['radiusserver2acctport'] = $pptpcfg['radius']['server2']['acctport'];
69
$pconfig['radiussecret2'] = $pptpcfg['radius']['server2']['secret2'];
70
$pconfig['radius_acct_update'] = $pptpcfg['radius']['acct_update'];
71
$pconfig['radius_nasip'] = $pptpcfg['radius']['nasip'];
72 5b237745 Scott Ullrich
73
if ($_POST) {
74
75 7eaf04fd Erik Fonnesbeck
	if (isset($input_errors))
76
		unset($input_errors);
77 5b237745 Scott Ullrich
	$pconfig = $_POST;
78
79
	/* input validation */
80
	if ($_POST['mode'] == "server") {
81
		$reqdfields = explode(" ", "localip remoteip");
82 989d117b Rafael Lucas
		$reqdfieldsn = array(gettext("Server address"),gettext("Remote start address"));
83 e2411886 Scott Ullrich
		
84 5b237745 Scott Ullrich
		if ($_POST['radiusenable']) {
85
			$reqdfields = array_merge($reqdfields, explode(" ", "radiusserver radiussecret"));
86 e2411886 Scott Ullrich
			$reqdfieldsn = array_merge($reqdfieldsn, 
87 989d117b Rafael Lucas
				array(gettext("RADIUS server address"),gettext("RADIUS shared secret")));
88 5b237745 Scott Ullrich
		}
89 e2411886 Scott Ullrich
		
90 5b237745 Scott Ullrich
		do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
91 e2411886 Scott Ullrich
		
92 5b237745 Scott Ullrich
		if (($_POST['localip'] && !is_ipaddr($_POST['localip']))) {
93 989d117b Rafael Lucas
			$input_errors[] = gettext("A valid server address must be specified.");
94 5b237745 Scott Ullrich
		}
95 2f31946f jim-p
		if (!is_ipaddr($_POST['remoteip'])) {
96 989d117b Rafael Lucas
			$input_errors[] = gettext("A valid remote start address must be specified.");
97 5b237745 Scott Ullrich
		}
98
		if (($_POST['radiusserver'] && !is_ipaddr($_POST['radiusserver']))) {
99 989d117b Rafael Lucas
			$input_errors[] = gettext("A valid RADIUS server address must be specified.");
100 5b237745 Scott Ullrich
		}
101 e2411886 Scott Ullrich
		
102
		if (!$input_errors) {	
103 96033063 Erik Fonnesbeck
			$subnet_start = ip2ulong($_POST['remoteip']);
104
			$subnet_end = ip2ulong($_POST['remoteip']) + $_POST['n_pptp_units'] - 1;
105 e2411886 Scott Ullrich
						
106 96033063 Erik Fonnesbeck
			if ((ip2ulong($_POST['localip']) >= $subnet_start) && 
107
			    (ip2ulong($_POST['localip']) <= $subnet_end)) {
108 989d117b Rafael Lucas
				$input_errors[] = gettext("The specified server address lies in the remote subnet.");	
109 5b237745 Scott Ullrich
			}
110 2f31946f jim-p
			// TODO: Should this check be for any local IP address?
111 045c9cc9 sullrich
			if ($_POST['localip'] == $config['interfaces']['lan']['ipaddr']) {
112 989d117b Rafael Lucas
				$input_errors[] = gettext("The specified server address is equal to the LAN interface address.");	
113 5b237745 Scott Ullrich
			}
114
		}
115
	} else if ($_POST['mode'] == "redir") {
116
		$reqdfields = explode(" ", "redir");
117 989d117b Rafael Lucas
		$reqdfieldsn = array(gettext("PPTP redirection target address"));
118 e2411886 Scott Ullrich
		
119 5b237745 Scott Ullrich
		do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
120 e2411886 Scott Ullrich
		
121 5b237745 Scott Ullrich
		if (($_POST['redir'] && !is_ipaddr($_POST['redir']))) {
122 989d117b Rafael Lucas
			$input_errors[] = gettext("A valid target address must be specified.");
123 5b237745 Scott Ullrich
		}
124 7eaf04fd Erik Fonnesbeck
	} else if (isset($config['pptpd']['mode'])) {
125 963d012d Scott Ullrich
		unset($config['pptpd']['mode']);
126 5b237745 Scott Ullrich
	}
127
128
	if (!$input_errors) {
129
		$pptpcfg['remoteip'] = $_POST['remoteip'];
130
		$pptpcfg['redir'] = $_POST['redir'];
131 c8c416db Scott Ullrich
		$pptpcfg['localip'] = $_POST['localip'];
132 5b237745 Scott Ullrich
		$pptpcfg['mode'] = $_POST['mode'];
133 10d470b9 Scott Ullrich
		$pptpcfg['wins'] = $_POST['wins'];
134 07cae4b2 Scott Ullrich
		$pptpcfg['n_pptp_units'] = $_POST['n_pptp_units'];	
135 c8c416db Scott Ullrich
		$pptpcfg['radius']['server']['ip'] = $_POST['radiusserver'];
136
		$pptpcfg['radius']['server']['port'] = $_POST['radiusserverport'];
137
		$pptpcfg['radius']['server']['acctport'] = $_POST['radiusserveracctport'];
138
		$pptpcfg['radius']['server']['secret'] = $_POST['radiussecret'];
139
		$pptpcfg['radius']['server2']['ip'] = $_POST['radiusserver2'];
140
		$pptpcfg['radius']['server2']['port'] = $_POST['radiusserver2port'];
141
		$pptpcfg['radius']['server2']['acctport'] = $_POST['radiusserver2acctport'];
142
		$pptpcfg['radius']['server2']['secret2'] = $_POST['radiussecret2'];
143
		$pptpcfg['radius']['nasip'] = $_POST['radius_nasip'];
144
		$pptpcfg['radius']['acct_update'] = $_POST['radius_acct_update'];
145
146 7eaf04fd Erik Fonnesbeck
 		if ($_POST['pptp_dns1'] == "") {
147
			if (isset($pptpcfg['dns1']))
148
        			unset($pptpcfg['dns1']);
149
		} else
150 c8c416db Scott Ullrich
			$pptpcfg['dns1'] = $_POST['pptp_dns1'];
151
152 7eaf04fd Erik Fonnesbeck
 		if ($_POST['pptp_dns2'] == "") {
153
			if (isset($pptpcfg['dns2']))
154
        			unset($pptpcfg['dns2']);
155
		} else
156 c8c416db Scott Ullrich
			$pptpcfg['dns2'] = $_POST['pptp_dns2'];
157 33eaec88 Scott Ullrich
158
		if($_POST['req128'] == "yes") 
159
			$pptpcfg['req128'] = true;
160 7eaf04fd Erik Fonnesbeck
		else if (isset($pptpcfg['req128']))
161 33eaec88 Scott Ullrich
			unset($pptpcfg['req128']);
162
163
		if($_POST['radiusenable'] == "yes") 
164 c8c416db Scott Ullrich
			$pptpcfg['radius']['server']['enable'] = true;
165 7eaf04fd Erik Fonnesbeck
		else if (isset($pptpcfg['radius']['server']['enable']))
166 c8c416db Scott Ullrich
			unset($pptpcfg['radius']['server']['enable']);
167 e2411886 Scott Ullrich
			
168 07cae4b2 Scott Ullrich
		if($_POST['radiussecenable'] == "yes") 
169 c07b2675 jim-p
			$pptpcfg['radius']['server2']['enable'] = true;
170 7eaf04fd Erik Fonnesbeck
		else if (isset($pptpcfg['radius']['server2']['enable']))
171 c8c416db Scott Ullrich
			unset($pptpcfg['radius']['server2']['enable']);
172 07cae4b2 Scott Ullrich
			
173 33eaec88 Scott Ullrich
		if($_POST['radacct_enable'] == "yes") 
174
			$pptpcfg['radius']['accounting'] = true;
175 7eaf04fd Erik Fonnesbeck
		else if (isset($pptpcfg['radius']['accounting']))
176 33eaec88 Scott Ullrich
			unset($pptpcfg['radius']['accounting']);
177
		
178 07cae4b2 Scott Ullrich
		if($_POST['radiusissueips'] == "yes") {
179
			$pptpcfg['radius']['radiusissueips'] = true;
180 7eaf04fd Erik Fonnesbeck
		} else if (isset($pptpcfg['radius']['radiusissueips']))
181 07cae4b2 Scott Ullrich
			unset($pptpcfg['radius']['radiusissueips']);
182
		
183 5b237745 Scott Ullrich
		write_config();
184 e2411886 Scott Ullrich
		
185 5b237745 Scott Ullrich
		$retval = 0;
186 72bd8df5 Ermal Lu?i
		$retval = vpn_pptpd_configure();
187 5b237745 Scott Ullrich
		$savemsg = get_std_save_message($retval);
188 34947a64 Scott Ullrich
		
189
		filter_configure();
190 5b237745 Scott Ullrich
	}
191
}
192 4df96eff Scott Ullrich
193 989d117b Rafael Lucas
$pgtitle = array(gettext("VPN"),gettext("VPN PPTP"));
194 b32dd0a6 jim-p
$shortcut_section = "pptps";
195 4df96eff Scott Ullrich
include("head.inc");
196
197 5b237745 Scott Ullrich
?>
198 422f27c0 Scott Ullrich
199
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
200 e2411886 Scott Ullrich
<?php include("fbegin.inc"); ?>
201 5b237745 Scott Ullrich
<script language="JavaScript">
202
<!--
203
function get_radio_value(obj)
204
{
205
	for (i = 0; i < obj.length; i++) {
206
		if (obj[i].checked)
207
			return obj[i].value;
208
	}
209
	return null;
210
}
211
212
function enable_change(enable_over) {
213
	if ((get_radio_value(document.iform.mode) == "server") || enable_over) {
214
		document.iform.remoteip.disabled = 0;
215
		document.iform.localip.disabled = 0;
216
		document.iform.req128.disabled = 0;
217
		document.iform.radiusenable.disabled = 0;
218 a35c2033 Martin Fuchs
		document.iform.radiusissueips.disabled = 0;
219 4dd1d9af Scott Ullrich
		document.iform.wins.disabled = 0;
220 07cae4b2 Scott Ullrich
		document.iform.n_pptp_units.disabled = 0;
221 c8c416db Scott Ullrich
		document.iform.pptp_dns1.disabled = 0;
222
		document.iform.pptp_dns2.disabled = 0;	
223 e2411886 Scott Ullrich
		
224 5b237745 Scott Ullrich
		if (document.iform.radiusenable.checked || enable_over) {
225 07cae4b2 Scott Ullrich
			document.iform.radiussecenable.disabled = 0;
226 5b237745 Scott Ullrich
			document.iform.radacct_enable.disabled = 0;
227
			document.iform.radiusserver.disabled = 0;
228 c8c416db Scott Ullrich
			document.iform.radiusserverport.disabled = 0;
229
			document.iform.radiusserveracctport.disabled = 0;
230 5b237745 Scott Ullrich
			document.iform.radiussecret.disabled = 0;
231 07cae4b2 Scott Ullrich
			document.iform.radius_nasip.disabled = 0;	
232
			document.iform.radius_acct_update.disabled = 0;	
233
			document.iform.radiusissueips.disabled = 0;		
234 c8c416db Scott Ullrich
			if (document.iform.radiussecenable.checked || enable_over) {
235
				document.iform.radiusserver2.disabled = 0;
236
				document.iform.radiussecret2.disabled = 0;
237
				document.iform.radiusserver2port.disabled = 0;
238
				document.iform.radiusserver2acctport.disabled = 0;
239
			} else {
240
	
241
				document.iform.radiusserver2.disabled = 1;
242
				document.iform.radiussecret2.disabled = 1;
243
				document.iform.radiusserver2port.disabled = 1;
244
				document.iform.radiusserver2acctport.disabled = 1;
245
			}	
246 5b237745 Scott Ullrich
		} else {
247
			document.iform.radacct_enable.disabled = 1;
248
			document.iform.radiusserver.disabled = 1;
249 c8c416db Scott Ullrich
			document.iform.radiusserverport.disabled = 1;
250 a35c2033 Martin Fuchs
			document.iform.radiusissueips.disabled = 1;
251 c8c416db Scott Ullrich
			document.iform.radiusserveracctport.disabled = 1;
252 5b237745 Scott Ullrich
			document.iform.radiussecret.disabled = 1;
253 07cae4b2 Scott Ullrich
			document.iform.radius_nasip.disabled = 1;	
254
			document.iform.radius_acct_update.disabled = 1;	
255
			document.iform.radiusissueips.disabled = 1;
256 114a9292 jim-p
			document.iform.radiusserver2.disabled = 1;
257
			document.iform.radiussecret2.disabled = 1;
258
			document.iform.radiusserver2port.disabled = 1;
259
			document.iform.radiusserver2acctport.disabled = 1;
260 07cae4b2 Scott Ullrich
		}
261
262 5b237745 Scott Ullrich
	} else {
263
		document.iform.remoteip.disabled = 1;
264
		document.iform.localip.disabled = 1;
265
		document.iform.req128.disabled = 1;
266 07cae4b2 Scott Ullrich
		document.iform.n_pptp_units.disabled = 1;
267 c8c416db Scott Ullrich
		document.iform.pptp_dns1.disabled = 1;
268
		document.iform.pptp_dns2.disabled = 1;
269 5b237745 Scott Ullrich
		document.iform.radiusenable.disabled = 1;
270
		document.iform.radacct_enable.disabled = 1;
271
		document.iform.radiusserver.disabled = 1;
272 c8c416db Scott Ullrich
		document.iform.radiusserverport.disabled = 1;
273 a35c2033 Martin Fuchs
		document.iform.radiusissueips.disabled = 1;
274 c8c416db Scott Ullrich
		document.iform.radiusserveracctport.disabled = 1;
275 5b237745 Scott Ullrich
		document.iform.radiussecret.disabled = 1;
276 07cae4b2 Scott Ullrich
		document.iform.radius_nasip.disabled = 1;	
277
		document.iform.radius_acct_update.disabled = 1;
278
		document.iform.radiussecenable.disabled = 1;
279
		document.iform.radiusserver2.disabled = 1;
280 c8c416db Scott Ullrich
		document.iform.radiusserver2port.disabled = 1;
281
		document.iform.radiusserver2acctport.disabled = 1;
282 07cae4b2 Scott Ullrich
		document.iform.radiussecret2.disabled = 1;	
283 4dd1d9af Scott Ullrich
		document.iform.wins.disabled = 1;
284 07cae4b2 Scott Ullrich
		document.iform.radiusissueips.disabled = 1;
285 5b237745 Scott Ullrich
	}
286
	if ((get_radio_value(document.iform.mode) == "redir") || enable_over) {
287
		document.iform.redir.disabled = 0;
288
	} else {
289
		document.iform.redir.disabled = 1;
290
	}
291
}
292
//-->
293
</script>
294
<form action="vpn_pptp.php" method="post" name="iform" id="iform">
295
<?php if ($input_errors) print_input_errors($input_errors); ?>
296
<?php if ($savemsg) print_info_box($savemsg); ?>
297
<table width="100%" border="0" cellpadding="0" cellspacing="0">
298 e2411886 Scott Ullrich
  <tr><td class="tabnavtbl">
299 17982382 Scott Ullrich
<?php
300
	$tab_array = array();
301 989d117b Rafael Lucas
	$tab_array[0] = array(gettext("Configuration"), true, "vpn_pptp.php");
302
	$tab_array[1] = array(gettext("Users"), false, "vpn_pptp_users.php");
303 17982382 Scott Ullrich
	display_top_tabs($tab_array);
304
?>  
305 5b237745 Scott Ullrich
  </td></tr>
306 e2411886 Scott Ullrich
  <tr> 
307 96f8c1e2 Bill Marquette
    <td>
308
<div id="mainarea">
309
              <table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0">
310 e2411886 Scott Ullrich
                <tr> 
311 5b237745 Scott Ullrich
                  <td width="22%" valign="top" class="vtable">&nbsp;</td>
312 e2411886 Scott Ullrich
                  <td width="78%" class="vtable"> 
313 5b237745 Scott Ullrich
                    <input name="mode" type="radio" onclick="enable_change(false)" value="off"
314 70085c73 Carlos Eduardo Ramos
				  	<?php if (($pconfig['mode'] != "server") && ($pconfig['mode'] != "redir")) echo "checked";?>>
315 e222daeb Carlos Eduardo Ramos
                    <?=gettext("Off"); ?></td>
316 e2411886 Scott Ullrich
                <tr> 
317 5b237745 Scott Ullrich
                  <td width="22%" valign="top" class="vtable">&nbsp;</td>
318
                  <td width="78%" class="vtable">
319 70085c73 Carlos Eduardo Ramos
320
			<input type="radio" name="mode" value="redir" onclick="enable_change(false)" <?php if ($pconfig['mode'] == "redir") echo "checked" ?>>
321 62f8bb60 Carlos Eduardo Ramos
                    <?=gettext("Redirect incoming PPTP connections to");?>:</td>
322 9f6651a3 Carlos Eduardo Ramos
				<tr>
323
				  <td width="22%" valign="top" class="vncellreq"><?=gettext("PPTP redirection");?></td>
324 e2411886 Scott Ullrich
                  <td width="78%" class="vtable"> 
325 b5c78501 Seth Mos
                    <?=$mandfldhtml;?><input name="redir" type="text" class="formfld unknown" id="redir" size="20" value="<?=htmlspecialchars($pconfig['redir']);?>"> 
326 5b237745 Scott Ullrich
                    <br>
327 70085c73 Carlos Eduardo Ramos
                    <?=gettext("Enter the IP address of a host which will accept incoming " .
328
                    "PPTP connections"); ?>.</td>
329 e2411886 Scott Ullrich
                <tr> 
330 5b237745 Scott Ullrich
                  <td width="22%" valign="top" class="vtable">&nbsp;</td>
331
                  <td width="78%" class="vtable">
332 70085c73 Carlos Eduardo Ramos
			<input type="radio" name="mode" value="server" onclick="enable_change(false)" <?php if ($pconfig['mode'] == "server") echo "checked"; ?>>
333
                    <?=gettext("Enable PPTP server"); ?></td>
334 c8c416db Scott Ullrich
                </tr>
335 f2b4ff2b sullrich
				<tr>
336 70085c73 Carlos Eduardo Ramos
					<td width="22%" valign="top" class="vncellreq"><?=gettext("No. PPTP users"); ?></td>
337 f2b4ff2b sullrich
					<td width="78%" class="vtable">
338
						<select id="n_pptp_units" name="n_pptp_units">
339
							<?php
340 1f6f0076 jim-p
								$toselect = ($pconfig['n_pptp_units'] > 0) ? $pconfig['n_pptp_units'] : 16;
341
								for($x=1; $x<255; $x++) {
342
									if($x == $toselect)
343 f2b4ff2b sullrich
										$SELECTED = " SELECTED";
344
									else
345
										$SELECTED = "";
346
									echo "<option value=\"{$x}\"{$SELECTED}>{$x}</option>\n";
347
								}
348
							?>
349
						</select>
350 084e77e7 Chris Buechler
						<br><?=gettext("Hint: 10 is ten PPTP clients"); ?>
351 f2b4ff2b sullrich
					</td>
352
				</tr>
353 e2411886 Scott Ullrich
                <tr> 
354 70085c73 Carlos Eduardo Ramos
                  <td width="22%" valign="top" class="vncellreq"><?=gettext("Server address"); ?></td>
355 e2411886 Scott Ullrich
                  <td width="78%" class="vtable"> 
356 b5c78501 Seth Mos
                    <?=$mandfldhtml;?><input name="localip" type="text" class="formfld unknown" id="localip" size="20" value="<?=htmlspecialchars($pconfig['localip']);?>"> 
357 6d1ae23c jim-p
			<br/>
358
			<?=gettext("Enter the IP address the PPTP server should give to clients for use as their \"gateway\""); ?>.
359
			<br/>
360
			<?=gettext("Typically this is set to an unused IP just outside of the client range"); ?>.
361
			<br/>
362
			<br/>
363 973444a8 jim-p
			<?=gettext("NOTE: This should NOT be set to any IP address currently in use on this firewall"); ?>.</td>
364 5b237745 Scott Ullrich
                </tr>
365 e2411886 Scott Ullrich
                <tr> 
366 70085c73 Carlos Eduardo Ramos
                  <td width="22%" valign="top" class="vncellreq"><?=gettext("Remote address " .
367
                    "range"); ?></td>
368 e2411886 Scott Ullrich
                  <td width="78%" class="vtable"> 
369 b5c78501 Seth Mos
                    <?=$mandfldhtml;?><input name="remoteip" type="text" class="formfld unknown" id="remoteip" size="20" value="<?=htmlspecialchars($pconfig['remoteip']);?>">
370 5b237745 Scott Ullrich
                    <br>
371 70085c73 Carlos Eduardo Ramos
                    <?=gettext("Specify the starting address for the client IP subnet"); ?>.<br>
372 07cae4b2 Scott Ullrich
                </tr>
373 c8c416db Scott Ullrich
                <tr> 
374 70085c73 Carlos Eduardo Ramos
                  <td width="22%" valign="top" class="vncell"><?=gettext("PPTP DNS Servers"); ?></td>
375 c8c416db Scott Ullrich
                  <td width="78%" class="vtable"> 
376 b5c78501 Seth Mos
                    <?=$mandfldhtml;?><input name="pptp_dns1" type="text" class="formfld unknown" id="pptp_dns1" size="20" value="<?=htmlspecialchars($pconfig['pptp_dns1']);?>">
377 c8c416db Scott Ullrich
                    <br>
378 045c9cc9 sullrich
					<input name="pptp_dns2" type="text" class="formfld unknown" id="pptp_dns2" size="20" value="<?=htmlspecialchars($pconfig['pptp_dns2']);?>">
379 c8c416db Scott Ullrich
                    <br>
380 70085c73 Carlos Eduardo Ramos
                   <?=gettext("primary and secondary DNS servers assigned to PPTP clients"); ?><br>
381 c8c416db Scott Ullrich
                </tr>
382
                <tr> 
383 70085c73 Carlos Eduardo Ramos
                  <td width="22%" valign="top" class="vncell"><?=gettext("WINS Server"); ?></td>
384
                  <td width="78%" valign="top" class="vtable">
385 b5c78501 Seth Mos
                      <input name="wins" class="formfld unknown" id="wins" size="20" value="<?=htmlspecialchars($pconfig['wins']);?>">
386 c8c416db Scott Ullrich
                  </td>
387
                </tr>
388 e2411886 Scott Ullrich
                <tr> 
389 70085c73 Carlos Eduardo Ramos
                  <td width="22%" valign="top" class="vncell"><?=gettext("RADIUS"); ?></td>
390 e2411886 Scott Ullrich
                  <td width="78%" class="vtable"> 
391
                      <input name="radiusenable" type="checkbox" id="radiusenable" onclick="enable_change(false)" value="yes" <?php if ($pconfig['radiusenable']) echo "checked"; ?>>
392 70085c73 Carlos Eduardo Ramos
                      <strong><?=gettext("Use a RADIUS server for authentication"); ?></strong><br>
393
                      <?=gettext("When set, all users will be authenticated using " .
394
                      "the RADIUS server specified below. The local user database " .
395
                      "will not be used"); ?>.<br>
396 5b237745 Scott Ullrich
                      <br>
397 70085c73 Carlos Eduardo Ramos
                      <input name="radacct_enable" type="checkbox" id="radacct_enable" onclick="enable_change(false)" value="yes" <?php if ($pconfig['radacct_enable']) echo "checked"; ?>>
398
                      <strong><?=gettext("Enable RADIUS accounting"); ?> <br>
399
                      </strong><?=gettext("Sends accounting packets to the RADIUS server"); ?>.<br>
400 c8c416db Scott Ullrich
			 <br>
401 70085c73 Carlos Eduardo Ramos
                      <input name="radiussecenable" type="checkbox" id="radiussecenable" onclick="enable_change(false)" value="yes" <?php if ($pconfig['radiussecenable']) echo "checked"; ?>>
402
                      <strong><?=gettext("Secondary RADIUS server for failover authentication"); ?></strong><br>
403
                      <?=gettext("When set, all requests will go to the secondary server when primary fails"); ?><br>
404 f9f160b1 Chris Buechler
		      <br>
405
                      <input name="radiusissueips" value="yes" type="checkbox" class="formfld" id="radiusissueips"<?php if($pconfig['radiusissueips']) echo " CHECKED"; ?>>
406 70085c73 Carlos Eduardo Ramos
		      <strong><?=gettext("RADIUS issued IPs"); ?></strong>
407
                      <br><?=gettext("Issue IP addresses via RADIUS server"); ?>.
408 f9f160b1 Chris Buechler
		      </td>
409
                 </td>
410 c8c416db Scott Ullrich
                </tr>
411
                <tr> 
412 70085c73 Carlos Eduardo Ramos
                  <td width="22%" valign="top" class="vncell"><?=gettext("RADIUS NAS IP"); ?></td>
413 c8c416db Scott Ullrich
                  <td width="78%" valign="top" class="vtable">
414 b5c78501 Seth Mos
                      <input name="radius_nasip" class="formfld unknown" id="radius_nasip" size="20" value="<?=htmlspecialchars($pconfig['radius_nasip']);?>">
415 c8c416db Scott Ullrich
                  </td>
416 f9f160b1 Chris Buechler
		</tr>
417 c8c416db Scott Ullrich
                <tr> 
418 70085c73 Carlos Eduardo Ramos
                  <td width="22%" valign="top" class="vncell"><?=gettext("RADIUS Accounting Update"); ?></td>
419 c8c416db Scott Ullrich
                  <td width="78%" valign="top" class="vtable">
420 b5c78501 Seth Mos
                      <input name="radius_acct_update" class="formfld unknown" id="radius_acct_update" size="20" value="<?=htmlspecialchars($pconfig['radius_acct_update']);?>">
421 c8c416db Scott Ullrich
                  </td>
422 f9f160b1 Chris Buechler
		</tr>
423 e2411886 Scott Ullrich
                <tr> 
424 70085c73 Carlos Eduardo Ramos
                  <td width="22%" valign="top" class="vncell"><?=gettext("RADIUS Server"); ?> </td>
425 78cf56c6 Scott Ullrich
                  <td width="78%" class="vtable">
426 b5c78501 Seth Mos
                      <input name="radiusserver" type="text" class="formfld unknown" id="radiusserver" size="20" value="<?=htmlspecialchars($pconfig['radiusserver']);?>">
427
                      <input name="radiusserverport" type="text" class="formfld unknown" id="radiusserverport" size="4" value="<?=htmlspecialchars($pconfig['radiusserverport']);?>">
428
                      <input name="radiusserveracctport" type="text" class="formfld unknown" id="radiusserveracctport" size="4" value="<?=htmlspecialchars($pconfig['radiusserveracctport']);?>">
429 5b237745 Scott Ullrich
                      <br>
430 70085c73 Carlos Eduardo Ramos
                      <?=gettext("Enter the IP address, RADIUS port, and RADIUS accounting port of the RADIUS server"); ?>.</td>
431 5b237745 Scott Ullrich
                </tr>
432 e2411886 Scott Ullrich
                <tr> 
433 70085c73 Carlos Eduardo Ramos
                  <td width="22%" valign="top" class="vncell"><?=gettext("RADIUS shared secret"); ?></td>
434 78cf56c6 Scott Ullrich
                  <td width="78%" valign="top" class="vtable">
435 b5c78501 Seth Mos
                      <input name="radiussecret" type="password" class="formfld pwd" id="radiussecret" size="20" value="<?=htmlspecialchars($pconfig['radiussecret']);?>">
436 5b237745 Scott Ullrich
                      <br>
437 70085c73 Carlos Eduardo Ramos
                      <?=gettext("Enter the shared secret that will be used to authenticate " .
438
                      "to the RADIUS server"); ?>.</td>
439 07cae4b2 Scott Ullrich
                </tr>
440
                <tr> 
441 70085c73 Carlos Eduardo Ramos
                  <td width="22%" valign="top" class="vncell"><?=gettext("Secondary RADIUS server"); ?> </td>
442 07cae4b2 Scott Ullrich
                  <td width="78%" class="vtable">
443 b5c78501 Seth Mos
                      <input name="radiusserver2" type="text" class="formfld unknown" id="radiusserver2" size="20" value="<?=htmlspecialchars($pconfig['radiusserver2']);?>">
444
                      <input name="radiusserver2port" type="text" class="formfld unknown" id="radiusserver2port" size="4" value="<?=htmlspecialchars($pconfig['radiusserver2port']);?>">
445
                      <input name="radiusserver2acctport" type="text" class="formfld unknown" id="radiusserver2acctport" size="4" value="<?=htmlspecialchars($pconfig['radiusserver2acctport']);?>">
446 07cae4b2 Scott Ullrich
                      <br>
447 70085c73 Carlos Eduardo Ramos
                      <?=gettext("Enter the IP address, RADIUS port, and RADIUS accounting port of the RADIUS server"); ?>.</td>
448 07cae4b2 Scott Ullrich
                </tr>
449
                <tr> 
450 70085c73 Carlos Eduardo Ramos
                  <td width="22%" valign="top" class="vncell"><?=gettext("Secondary RADIUS shared secret"); ?></td>
451 07cae4b2 Scott Ullrich
                  <td width="78%" valign="top" class="vtable">
452 b5c78501 Seth Mos
                      <input name="radiussecret2" type="password" class="formfld pwd" id="radiussecret2" size="20" value="<?=htmlspecialchars($pconfig['radiussecret2']);?>">
453 07cae4b2 Scott Ullrich
                      <br>
454 70085c73 Carlos Eduardo Ramos
                      <?=gettext("Enter the shared secret that will be used to authenticate " .
455
                      "to the secondary RADIUS server"); ?>.</td>
456 07cae4b2 Scott Ullrich
                </tr>
457 e2411886 Scott Ullrich
                <tr> 
458 5b237745 Scott Ullrich
                  <td height="16" colspan="2" valign="top"></td>
459
                </tr>
460 e2411886 Scott Ullrich
                <tr> 
461 5b237745 Scott Ullrich
                  <td width="22%" valign="middle">&nbsp;</td>
462 e2411886 Scott Ullrich
                  <td width="78%" class="vtable"> 
463 70085c73 Carlos Eduardo Ramos
                    <input name="req128" type="checkbox" id="req128" value="yes" <?php if ($pconfig['req128']) echo "checked"; ?>> 
464
                    <strong><?=gettext("Require 128-bit encryption"); ?></strong><br>
465
                    <?=gettext("When set, only 128-bit encryption will be accepted. Otherwise " .
466
                    "40-bit and 56-bit encryption will be accepted as well. Note that " .
467
                    "encryption will always be forced on PPTP connections (i.e. " .
468
                    "unencrypted connections will not be accepted)"); ?>.</td>
469 5b237745 Scott Ullrich
                </tr>
470 e2411886 Scott Ullrich
                <tr> 
471 5b237745 Scott Ullrich
                  <td width="22%" valign="top">&nbsp;</td>
472 e2411886 Scott Ullrich
                  <td width="78%"> 
473 70085c73 Carlos Eduardo Ramos
                    <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" onclick="enable_change(true)"> 
474 5b237745 Scott Ullrich
                  </td>
475
                </tr>
476 e2411886 Scott Ullrich
                <tr> 
477
                  <td width="22%" valign="top">&nbsp;</td>
478 70085c73 Carlos Eduardo Ramos
                  <td width="78%"><span class="vexpl"><span class="red"><strong><?=gettext("Note");?>:<br>
479 62f8bb60 Carlos Eduardo Ramos
                    </strong></span><?=gettext("don't forget to ");?><a href="firewall_rules.php?if=pptp"><?=gettext("add a firewall rule"); ?></a> <?=gettext("to permit ". 
480
                    "traffic from PPTP clients");?>!</span></td>
481 70085c73 Carlos Eduardo Ramos
                 </tr>
482 5b237745 Scott Ullrich
              </table>
483 96f8c1e2 Bill Marquette
</div>
484 e2411886 Scott Ullrich
			</td>
485 5b237745 Scott Ullrich
	</tr>
486
</table>
487
</form>
488
<script language="JavaScript">
489
<!--
490
enable_change(false);
491
//-->
492
</script>
493
<?php include("fend.inc"); ?>
494 9999b3aa Scott Ullrich
</body>
495
</html>