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
$pconfig['pptp_subnet'] = $pptpcfg['pptp_subnet'];
57 c8c416db Scott Ullrich
$pconfig['pptp_dns1'] = $pptpcfg['dns1'];
58
$pconfig['pptp_dns2'] = $pptpcfg['dns2'];
59 71569a7e jim-p
$pconfig['radiusenable'] = isset($pptpcfg['radius']['server']['enable']);
60 c8c416db Scott Ullrich
$pconfig['radiusissueips'] = isset($pptpcfg['radius']['radiusissueips']);
61
$pconfig['radiussecenable'] = isset($pptpcfg['radius']['server2']['enable']);
62
$pconfig['radacct_enable'] = isset($pptpcfg['radius']['accounting']);
63
$pconfig['radiusserver'] = $pptpcfg['radius']['server']['ip'];
64
$pconfig['radiusserverport'] = $pptpcfg['radius']['server']['port'];
65
$pconfig['radiusserveracctport'] = $pptpcfg['radius']['server']['acctport'];
66
$pconfig['radiussecret'] = $pptpcfg['radius']['server']['secret'];
67
$pconfig['radiusserver2'] = $pptpcfg['radius']['server2']['ip'];
68
$pconfig['radiusserver2port'] = $pptpcfg['radius']['server2']['port'];
69
$pconfig['radiusserver2acctport'] = $pptpcfg['radius']['server2']['acctport'];
70
$pconfig['radiussecret2'] = $pptpcfg['radius']['server2']['secret2'];
71
$pconfig['radius_acct_update'] = $pptpcfg['radius']['acct_update'];
72
$pconfig['radius_nasip'] = $pptpcfg['radius']['nasip'];
73 5b237745 Scott Ullrich
74
if ($_POST) {
75
76
	unset($input_errors);
77
	$pconfig = $_POST;
78
79
	/* input validation */
80
	if ($_POST['mode'] == "server") {
81
		$reqdfields = explode(" ", "localip remoteip");
82
		$reqdfieldsn = explode(",", "Server address,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 5b237745 Scott Ullrich
				explode(",", "RADIUS server address,RADIUS shared secret"));
88
		}
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
			$input_errors[] = "A valid server address must be specified.";
94
		}
95 a56120f2 Ermal Lu?i
		if (($_POST['pptp_subnet'] && !is_ipaddr($_POST['remoteip']))) {
96 5b237745 Scott Ullrich
			$input_errors[] = "A valid remote start address must be specified.";
97
		}
98
		if (($_POST['radiusserver'] && !is_ipaddr($_POST['radiusserver']))) {
99
			$input_errors[] = "A valid RADIUS server address must be specified.";
100
		}
101 e2411886 Scott Ullrich
		
