Project

General

Profile

Download (5.52 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2

    
3
/*
4
	WARNING: DEPRICATED! SHOULD NOT BE CONVERTED. SEE https://github.com/SjonHortensius/pfsense/issues/229
5
*/
6

    
7
/*
8
	vpn_pptp_users.php
9
	part of m0n0wall (http://m0n0.ch/wall)
10
	
11
	Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
12
	Copyright (C) 2013-2015 Electric Sheep Fencing, LP
13
	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
##|+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
require("guiconfig.inc");
45
require_once("vpn.inc");
46

    
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
		$retval = vpn_setup();
59
		$savemsg = get_std_save_message($retval);
60
		if ($retval == 0) {
61
			if (is_subsystem_dirty('pptpusers'))
62
				clear_subsystem_dirty('pptpusers');
63
		}
64
	}
65
}
66

    
67
if ($_GET['act'] == "del") {
68
	if ($a_secret[$_GET['id']]) {
69
		unset($a_secret[$_GET['id']]);
70
		write_config();
71
		mark_subsystem_dirty('pptpusers');
72
		header("Location: vpn_pptp_users.php");
73
		exit;
74
	}
75
}
76

    
77
$pgtitle = array(gettext("VPN"),gettext("VPN PPTP"),gettext("Users"));
78
$shortcut_section = "pptps";
79
include("head.inc");
80

    
81
?>
82

    
83
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
84
<?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
	print_info_box(gettext("Warning: RADIUS is enabled. The local user database will not be used.")); ?>
89
<?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
<?php endif; ?>
92
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="vpn pptp users">
93
  <tr><td class="tabnavtbl">
94
<?php
95
	$tab_array = array();
96
	$tab_array[0] = array(gettext("Configuration"), false, "vpn_pptp.php");
97
	$tab_array[1] = array(gettext("Users"), true, "vpn_pptp_users.php");
98
	display_top_tabs($tab_array);
99
?>    </td></tr>
100
  <tr> 
101
	<td>
102
        <div id="mainarea">
103
              <table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
104
                <tr> 
105
                  <td class="listhdrr"><?=gettext("Username");?></td>
106
                  <td class="listhdr"><?=gettext("IP address");?></td>
107
                  <td class="list">
108
			<table border="0" cellspacing="0" cellpadding="1" summary="add">
109
			   <tr>
110
				<td width="17"></td>
111
				<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
			   </tr>
113
			</table>
114
		  </td>
115
		</tr>
116
			  <?php $i = 0; foreach ($a_secret as $secretent): ?>
117
                <tr> 
118
                  <td class="listlr">
119
                    <?=htmlspecialchars($secretent['name']);?>
120
                  </td>
121
                  <td class="listr">
122
                    <?=htmlspecialchars($secretent['ip']);?>&nbsp;
123
                  </td>
124
                  <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
				</tr>
127
			  <?php $i++; endforeach; ?>
128
                <tr> 
129
                  <td class="list" colspan="2"></td>
130
                  <td class="list">
131
			<table border="0" cellspacing="0" cellpadding="1" summary="add">
132
			   <tr>
133
				<td width="17"></td>
134
				<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
			   </tr>
136
			</table>
137
		  </td>
138
		</tr>
139
              </table>
140
</div>
141
			</td>
142
	</tr>
143
</table>
144
</form>
145
<?php include("fend.inc"); ?>
146
</body>
147
</html>
(235-235/238)