Projet

Général

Profil

Télécharger (5,36 ko) Statistiques
| Branche: | Tag: | Révision:

univnautes / usr / local / www / vpn_pptp_users.php @ bca63487

1
<?php
2
/*
3
	vpn_pptp_users.php
4
	part of m0n0wall (http://m0n0.ch/wall)
5
	
6
	Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
7
	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
##|+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
require("guiconfig.inc");
39
require_once("vpn.inc");
40

    
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
		$retval = vpn_setup();
53
		$savemsg = get_std_save_message($retval);
54
		if ($retval == 0) {
55
			if (is_subsystem_dirty('pptpusers'))
56
				clear_subsystem_dirty('pptpusers');
57
		}
58
	}
59
}
60

    
61
if ($_GET['act'] == "del") {
62
	if ($a_secret[$_GET['id']]) {
63
		unset($a_secret[$_GET['id']]);
64
		write_config();
65
		mark_subsystem_dirty('pptpusers');
66
		header("Location: vpn_pptp_users.php");
67
		exit;
68
	}
69
}
70

    
71
$pgtitle = array(gettext("VPN"),gettext("VPN PPTP"),gettext("Users"));
72
$shortcut_section = "pptps";
73
include("head.inc");
74

    
75
?>
76

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