102
		if (!$input_errors) {	
103 c6933c6d Ermal Lu?i
			$_POST['remoteip'] = $pconfig['remoteip'] = gen_subnet($_POST['remoteip'], $_POST['pptp_subnet']);
104 5b237745 Scott Ullrich
			$subnet_start = ip2long($_POST['remoteip']);
105 f2b4ff2b sullrich
			$subnet_end = ip2long($_POST['remoteip']) + $_POST['n_pptp_units'] - 1;
106 e2411886 Scott Ullrich
						
107
			if ((ip2long($_POST['localip']) >= $subnet_start) && 
108 5b237745 Scott Ullrich
			    (ip2long($_POST['localip']) <= $subnet_end)) {
109 e2411886 Scott Ullrich
				$input_errors[] = "The specified server address lies in the remote subnet.";	
110 5b237745 Scott Ullrich
			}
111 045c9cc9 sullrich
			if ($_POST['localip'] == $config['interfaces']['lan']['ipaddr']) {
112 e2411886 Scott Ullrich
				$input_errors[] = "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
		$reqdfieldsn = explode(",", "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
			$input_errors[] = "A valid target address must be specified.";
123
		}
124 64cc8755 Scott Ullrich
	} else {
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
		$pptpcfg['pptp_subnet'] = $_POST['pptp_subnet'];
136 c8c416db Scott Ullrich
		$pptpcfg['radius']['server']['ip'] = $_POST['radiusserver'];
137
		$pptpcfg['radius']['server']['port'] = $_POST['radiusserverport'];
138
		$pptpcfg['radius']['server']['acctport'] = $_POST['radiusserveracctport'];
139
		$pptpcfg['radius']['server']['secret'] = $_POST['radiussecret'];
140
		$pptpcfg['radius']['server2']['ip'] = $_POST['radiusserver2'];
141
		$pptpcfg['radius']['server2']['port'] = $_POST['radiusserver2port'];
142
		$pptpcfg['radius']['server2']['acctport'] = $_POST['radiusserver2acctport'];
143
		$pptpcfg['radius']['server2']['secret2'] = $_POST['radiussecret2'];
144
		$pptpcfg['radius']['nasip'] = $_POST['radius_nasip'];
145
		$pptpcfg['radius']['acct_update'] = $_POST['radius_acct_update'];
146
147
 		if ($_POST['pptp_dns1'] == "") 
148
        		unset($pptpcfg['dns1']);
149
		else
150
			$pptpcfg['dns1'] = $_POST['pptp_dns1'];
151
152
 		if ($_POST['pptp_dns2'] == "") 
153
        		unset($pptpcfg['dns2']);
154
		else
155
			$pptpcfg['dns2'] = $_POST['pptp_dns2'];
156 33eaec88 Scott Ullrich
157
		if($_POST['req128'] == "yes") 
158
			$pptpcfg['req128'] = true;
159
		else
160
			unset($pptpcfg['req128']);
161
162
		if($_POST['radiusenable'] == "yes") 
163 c8c416db Scott Ullrich
			$pptpcfg['radius']['server']['enable'] = true;
164 33eaec88 Scott Ullrich
		else 
165 c8c416db Scott Ullrich
			unset($pptpcfg['radius']['server']['enable']);
166 e2411886 Scott Ullrich
			
167 07cae4b2 Scott Ullrich
		if($_POST['radiussecenable'] == "yes") 
168 c8c416db Scott Ullrich
			$pptpcfg['radius']['server']['enable'] = true;
169 07cae4b2 Scott Ullrich
		else 
170 c8c416db Scott Ullrich
			unset($pptpcfg['radius']['server2']['enable']);
171 07cae4b2 Scott Ullrich
			
172 33eaec88 Scott Ullrich
		if($_POST['radacct_enable'] == "yes") 
173
			$pptpcfg['radius']['accounting'] = true;
174
		else 
175
			unset($pptpcfg['radius']['accounting']);
176
		
177 07cae4b2 Scott Ullrich
		if($_POST['radiusissueips'] == "yes") {
178
			$pptpcfg['radius']['radiusissueips'] = true;
179
		} else
180
			unset($pptpcfg['radius']['radiusissueips']);
181
		
182 5b237745 Scott Ullrich
		write_config();
183 e2411886 Scott Ullrich
		
184 5b237745 Scott Ullrich
		$retval = 0;
185 72bd8df5 Ermal Lu?i
		$retval = vpn_pptpd_configure();
186 5b237745 Scott Ullrich
		$savemsg = get_std_save_message($retval);
187 34947a64 Scott Ullrich
		
188
		filter_configure();
189 5b237745 Scott Ullrich
	}
190
}
191 4df96eff Scott Ullrich
192 57a2e25f Scott Ullrich
$pgtitle = array("VPN","VPN PPTP");
193 4df96eff Scott Ullrich
include("head.inc");
194
195 5b237745 Scott Ullrich
?>
196 422f27c0 Scott Ullrich
197
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
198 e2411886 Scott Ullrich
<?php include("fbegin.inc"); ?>
199 5b237745 Scott Ullrich
<script language="JavaScript">
200
<!--
201
function get_radio_value(obj)
202
{
203
	for (i = 0; i < obj.length; i++) {
204
		if (obj[i].checked)
205
			return obj[i].value;
206
	}
207
	return null;
208
}
209
210
function enable_change(enable_over) {
211
	if ((get_radio_value(document.iform.mode) == "server") || enable_over) {
212
		document.iform.remoteip.disabled = 0;
213
		document.iform.localip.disabled = 0;
214
		document.iform.req128.disabled = 0;
215
		document.iform.radiusenable.disabled = 0;
216 a35c2033 Martin Fuchs
		document.iform.radiusissueips.disabled = 0;
217 4dd1d9af Scott Ullrich
		document.iform.wins.disabled = 0;
218 07cae4b2 Scott Ullrich
		document.iform.n_pptp_units.disabled = 0;
219
		document.iform.pptp_subnet.disabled = 0;	
220 c8c416db Scott Ullrich
		document.iform.pptp_dns1.disabled = 0;
221
		document.iform.pptp_dns2.disabled = 0;	
222 e2411886 Scott Ullrich
		
223 5b237745 Scott Ullrich
		if (document.iform.radiusenable.checked || enable_over) {
224 07cae4b2 Scott Ullrich
			document.iform.radiussecenable.disabled = 0;
225 5b237745 Scott Ullrich
			document.iform.radacct_enable.disabled = 0;
226
			document.iform.radiusserver.disabled = 0;
227 c8c416db Scott Ullrich
			document.iform.radiusserverport.disabled = 0;
228
			document.iform.radiusserveracctport.disabled = 0;
229 5b237745 Scott Ullrich
			document.iform.radiussecret.disabled = 0;
230 07cae4b2 Scott Ullrich
			document.iform.radius_nasip.disabled = 0;	
231
			document.iform.radius_acct_update.disabled = 0;	
232
			document.iform.radiusissueips.disabled = 0;		
233 c8c416db Scott Ullrich
			if (document.iform.radiussecenable.checked || enable_over) {
234
				document.iform.radiusserver2.disabled = 0;
235
				document.iform.radiussecret2.disabled = 0;
236
				document.iform.radiusserver2port.disabled = 0;
237
				document.iform.radiusserver2acctport.disabled = 0;
238
			} else {
239
	
240
				document.iform.radiusserver2.disabled = 1;
241
				document.iform.radiussecret2.disabled = 1;
242
				document.iform.radiusserver2port.disabled = 1;
243
				document.iform.radiusserver2acctport.disabled = 1;
244
			}	
245 5b237745 Scott Ullrich
		} else {
246
			document.iform.radacct_enable.disabled = 1;
247
			document.iform.radiusserver.disabled = 1;
248 c8c416db Scott Ullrich
			document.iform.radiusserverport.disabled = 1;
249 a35c2033 Martin Fuchs
			document.iform.radiusissueips.disabled = 1;
250 c8c416db Scott Ullrich
			document.iform.radiusserveracctport.disabled = 1;
251 5b237745 Scott Ullrich
			document.iform.radiussecret.disabled = 1;
252 07cae4b2 Scott Ullrich
			document.iform.radius_nasip.disabled = 1;	
253
			document.iform.radius_acct_update.disabled = 1;	
254
			document.iform.radiusissueips.disabled = 1;
255
		}
256
257 5b237745 Scott Ullrich
	} else {
258
		document.iform.remoteip.disabled = 1;
259
		document.iform.localip.disabled = 1;
260
		document.iform.req128.disabled = 1;
261 07cae4b2 Scott Ullrich
		document.iform.n_pptp_units.disabled = 1;
262
		document.iform.pptp_subnet.disabled = 1;	
263 c8c416db Scott Ullrich
		document.iform.pptp_dns1.disabled = 1;
264
		document.iform.pptp_dns2.disabled = 1;
265 5b237745 Scott Ullrich
		document.iform.radiusenable.disabled = 1;
266
		document.iform.radacct_enable.disabled = 1;
267
		document.iform.radiusserver.disabled = 1;
268 c8c416db Scott Ullrich
		document.iform.radiusserverport.disabled = 1;
269 a35c2033 Martin Fuchs
		document.iform.radiusissueips.disabled = 1;
270 c8c416db Scott Ullrich
		document.iform.radiusserveracctport.disabled = 1;
271 5b237745 Scott Ullrich
		document.iform.radiussecret.disabled = 1;
272 07cae4b2 Scott Ullrich
		document.iform.radius_nasip.disabled = 1;	
273
		document.iform.radius_acct_update.disabled = 1;
274
		document.iform.radiussecenable.disabled = 1;
275
		document.iform.radiusserver2.disabled = 1;
276 c8c416db Scott Ullrich
		document.iform.radiusserver2port.disabled = 1;
277
		document.iform.radiusserver2acctport.disabled = 1;
278 07cae4b2 Scott Ullrich
		document.iform.radiussecret2.disabled = 1;	
279 4dd1d9af Scott Ullrich
		document.iform.wins.disabled = 1;
280 07cae4b2 Scott Ullrich
		document.iform.radiusissueips.disabled = 1;
281 5b237745 Scott Ullrich
	}
282
	if ((get_radio_value(document.iform.mode) == "redir") || enable_over) {
283
		document.iform.redir.disabled = 0;
284
	} else {
285
		document.iform.redir.disabled = 1;
286
	}
287
}
288
//-->
289
</script>
290
<form action="vpn_pptp.php" method="post" name="iform" id="iform">
291
<?php if ($input_errors) print_input_errors($input_errors); ?>
292
<?php if ($savemsg) print_info_box($savemsg); ?>
293
<table width="100%" border="0" cellpadding="0" cellspacing="0">
294 e2411886 Scott Ullrich
  <tr><td class="tabnavtbl">
