Project

General

Profile

Download (5.09 KB) Statistics
| Branch: | Tag: | Revision:
1 06e69b03 Scott Ullrich
<?php
2
/*
3
	vpn_pppoe_users.php
4
	part of pfSense
5
	
6
	Copyright (C) 2005 Scott Ullrich (sullrich@gmail.com)
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 6b07c15a Matthew Grooms
##|+PRIV
32
##|*IDENT=page-services-pppoeserver-users
33
##|*NAME=Services: PPPoE Server: Users page
34
##|*DESCR=Allow access to the 'Services: PPPoE Server: Users' page.
35
##|*MATCH=vpn_pppoe_users.php*
36
##|-PRIV
37
38 06e69b03 Scott Ullrich
require("guiconfig.inc");
39 483e6de8 Scott Ullrich
require_once("vpn.inc");
40 06e69b03 Scott Ullrich
41
if (!is_array($config['pppoe']['user'])) {
42
	$config['pppoe']['user'] = array();
43
}
44
$a_secret = &$config['pppoe']['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 06e69b03 Scott Ullrich
		$savemsg = get_std_save_message($retval);
54
		if ($retval == 0) {
55 a368a026 Ermal Lu?i
			if (is_subsystem_dirty('pppoeusers'))
56
				clear_subsystem_dirty('pppoeusers');
57 06e69b03 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('pppoeusers');
66 06e69b03 Scott Ullrich
		header("Location: vpn_pppoe_users.php");
67
		exit;
68
	}
69
}
70
71 6c1721d8 Scott Ullrich
$pgtitle = array("Services","PPPoE Server","Users");
72 06e69b03 Scott Ullrich
include("head.inc");
73
74
?>
75
76
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
77
<?php include("fbegin.inc"); ?>
78
<form action="vpn_pppoe_users.php" method="post">
79
<?php if ($savemsg) print_info_box($savemsg); ?>
80
<?php if (isset($config['pppoe']['radius']['enable']))
81
	print_info_box("Warning: RADIUS is enabled. The local user database will not be used."); ?>
82 a368a026 Ermal Lu?i
<?php if (is_subsystem_dirty('pppoeusers')): ?><p>
83 d844e31d Scott Ullrich
<?php print_info_box_np("The PPPoE 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 PPPoE sessions!</b>");?><br>
84 06e69b03 Scott Ullrich
<?php endif; ?>
85
<table width="100%" border="0" cellpadding="0" cellspacing="0">
86
  <tr><td class="tabnavtbl">
87
<?php
88
	$tab_array = array();
89
	$tab_array[0] = array("Configuration", false, "vpn_pppoe.php");
90
	$tab_array[1] = array("Users", true, "vpn_pppoe_users.php");
91
	display_top_tabs($tab_array);
92
?>    </td></tr>
93
  <tr> 
94 4806cf1e Bill Marquette
	<td>
95
         <div id="mainarea">
96
              <table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0">
97 06e69b03 Scott Ullrich
                <tr> 
98
                  <td class="listhdrr">Username</td>
99
                  <td class="listhdr">IP address</td>
100 d415d821 Seth Mos
                  <td class="list">
101
			<table border="0" cellspacing="0" cellpadding="1">
102
			   <tr>
103
				<td width="17"></td>
104
				<td><a href="vpn_pppoe_users_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="add user" width="17" height="17" border="0"></a></td>
105
			   </tr>
106
			</table>
107
		  </td>
108
		</tr>
109 06e69b03 Scott Ullrich
			  <?php $i = 0; foreach ($a_secret as $secretent): ?>
110
                <tr> 
111
                  <td class="listlr">
112
                    <?=htmlspecialchars($secretent['name']);?>
113
                  </td>
114
                  <td class="listr">
115 0ba5e95b Scott Ullrich
		    <?php if($secretent['ip'] == "") $secretent['ip'] = "Dynamic"; ?>
116 06e69b03 Scott Ullrich
                    <?=htmlspecialchars($secretent['ip']);?>&nbsp;
117
                  </td>
118
                  <td class="list" nowrap> <a href="vpn_pppoe_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>
119
                     &nbsp;<a href="vpn_pppoe_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>
120
				</tr>
121
			  <?php $i++; endforeach; ?>
122
                <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
				<td><a href="vpn_pppoe_users_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="add user" width="17" height="17" border="0"></a></td>
129
			   </tr>
130
			</table>
131
		  </td>
132
		</tr>
133 06e69b03 Scott Ullrich
              </table>
134 6d4ac2e3 Bill Marquette
</div>
135 06e69b03 Scott Ullrich
			</td>
136
	</tr>
137
</table>
138
</form>
139
<?php include("fend.inc"); ?>
140
</body>
141
</html>
142