Project

General

Profile

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