295 17982382 Scott Ullrich
<?php
296
	$tab_array = array();
297
	$tab_array[0] = array("Configuration", true, "vpn_pptp.php");
298
	$tab_array[1] = array("Users", false, "vpn_pptp_users.php");
299
	display_top_tabs($tab_array);
300
?>  
301 5b237745 Scott Ullrich
  </td></tr>
302 e2411886 Scott Ullrich
  <tr> 
303 96f8c1e2 Bill Marquette
    <td>
304
<div id="mainarea">
305
              <table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0">
306 e2411886 Scott Ullrich
                <tr> 
307 5b237745 Scott Ullrich
                  <td width="22%" valign="top" class="vtable">&nbsp;</td>
308 e2411886 Scott Ullrich
                  <td width="78%" class="vtable"> 
309 5b237745 Scott Ullrich
                    <input name="mode" type="radio" onclick="enable_change(false)" value="off"
310
				  	<?php if (($pconfig['mode'] != "server") && ($pconfig['mode'] != "redir")) echo "checked";?>>
311
                    Off</td>
312 e2411886 Scott Ullrich
                <tr> 
313 5b237745 Scott Ullrich
                  <td width="22%" valign="top" class="vtable">&nbsp;</td>
314
                  <td width="78%" class="vtable">
315 c8c416db Scott Ullrich
			<input type="radio" name="mode" value="redir" onclick="enable_change(false)" <?php if ($pconfig['mode'] == "redir") echo "checked"; ?>>
