Project

General

Profile

Download (5.52 KB) Statistics
| Branch: | Tag: | Revision:
1 5b237745 Scott Ullrich
<?php
2 85616372 Sander van Leeuwen
3
/*
4
	WARNING: DEPRICATED! SHOULD NOT BE CONVERTED. SEE https://github.com/SjonHortensius/pfsense/issues/229
5
*/
6
7 5b237745 Scott Ullrich
/*
8
	vpn_pptp_users.php
9
	part of m0n0wall (http://m0n0.ch/wall)
10
	
11 e2411886 Scott Ullrich
	Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
12 ce77a9c4 Phil Davis
	Copyright (C) 2013-2015 Electric Sheep Fencing, LP
13 5b237745 Scott Ullrich
	All rights reserved.
14
	
15
	Redistribution and use in source and binary forms, with or without
16
	modification, are permitted provided that the following conditions are met:
17
	
18
	1. Redistributions of source code must retain the above copyright notice,
19
	   this list of conditions and the following disclaimer.
20
	
21
	2. Redistributions in binary form must reproduce the above copyright
22
	   notice, this list of conditions and the following disclaimer in the
23
	   documentation and/or other materials provided with the distribution.
24
	
25
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
26
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
27
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
28
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
29
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34
	POSSIBILITY OF SUCH DAMAGE.
35
*/
36
37 6b07c15a Matthew Grooms
##|+PRIV
38
##|*IDENT=page-vpn-vpnpptp-users
39
##|*NAME=VPN: VPN PPTP: Users page
40
##|*DESCR=Allow access to the 'VPN: VPN PPTP: Users' page.
41
##|*MATCH=vpn_pptp_users.php*
42
##|-PRIV
43
44 5b237745 Scott Ullrich
require("guiconfig.inc");
45 483e6de8 Scott Ullrich
require_once("vpn.inc");
46 5b237745 Scott Ullrich
47
if (!is_array($config['pptpd']['user'])) {
48
	$config['pptpd']['user'] = array();
49
}
50
$a_secret = &$config['pptpd']['user'];
51
52
if ($_POST) {
53
54
	$pconfig = $_POST;
55
56
	if ($_POST['apply']) {
57
		$retval = 0;
58 88964924 Scott Ullrich
		$retval = vpn_setup();
59 5b237745 Scott Ullrich
		$savemsg = get_std_save_message($retval);
60
		if ($retval == 0) {
61 a368a026 Ermal Lu?i
			if (is_subsystem_dirty('pptpusers'))
62
				clear_subsystem_dirty('pptpusers');
63 5b237745 Scott Ullrich
		}
64
	}
65
}
66
67
if ($_GET['act'] == "del") {
68
	if ($a_secret[$_GET['id']]) {
69
		unset($a_secret[$_GET['id']]);
70
		write_config();
71 a368a026 Ermal Lu?i
		mark_subsystem_dirty('pptpusers');
72 5b237745 Scott Ullrich
		header("Location: vpn_pptp_users.php");
73
		exit;
74
	}
75
}
76 4df96eff Scott Ullrich
77 a7a9a566 Rafael Lucas
$pgtitle = array(gettext("VPN"),gettext("VPN PPTP"),gettext("Users"));
78 b32dd0a6 jim-p
$shortcut_section = "pptps";
79 4df96eff Scott Ullrich
include("head.inc");
80
81 5b237745 Scott Ullrich
?>
82 422f27c0 Scott Ullrich
83
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
84 5b237745 Scott Ullrich
<?php include("fbegin.inc"); ?>
85
<form action="vpn_pptp_users.php" method="post">
86
<?php if ($savemsg) print_info_box($savemsg); ?>
87
<?php if (isset($config['pptpd']['radius']['enable']))
88 a7a9a566 Rafael Lucas
	print_info_box(gettext("Warning: RADIUS is enabled. The local user database will not be used.")); ?>
