Project

General

Profile

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