316 5b237745 Scott Ullrich
                    Redirect incoming PPTP connections to:</td>
317 e2411886 Scott Ullrich
                <tr> 
318 5b237745 Scott Ullrich
                  <td width="22%" valign="top" class="vncellreq">PPTP redirection</td>
319 e2411886 Scott Ullrich
                  <td width="78%" class="vtable"> 
320 b5c78501 Seth Mos
                    <?=$mandfldhtml;?><input name="redir" type="text" class="formfld unknown" id="redir" size="20" value="<?=htmlspecialchars($pconfig['redir']);?>"> 
321 5b237745 Scott Ullrich
                    <br>
322 e2411886 Scott Ullrich
                    Enter the IP address of a host which will accept incoming 
323 5b237745 Scott Ullrich
                    PPTP connections.</td>
324 e2411886 Scott Ullrich
                <tr> 
325 5b237745 Scott Ullrich
                  <td width="22%" valign="top" class="vtable">&nbsp;</td>
326
                  <td width="78%" class="vtable">
327 c8c416db Scott Ullrich
			<input type="radio" name="mode" value="server" onclick="enable_change(false)" <?php if ($pconfig['mode'] == "server") echo "checked"; ?>>
328 5b237745 Scott Ullrich
                    Enable PPTP server</td>