89 bca63487 Colin Fleming
<?php if (is_subsystem_dirty('pptpusers')): ?><br/>
90
<?php print_info_box_np(gettext("The PPTP user list has been modified").".<br />".gettext("You must apply the changes in order for them to take effect").".<br /></b><b>".gettext("Warning: this will terminate all current PPTP sessions")."!");?><br />
91 5b237745 Scott Ullrich
<?php endif; ?>
92 bca63487 Colin Fleming
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="vpn pptp users">
93 e2411886 Scott Ullrich
  <tr><td class="tabnavtbl">
94 17982382 Scott Ullrich
<?php
95
	$tab_array = array();
96 a7a9a566 Rafael Lucas
	$tab_array[0] = array(gettext("Configuration"), false, "vpn_pptp.php");
97
	$tab_array[1] = array(gettext("Users"), true, "vpn_pptp_users.php");
98 17982382 Scott Ullrich
	display_top_tabs($tab_array);
99
?>    </td></tr>
100 5b237745 Scott Ullrich
  <tr> 
101 4806cf1e Bill Marquette
	<td>
102
        <div id="mainarea">
103 bca63487 Colin Fleming
              <table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
104 5b237745 Scott Ullrich
                <tr> 
105 a7a9a566 Rafael Lucas
                  <td class="listhdrr"><?=gettext("Username");?></td>
106
                  <td class="listhdr"><?=gettext("IP address");?></td>
107 d415d821 Seth Mos
                  <td class="list">
108 bca63487 Colin Fleming
			<table border="0" cellspacing="0" cellpadding="1" summary="add">
109 d415d821 Seth Mos
			   <tr>
110
				<td width="17"></td>
111 bca63487 Colin Fleming
				<td><a href="vpn_pptp_users_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("add user");?>" width="17" height="17" border="0" alt="add" /></a></td>
112 d415d821 Seth Mos
			   </tr>
113
			</table>
114
		  </td>
115
		</tr>
116 5b237745 Scott Ullrich
			  <?php $i = 0; foreach ($a_secret as $secretent): ?>
117
                <tr> 
118 e2411886 Scott Ullrich
                  <td class="listlr">
119 5b237745 Scott Ullrich
                    <?=htmlspecialchars($secretent['name']);?>
120
                  </td>
121 e2411886 Scott Ullrich
                  <td class="listr">
122 5b237745 Scott Ullrich
                    <?=htmlspecialchars($secretent['ip']);?>&nbsp;
123
                  </td>
124 bca63487 Colin Fleming
                  <td class="list nowrap"><a href="vpn_pptp_users_edit.php?id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" title="<?=gettext("edit user");?>" width="17" height="17" border="0" alt="edit" /></a>
125
                     &nbsp;<a href="vpn_pptp_users.php?act=del&amp;id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this user?");?>')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" title="<?=gettext("delete user");?>" width="17" height="17" border="0" alt="delete" /></a></td>
126 e2411886 Scott Ullrich
				</tr>
127
			  <?php $i++; endforeach; ?>
128 5b237745 Scott Ullrich
                <tr> 
129
                  <td class="list" colspan="2"></td>
130 d415d821 Seth Mos
                  <td class="list">
131 bca63487 Colin Fleming
			<table border="0" cellspacing="0" cellpadding="1" summary="add">
132 d415d821 Seth Mos
			   <tr>
133
				<td width="17"></td>
134 bca63487 Colin Fleming
				<td><a href="vpn_pptp_users_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("add user");?>" width="17" height="17" border="0" alt="add" /></a></td>
135 d415d821 Seth Mos
			   </tr>
136
			</table>
137
		  </td>
138
		</tr>
139 5b237745 Scott Ullrich
              </table>
140 949202c2 Bill Marquette
</div>
141 e2411886 Scott Ullrich
			</td>
142
	</tr>
143
</table>
144 5b237745 Scott Ullrich
</form>
145
<?php include("fend.inc"); ?>
146 9999b3aa Scott Ullrich
</body>
147
</html>