Project

General

Profile

Download (4.92 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
require("guiconfig.inc");
32
33
if (!is_array($config['pppoe']['user'])) {
34
	$config['pppoe']['user'] = array();
35
}
36
pppoe_users_sort();
37
$a_secret = &$config['pppoe']['user'];
38
39
if ($_POST) {
40
41
	$pconfig = $_POST;
42
43
	if ($_POST['apply']) {
44
		$retval = 0;
45 920b3bb0 Scott Ullrich
46
		config_lock();
47 88964924 Scott Ullrich
		$retval = vpn_setup();
48 920b3bb0 Scott Ullrich
		config_unlock();
49
50 06e69b03 Scott Ullrich
		$savemsg = get_std_save_message($retval);
51
		if ($retval == 0) {
52
			if (file_exists($d_pppoeuserdirty_path))
53
				unlink($d_pppoeuserdirty_path);
54
		}
55
	}
56
}
57
58
if ($_GET['act'] == "del") {
59
	if ($a_secret[$_GET['id']]) {
60
		unset($a_secret[$_GET['id']]);
61
		write_config();
62
		touch($d_pppoeuserdirty_path);
63
		header("Location: vpn_pppoe_users.php");
64
		exit;
65
	}
66
}
67
68 6c1721d8 Scott Ullrich
$pgtitle = array("Services","PPPoE Server","Users");
69 06e69b03 Scott Ullrich
include("head.inc");
70
71
?>
72
73
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
74
<?php include("fbegin.inc"); ?>
75
<form action="vpn_pppoe_users.php" method="post">
76
<?php if ($savemsg) print_info_box($savemsg); ?>
77
<?php if (isset($config['pppoe']['radius']['enable']))
78
	print_info_box("Warning: RADIUS is enabled. The local user database will not be used."); ?>
79
<?php if (file_exists($d_pppoeuserdirty_path)): ?><p>
80 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>
81 06e69b03 Scott Ullrich
<?php endif; ?>
82
<table width="100%" border="0" cellpadding="0" cellspacing="0">
83
  <tr><td class="tabnavtbl">
84
<?php
85
	$tab_array = array();
86
	$tab_array[0] = array("Configuration", false, "vpn_pppoe.php");
87
	$tab_array[1] = array("Users", true, "vpn_pppoe_users.php");
88
	display_top_tabs($tab_array);
89
?>    </td></tr>
90
  <tr> 
91 4806cf1e Bill Marquette
	<td>
92
         <div id="mainarea">
93
              <table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0">
94 06e69b03 Scott Ullrich
                <tr> 
95
                  <td class="listhdrr">Username</td>
96
                  <td class="listhdr">IP address</td>
97 d415d821 Seth Mos
                  <td class="list">
98
			<table border="0" cellspacing="0" cellpadding="1">
99
			   <tr>
100
				<td width="17"></td>
101
				<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>
102
			   </tr>
103
			</table>
104
		  </td>
105
		</tr>
106 06e69b03 Scott Ullrich
			  <?php $i = 0; foreach ($a_secret as $secretent): ?>
107
                <tr> 
108
                  <td class="listlr">
109
                    <?=htmlspecialchars($secretent['name']);?>
110
                  </td>
111
                  <td class="listr">
112 0ba5e95b Scott Ullrich
		    <?php if($secretent['ip'] == "") $secretent['ip'] = "Dynamic"; ?>
113 06e69b03 Scott Ullrich
                    <?=htmlspecialchars($secretent['ip']);?>&nbsp;
114
                  </td>
115
                  <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>
116
                     &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>
117
				</tr>
118
			  <?php $i++; endforeach; ?>
119
                <tr> 
120
                  <td class="list" colspan="2"></td>
121 d415d821 Seth Mos
                  <td class="list">
122
			<table border="0" cellspacing="0" cellpadding="1">
123
			   <tr>
124
				<td width="17"></td>
125
				<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>
126
			   </tr>
127
			</table>
128
		  </td>
129
		</tr>
130 06e69b03 Scott Ullrich
              </table>
131 6d4ac2e3 Bill Marquette
</div>
132 06e69b03 Scott Ullrich
			</td>
133
	</tr>
134
</table>
135
</form>
136
<?php include("fend.inc"); ?>
137
</body>
138
</html>
139