Project

General

Profile

Download (4.47 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
require("guiconfig.inc");
32
33
if (!is_array($config['pptpd']['user'])) {
34
	$config['pptpd']['user'] = array();
35
}
36
pptpd_users_sort();
37
$a_secret = &$config['pptpd']['user'];
38
39
if ($_POST) {
40
41
	$pconfig = $_POST;
42
43
	if ($_POST['apply']) {
44
		$retval = 0;
45 dd4c094a Scott Ullrich
		config_lock();
46
		$retval = vpn_pptpd_configure();
47
		config_unlock();
48 5b237745 Scott Ullrich
		$savemsg = get_std_save_message($retval);
49
		if ($retval == 0) {
50
			if (file_exists($d_pptpuserdirty_path))
51
				unlink($d_pptpuserdirty_path);
52
		}
53
	}
54
}
55
56
if ($_GET['act'] == "del") {
57
	if ($a_secret[$_GET['id']]) {
58
		unset($a_secret[$_GET['id']]);
59
		write_config();
60
		touch($d_pptpuserdirty_path);
61
		header("Location: vpn_pptp_users.php");
62
		exit;
63
	}
64
}
65 4df96eff Scott Ullrich
66 b128368a Bill Marquette
$pgtitle = "VPN: PPTP: Users";
67 4df96eff Scott Ullrich
include("head.inc");
68
69 5b237745 Scott Ullrich
?>
70 422f27c0 Scott Ullrich
71
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
72 5b237745 Scott Ullrich
<?php include("fbegin.inc"); ?>
73 b128368a Bill Marquette
<p class="pgtitle"><?=$pgtitle?></p>
74 5b237745 Scott Ullrich
<form action="vpn_pptp_users.php" method="post">
75
<?php if ($savemsg) print_info_box($savemsg); ?>
76
<?php if (isset($config['pptpd']['radius']['enable']))
77
	print_info_box("Warning: RADIUS is enabled. The local user database will not be used."); ?>
78
<?php if (file_exists($d_pptpuserdirty_path)): ?><p>
79
<?php print_info_box_np("The PPTP user list has been modified.<br>You must apply the changes in order for them to take effect.<br><b>Warning: this will terminate all current PPTP sessions!</b>");?><br>
80
<?php endif; ?>
81
<table width="100%" border="0" cellpadding="0" cellspacing="0">
82 e2411886 Scott Ullrich
  <tr><td class="tabnavtbl">
83 17982382 Scott Ullrich
<?php
84
	$tab_array = array();
85
	$tab_array[0] = array("Configuration", false, "vpn_pptp.php");
86
	$tab_array[1] = array("Users", true, "vpn_pptp_users.php");
87
	display_top_tabs($tab_array);
88
?>    </td></tr>
89 5b237745 Scott Ullrich
  <tr> 
90 4806cf1e Bill Marquette
	<td>
91
        <div id="mainarea">
92
              <table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0">
93 5b237745 Scott Ullrich
                <tr> 
94
                  <td class="listhdrr">Username</td>
95
                  <td class="listhdr">IP address</td>
96
                  <td class="list"></td>
97
				</tr>
98
			  <?php $i = 0; foreach ($a_secret as $secretent): ?>
99
                <tr> 
100 e2411886 Scott Ullrich
                  <td class="listlr">
101 5b237745 Scott Ullrich
                    <?=htmlspecialchars($secretent['name']);?>
102
                  </td>
103 e2411886 Scott Ullrich
                  <td class="listr">
104 5b237745 Scott Ullrich
                    <?=htmlspecialchars($secretent['ip']);?>&nbsp;
105
                  </td>
106 677c0869 Erik Kristensen
                  <td class="list" nowrap> <a href="vpn_pptp_users_edit.php?id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" title="edit user" width="17" height="17" border="0"></a>
107
                     &nbsp;<a href="vpn_pptp_users.php?act=del&id=<?=$i;?>" onclick="return confirm('Do you really want to delete this user?')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" title="delete user" width="17" height="17" border="0"></a></td>
108 e2411886 Scott Ullrich
				</tr>
109
			  <?php $i++; endforeach; ?>
110 5b237745 Scott Ullrich
                <tr> 
111
                  <td class="list" colspan="2"></td>
112 677c0869 Erik Kristensen
                  <td class="list"> <a href="vpn_pptp_users_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="add user" width="17" height="17" border="0"></a></td>
113 e2411886 Scott Ullrich
				</tr>
114 5b237745 Scott Ullrich
              </table>
115 949202c2 Bill Marquette
</div>
116 e2411886 Scott Ullrich
			</td>
117
	</tr>
118
</table>
119 5b237745 Scott Ullrich
</form>
120
<?php include("fend.inc"); ?>
121 9999b3aa Scott Ullrich
</body>
122
</html>