329 c8c416db Scott Ullrich
                </tr>
330 f2b4ff2b sullrich
				<tr>
331
					<td width="22%" valign="top" class="vncellreq">No. PPTP users</td>
332
					<td width="78%" class="vtable">
333
						<select id="n_pptp_units" name="n_pptp_units">
334
							<?php
335
								for($x=0; $x<255; $x++) {
336
									if($x == $pconfig['n_pptp_units'])
337
										$SELECTED = " SELECTED";
338
									else
339
										$SELECTED = "";
340
									echo "<option value=\"{$x}\"{$SELECTED}>{$x}</option>\n";
341
								}
342
							?>
343
						</select>
344
						<br>Hint: 10 is TEN pptp clients
345
					</td>
346
				</tr>
347 e2411886 Scott Ullrich
                <tr> 
348 5b237745 Scott Ullrich
                  <td width="22%" valign="top" class="vncellreq">Server address</td>
349 e2411886 Scott Ullrich
                  <td width="78%" class="vtable"> 
350 b5c78501 Seth Mos
                    <?=$mandfldhtml;?><input name="localip" type="text" class="formfld unknown" id="localip" size="20" value="<?=htmlspecialchars($pconfig['localip']);?>"> 
351 5b237745 Scott Ullrich
                    <br>
352 e2411886 Scott Ullrich
                    Enter the IP address the PPTP server should use on its side 
353 5b237745 Scott Ullrich
                    for all clients.</td>
354
                </tr>
355 e2411886 Scott Ullrich
                <tr> 
356
                  <td width="22%" valign="top" class="vncellreq">Remote address 
357 5b237745 Scott Ullrich
                    range</td>
358 e2411886 Scott Ullrich
                  <td width="78%" class="vtable"> 
359 b5c78501 Seth Mos
                    <?=$mandfldhtml;?><input name="remoteip" type="text" class="formfld unknown" id="remoteip" size="20" value="<?=htmlspecialchars($pconfig['remoteip']);?>">
360 5b237745 Scott Ullrich
                    <br>
361 6c762c62 Chris Buechler
                    Specify the starting address for the client IP subnet.<br>
362 07cae4b2 Scott Ullrich
                </tr>
363
                <tr> 
364 045c9cc9 sullrich
                  <td width="22%" valign="top" class="vncellreq">Max. concurrent 
365
                    connections</td>
366
                  <td width="78%" class="vtable"> 
367 f2b4ff2b sullrich
                    <?=$_POST['n_pptp_units'];?>
368 07cae4b2 Scott Ullrich
                  </td>
369
                <tr> 
370 045c9cc9 sullrich
                  <td width="22%" valign="top" class="vncellreq">Server address</td>
371
                  <td width="78%" class="vtable"> 
372
                    <?=$mandfldhtml;?><input name="localip" type="text" class="formfld" id="localip" size="20" value="<?=htmlspecialchars($pconfig['localip']);?>"> 
373
                    <br>
