Project

General

Profile

Download (5.23 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 5b237745 Scott Ullrich
	All rights reserved.
8
	
9
	Redistribution and use in source and binary forms, with or without
10
	modification, are permitted provided that the following conditions are met:
11
	
12
	1. Redistributions of source code must retain the above copyright notice,
13
	   this list of conditions and the following disclaimer.
14
	
15
	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
	
19
	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-users
33
##|*NAME=VPN: VPN PPTP: Users page
34
##|*DESCR=Allow access to the 'VPN: VPN PPTP: Users' page.
35
##|*MATCH=vpn_pptp_users.php*
36
##|-PRIV
37
38 5b237745 Scott Ullrich
require("guiconfig.inc");
39 483e6de8 Scott Ullrich
require_once("vpn.inc");
40 5b237745 Scott Ullrich
41
if (!is_array($config['pptpd']['user'])) {
42
	$config['pptpd']['user'] = array();
43
}
44
$a_secret = &$config['pptpd']['user'];
45
46
if ($_POST) {
47
48
	$pconfig = $_POST;
49
50
	if ($_POST['apply']) {
51
		$retval = 0;
52 88964924 Scott Ullrich
		$retval = vpn_setup();
53 5b237745 Scott Ullrich
		$savemsg = get_std_save_message($retval);
54
		if ($retval == 0) {
55 a368a026 Ermal Lu?i
			if (is_subsystem_dirty('pptpusers'))
56
				clear_subsystem_dirty('pptpusers');
57 5b237745 Scott Ullrich
		}
58
	}
59
}
60
61
if ($_GET['act'] == "del") {
62
	if ($a_secret[$_GET['id']]) {
63
		unset($a_secret[$_GET['id']]);
64
		write_config();
65 a368a026 Ermal Lu?i
		mark_subsystem_dirty('pptpusers');
66 5b237745 Scott Ullrich
		header("Location: vpn_pptp_users.php");
67
		exit;
68
	}
69
}
70 4df96eff Scott Ullrich
71 a7a9a566 Rafael Lucas
$pgtitle = array(gettext("VPN"),gettext("VPN PPTP"),gettext("Users"));
72 b32dd0a6 jim-p
$shortcut_section = "pptps";
73 4df96eff Scott Ullrich
include("head.inc");
74
75 5b237745 Scott Ullrich
?>
76 422f27c0 Scott Ullrich
77
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
78 5b237745 Scott Ullrich
<?php include("fbegin.inc"); ?>
79
<form action="vpn_pptp_users.php" method="post">
80
<?php if ($savemsg) print_info_box($savemsg); ?>
81
<?php if (isset($config['pptpd']['radius']['enable']))
82 a7a9a566 Rafael Lucas
	print_info_box(gettext("Warning: RADIUS is enabled. The local user database will not be used.")); ?>
83 a368a026 Ermal Lu?i
<?php if (is_subsystem_dirty('pptpusers')): ?><p>
84 e43b1051 Carlos Eduardo Ramos
<?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>".gettext("Warning: this will terminate all current PPTP sessions")."!</b>");?><br>
85 5b237745 Scott Ullrich
<?php endif; ?>
86
<table width="100%" border="0" cellpadding="0" cellspacing="0">
87 e2411886 Scott Ullrich
  <tr><td class="tabnavtbl">
88 17982382 Scott Ullrich
<?php
89
	$tab_array = array();
90 a7a9a566 Rafael Lucas
	$tab_array[0] = array(gettext("Configuration"), false, "vpn_pptp.php");
91
	$tab_array[1] = array(gettext("Users"), true, "vpn_pptp_users.php");
92 17982382 Scott Ullrich
	display_top_tabs($tab_array);
93
?>    </td></tr>
94 5b237745 Scott Ullrich
  <tr> 
95 4806cf1e Bill Marquette
	<td>
96
        <div id="mainarea">
97
              <table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0">
98 5b237745 Scott Ullrich
                <tr> 
99 a7a9a566 Rafael Lucas
                  <td class="listhdrr"><?=gettext("Username");?></td>
100
                  <td class="listhdr"><?=gettext("IP address");?></td>
101 d415d821 Seth Mos
                  <td class="list">
102
			<table border="0" cellspacing="0" cellpadding="1">
103
			   <tr>
104
				<td width="17"></td>
105 a7a9a566 Rafael Lucas
				<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"></a></td>
106 d415d821 Seth Mos
			   </tr>
107
			</table>
108
		  </td>
109
		</tr>
110 5b237745 Scott Ullrich
			  <?php $i = 0; foreach ($a_secret as $secretent): ?>
111
                <tr> 
112 e2411886 Scott Ullrich
                  <td class="listlr">
113 5b237745 Scott Ullrich
                    <?=htmlspecialchars($secretent['name']);?>
114
                  </td>
115 e2411886 Scott Ullrich
                  <td class="listr">
116 5b237745 Scott Ullrich
                    <?=htmlspecialchars($secretent['ip']);?>&nbsp;
117
                  </td>
118 a7a9a566 Rafael Lucas
                  <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"></a>
119 c53220ef Erik Fonnesbeck
                     &nbsp;<a href="vpn_pptp_users.php?act=del&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"></a></td>
120 e2411886 Scott Ullrich
				</tr>
121
			  <?php $i++; endforeach; ?>
122 5b237745 Scott Ullrich
                <tr> 
123
                  <td class="list" colspan="2"></td>
124 d415d821 Seth Mos
                  <td class="list">
125
			<table border="0" cellspacing="0" cellpadding="1">
126
			   <tr>
127
				<td width="17"></td>
128 a7a9a566 Rafael Lucas
				<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"></a></td>
129 d415d821 Seth Mos
			   </tr>
130
			</table>
131
		  </td>
132
		</tr>
133 5b237745 Scott Ullrich
              </table>
134 949202c2 Bill Marquette
</div>
135 e2411886 Scott Ullrich
			</td>
136
	</tr>
137
</table>
138 5b237745 Scott Ullrich
</form>
139
<?php include("fend.inc"); ?>
140 9999b3aa Scott Ullrich
</body>
141
</html>