374
                    Enter the IP address the PPTP server should use on its side 
375
                    for all clients.</td>
376
                </tr>
377
                <tr> 
378
                  <td width="22%" valign="top" class="vncellreq">Remote address 
379
                    range</td>
380
                  <td width="78%" class="vtable"> 
381
                    <?=$mandfldhtml;?><input name="remoteip" type="text" class="formfld" id="remoteip" size="20" value="<?=htmlspecialchars($pconfig['remoteip']);?>">
382
                    / 
383 c6933c6d Ermal Lu?i
                    <?=$pconfig['pptp_subnet'];?>
384 045c9cc9 sullrich
                    <br>
385
                    Specify the starting address for the client IP address subnet.<br>
386
                    The PPTP server will assign 
387 f2b4ff2b sullrich
                    <?=$_POST['n_pptp_units'];?>
388 045c9cc9 sullrich
                    addresses, starting at the address entered above, to clients.</td>
389 5b237745 Scott Ullrich
                </tr>
390 c8c416db Scott Ullrich
                <tr> 
391 92d5144e Chris Buechler
                  <td width="22%" valign="top" class="vncell">PPTP DNS Servers</td>
392 c8c416db Scott Ullrich
                  <td width="78%" class="vtable"> 
393 b5c78501 Seth Mos
                    <?=$mandfldhtml;?><input name="pptp_dns1" type="text" class="formfld unknown" id="pptp_dns1" size="20" value="<?=htmlspecialchars($pconfig['pptp_dns1']);?>">
394 c8c416db Scott Ullrich
                    <br>
395 045c9cc9 sullrich
					<input name="pptp_dns2" type="text" class="formfld unknown" id="pptp_dns2" size="20" value="<?=htmlspecialchars($pconfig['pptp_dns2']);?>">
396 c8c416db Scott Ullrich
                    <br>
397 6c762c62 Chris Buechler
                   primary and secondary DNS servers assigned to PPTP clients<br>
398 c8c416db Scott Ullrich
                </tr>
399
                <tr> 
400
                  <td width="22%" valign="top" class="vncell">WINS Server</td>
401
                  <td width="78%" valign="top" class="vtable">
402 b5c78501 Seth Mos
                      <input name="wins" class="formfld unknown" id="wins" size="20" value="<?=htmlspecialchars($pconfig['wins']);?>">
403 c8c416db Scott Ullrich
                  </td>
404
                </tr>
405 e2411886 Scott Ullrich
                <tr> 
406 5b237745 Scott Ullrich
                  <td width="22%" valign="top" class="vncell">RADIUS</td>
407 e2411886 Scott Ullrich
                  <td width="78%" class="vtable"> 
408
                      <input name="radiusenable" type="checkbox" id="radiusenable" onclick="enable_change(false)" value="yes" <?php if ($pconfig['radiusenable']) echo "checked"; ?>>
409 c8c416db Scott Ullrich
                      <strong>Use a RADIUS server for authentication</strong><br>
410
                      When set, all users will be authenticated using 
411 e2411886 Scott Ullrich
                      the RADIUS server specified below. The local user database 
412 5b237745 Scott Ullrich
                      will not be used.<br>
413
                      <br>
414 e2411886 Scott Ullrich
                      <input name="radacct_enable" type="checkbox" id="radacct_enable" onclick="enable_change(false)" value="yes" <?php if ($pconfig['radacct_enable']) echo "checked"; ?>>
415 5b237745 Scott Ullrich
                      <strong>Enable RADIUS accounting <br>
416 c8c416db Scott Ullrich
                      </strong>Sends accounting packets to the RADIUS server.<br>
417
			 <br>
418
                      <input name="radiussecenable" type="checkbox" id="radiussecenable" onclick="enable_change(false)" value="yes" <?php if ($pconfig['radiussecenable']) echo "checked"; ?>>
419 6c762c62 Chris Buechler
                      <strong>Secondary RADIUS server for failover authentication</strong><br>
420 f9f160b1 Chris Buechler
                      When set, all requests will go to the secondary server when primary fails<br>
421
		      <br>
422
                      <input name="radiusissueips" value="yes" type="checkbox" class="formfld" id="radiusissueips"<?php if($pconfig['radiusissueips']) echo " CHECKED"; ?>>
423
		      <strong>RADIUS issued IPs</strong>
424
                      <br>Issue IP addresses via RADIUS server.
425
		      </td>
426
                 </td>
427 c8c416db Scott Ullrich
                </tr>
428
                <tr> 
429 6c762c62 Chris Buechler
                  <td width="22%" valign="top" class="vncell">RADIUS NAS IP</td>
430 c8c416db Scott Ullrich
                  <td width="78%" valign="top" class="vtable">
431 b5c78501 Seth Mos
                      <input name="radius_nasip" class="formfld unknown" id="radius_nasip" size="20" value="<?=htmlspecialchars($pconfig['radius_nasip']);?>">
432 c8c416db Scott Ullrich
                  </td>
433 f9f160b1 Chris Buechler
		</tr>
434 c8c416db Scott Ullrich
                <tr> 
435 6c762c62 Chris Buechler
                  <td width="22%" valign="top" class="vncell">RADIUS Accounting Update</td>
436 c8c416db Scott Ullrich
                  <td width="78%" valign="top" class="vtable">
437 b5c78501 Seth Mos
                      <input name="radius_acct_update" class="formfld unknown" id="radius_acct_update" size="20" value="<?=htmlspecialchars($pconfig['radius_acct_update']);?>">
438 c8c416db Scott Ullrich
                  </td>
439 f9f160b1 Chris Buechler
		</tr>
440 e2411886 Scott Ullrich
                <tr> 
441 6c762c62 Chris Buechler
                  <td width="22%" valign="top" class="vncell">RADIUS Server </td>
442 78cf56c6 Scott Ullrich
                  <td width="78%" class="vtable">
443 b5c78501 Seth Mos
                      <input name="radiusserver" type="text" class="formfld unknown" id="radiusserver" size="20" value="<?=htmlspecialchars($pconfig['radiusserver']);?>">
444
                      <input name="radiusserverport" type="text" class="formfld unknown" id="radiusserverport" size="4" value="<?=htmlspecialchars($pconfig['radiusserverport']);?>">
445
                      <input name="radiusserveracctport" type="text" class="formfld unknown" id="radiusserveracctport" size="4" value="<?=htmlspecialchars($pconfig['radiusserveracctport']);?>">
446 5b237745 Scott Ullrich
                      <br>
447 ba9d3f07 Chris Buechler
                      Enter the IP address, RADIUS port, and RADIUS accounting port of the RADIUS server.</td>
448 5b237745 Scott Ullrich
                </tr>
449 e2411886 Scott Ullrich
                <tr> 
450 5b237745 Scott Ullrich
                  <td width="22%" valign="top" class="vncell">RADIUS shared secret</td>
451 78cf56c6 Scott Ullrich
                  <td width="78%" valign="top" class="vtable">
452 b5c78501 Seth Mos
                      <input name="radiussecret" type="password" class="formfld pwd" id="radiussecret" size="20" value="<?=htmlspecialchars($pconfig['radiussecret']);?>">
453 5b237745 Scott Ullrich
                      <br>
454 e2411886 Scott Ullrich
                      Enter the shared secret that will be used to authenticate 
455
                      to the RADIUS server.</td>
456 07cae4b2 Scott Ullrich
                </tr>
457
                <tr> 
458 6c762c62 Chris Buechler
                  <td width="22%" valign="top" class="vncell">Secondary RADIUS server </td>
459 07cae4b2 Scott Ullrich
                  <td width="78%" class="vtable">
460 b5c78501 Seth Mos
                      <input name="radiusserver2" type="text" class="formfld unknown" id="radiusserver2" size="20" value="<?=htmlspecialchars($pconfig['radiusserver2']);?>">
461
                      <input name="radiusserver2port" type="text" class="formfld unknown" id="radiusserver2port" size="4" value="<?=htmlspecialchars($pconfig['radiusserver2port']);?>">
462
                      <input name="radiusserver2acctport" type="text" class="formfld unknown" id="radiusserver2acctport" size="4" value="<?=htmlspecialchars($pconfig['radiusserver2acctport']);?>">
463 07cae4b2 Scott Ullrich
                      <br>
464 ba9d3f07 Chris Buechler
                      Enter the IP address, RADIUS port, and RADIUS accounting port of the RADIUS server.</td>
465 07cae4b2 Scott Ullrich
                </tr>
466
                <tr> 
467 6c762c62 Chris Buechler
                  <td width="22%" valign="top" class="vncell">Secondary RADIUS shared secret</td>
468 07cae4b2 Scott Ullrich
                  <td width="78%" valign="top" class="vtable">
469 b5c78501 Seth Mos
                      <input name="radiussecret2" type="password" class="formfld pwd" id="radiussecret2" size="20" value="<?=htmlspecialchars($pconfig['radiussecret2']);?>">
470 07cae4b2 Scott Ullrich
                      <br>
471
                      Enter the shared secret that will be used to authenticate 
472 6c762c62 Chris Buechler
                      to the secondary RADIUS server.</td>
473 07cae4b2 Scott Ullrich
                </tr>
474 e2411886 Scott Ullrich
                <tr> 
475 5b237745 Scott Ullrich
                  <td height="16" colspan="2" valign="top"></td>
476
                </tr>
477 e2411886 Scott Ullrich
                <tr> 
478 5b237745 Scott Ullrich
                  <td width="22%" valign="middle">&nbsp;</td>
479 e2411886 Scott Ullrich
                  <td width="78%" class="vtable"> 
480
                    <input name="req128" type="checkbox" id="req128" value="yes" <?php if ($pconfig['req128']) echo "checked"; ?>> 
481 5b237745 Scott Ullrich
                    <strong>Require 128-bit encryption</strong><br>
482 6c762c62 Chris Buechler
                    When set, only 128-bit encryption will be accepted. Otherwise 
483
                    40-bit and 56-bit encryption will be accepted as well. Note that 
484 e2411886 Scott Ullrich
                    encryption will always be forced on PPTP connections (i.e. 
485 5b237745 Scott Ullrich
                    unencrypted connections will not be accepted).</td>
486
                </tr>
487 e2411886 Scott Ullrich
                <tr> 
488 5b237745 Scott Ullrich
                  <td width="22%" valign="top">&nbsp;</td>
489 e2411886 Scott Ullrich
                  <td width="78%"> 
490
                    <input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)"> 
491 5b237745 Scott Ullrich
                  </td>
492
                </tr>
493 e2411886 Scott Ullrich
                <tr> 
494
                  <td width="22%" valign="top">&nbsp;</td>
495
                  <td width="78%"><span class="vexpl"><span class="red"><strong>Note:<br>
496 c55a8ab9 Holger Bauer
                    </strong></span>don't forget to <a href="firewall_rules.php?if=pptp">add a firewall rule</a> to permit 
497 e2411886 Scott Ullrich
                    traffic from PPTP clients!</span></td>
498
                </tr>
499 5b237745 Scott Ullrich
              </table>
500 96f8c1e2 Bill Marquette
</div>
501 e2411886 Scott Ullrich
			</td>
502 5b237745 Scott Ullrich
	</tr>
503
</table>
504
</form>
505
<script language="JavaScript">
506
<!--
507
enable_change(false);
508
//-->
509
</script>
510
<?php include("fend.inc"); ?>
511 9999b3aa Scott Ullrich
</body>
512
</html>