1 |
860c4e80
|
Chris Buechler
|
<?php
|
2 |
|
|
/*
|
3 |
|
|
interfaces_lan.php
|
4 |
|
|
part of pfSense(http://pfsense.org)
|
5 |
|
|
|
6 |
|
|
Originally written by Adam Lebsack <adam at holonyx dot com>
|
7 |
|
|
Changes by Chris Buechler <cmb at pfsense dot org>
|
8 |
|
|
|
9 |
|
|
Copyright (C) 2004-2008 BSD Perimeter LLC.
|
10 |
4aca19b3
|
Scott Ullrich
|
Copyright (C) 2004-2009 Scott Ullrich
|
11 |
860c4e80
|
Chris Buechler
|
All rights reserved.
|
12 |
|
|
|
13 |
|
|
Redistribution and use in source and binary forms, with or without
|
14 |
|
|
modification, are permitted provided that the following conditions are met:
|
15 |
|
|
|
16 |
|
|
1. Redistributions of source code must retain the above copyright notice,
|
17 |
|
|
this list of conditions and the following disclaimer.
|
18 |
|
|
|
19 |
|
|
2. Redistributions in binary form must reproduce the above copyright
|
20 |
|
|
notice, this list of conditions and the following disclaimer in the
|
21 |
|
|
documentation and/or other materials provided with the distribution.
|
22 |
|
|
|
23 |
|
|
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
24 |
|
|
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
25 |
|
|
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
26 |
|
|
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
27 |
|
|
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
28 |
|
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
29 |
|
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
30 |
|
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
31 |
|
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
32 |
|
|
POSSIBILITY OF SUCH DAMAGE.
|
33 |
|
|
*/
|
34 |
7ac5a4cb
|
Scott Ullrich
|
/*
|
35 |
|
|
pfSense_BUILDER_BINARIES: /bin/kill /sbin/ifconfig
|
36 |
|
|
pfSense_MODULE: interfaces
|
37 |
|
|
*/
|
38 |
860c4e80
|
Chris Buechler
|
|
39 |
6b07c15a
|
Matthew Grooms
|
##|+PRIV
|
40 |
|
|
##|*IDENT=page-interfaces-ppp
|
41 |
|
|
##|*NAME=Interfaces: PPP page
|
42 |
|
|
##|*DESCR=Allow access to the 'Interfaces: PPP' page.
|
43 |
|
|
##|*MATCH=interfaces_ppp.php*
|
44 |
|
|
##|-PRIV
|
45 |
|
|
|
46 |
860c4e80
|
Chris Buechler
|
require("guiconfig.inc");
|
47 |
|
|
|
48 |
|
|
if (!is_array($config['ppps']['ppp']))
|
49 |
|
|
$config['ppps']['ppp'] = array();
|
50 |
|
|
|
51 |
|
|
$a_ppps = &$config['ppps']['ppp'] ;
|
52 |
|
|
|
53 |
|
|
function ppp_inuse($num) {
|
54 |
|
|
global $config, $g;
|
55 |
fbb45bb0
|
Ermal Luçi
|
$iflist = get_configured_interface_list(false, true);
|
56 |
|
|
foreach ($iflist as $if) {
|
57 |
|
|
if ($config['interfaces'][$if]['if'] == "ppp{$num}")
|
58 |
860c4e80
|
Chris Buechler
|
return true;
|
59 |
|
|
}
|
60 |
|
|
return false;
|
61 |
|
|
}
|
62 |
|
|
|
63 |
|
|
if ($_GET['act'] == "del") {
|
64 |
|
|
/* check if still in use */
|
65 |
|
|
if (ppp_inuse($_GET['id'])) {
|
66 |
|
|
$input_errors[] = "This PPP interface cannot be deleted because it is still being used as an interface.";
|
67 |
|
|
} else {
|
68 |
|
|
unset($a_ppps[$_GET['id']]);
|
69 |
|
|
write_config();
|
70 |
4aca19b3
|
Scott Ullrich
|
interfaces_ppp_configure();
|
71 |
860c4e80
|
Chris Buechler
|
header("Location: interfaces_ppp.php");
|
72 |
|
|
exit;
|
73 |
|
|
}
|
74 |
|
|
}
|
75 |
|
|
|
76 |
|
|
$pgtitle = "Interfaces: PPP";
|
77 |
|
|
include("head.inc");
|
78 |
|
|
|
79 |
|
|
?>
|
80 |
|
|
|
81 |
|
|
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
|
82 |
|
|
<?php include("fbegin.inc"); ?>
|
83 |
|
|
<?php if ($input_errors) print_input_errors($input_errors); ?>
|
84 |
|
|
<table width="100%" border="0" cellpadding="0" cellspacing="0">
|
85 |
|
|
<tr><td>
|
86 |
|
|
<?php
|
87 |
|
|
$tab_array = array();
|
88 |
|
|
$tab_array[0] = array("Interface assignments", false, "interfaces_assign.php");
|
89 |
0ec2fdf0
|
Ermal Lu?i
|
$tab_array[1] = array("Interface Groups", false, "interfaces_groups.php");
|
90 |
79637b03
|
Erik Fonnesbeck
|
$tab_array[2] = array("Wireless", false, "interfaces_wireless.php");
|
91 |
|
|
$tab_array[3] = array("VLANs", false, "interfaces_vlan.php");
|
92 |
|
|
$tab_array[4] = array("QinQs", false, "interfaces_qinq.php");
|
93 |
|
|
$tab_array[5] = array("PPP", true, "interfaces_ppp.php");
|
94 |
|
|
$tab_array[6] = array("GRE", false, "interfaces_gre.php");
|
95 |
|
|
$tab_array[7] = array("GIF", false, "interfaces_gif.php");
|
96 |
|
|
$tab_array[8] = array("Bridges", false, "interfaces_bridge.php");
|
97 |
|
|
$tab_array[9] = array("LAGG", false, "interfaces_lagg.php");
|
98 |
860c4e80
|
Chris Buechler
|
display_top_tabs($tab_array);
|
99 |
|
|
?>
|
100 |
|
|
</td></tr>
|
101 |
|
|
<tr>
|
102 |
|
|
<td>
|
103 |
|
|
<div id="mainarea">
|
104 |
|
|
<table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
|
105 |
|
|
<tr>
|
106 |
|
|
<td width="20%" class="listhdrr">Serial Port</td>
|
107 |
|
|
<td width="50%" class="listhdr">Description</td>
|
108 |
|
|
<td width="10%" class="list"></td>
|
109 |
|
|
</tr>
|
110 |
|
|
<?php $i = 0; foreach ($a_ppps as $id => $ppp): ?>
|
111 |
fd22be34
|
Ermal Lu?i
|
<tr ondblclick="document.location='interfaces_ppp_edit.php?id=<?=$i;?>'">
|
112 |
860c4e80
|
Chris Buechler
|
<td class="listr">
|
113 |
|
|
<?=htmlspecialchars($ppp['port']);?>
|
114 |
|
|
</td>
|
115 |
|
|
<td class="listbg">
|
116 |
|
|
<?=htmlspecialchars($ppp['descr']);?>
|
117 |
|
|
</td>
|
118 |
|
|
<td valign="middle" nowrap class="list"> <a href="interfaces_ppp_edit.php?id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a>
|
119 |
|
|
<a href="interfaces_ppp.php?act=del&id=<?=$i;?>" onclick="return confirm('Do you really want to delete this PPP interface?')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td>
|
120 |
|
|
</tr>
|
121 |
|
|
<?php $i++; endforeach; ?>
|
122 |
|
|
<tr>
|
123 |
4aca19b3
|
Scott Ullrich
|
<td class="list" colspan="2"> </td>
|
124 |
860c4e80
|
Chris Buechler
|
<td class="list"> <a href="interfaces_ppp_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td>
|
125 |
|
|
</tr>
|
126 |
|
|
</table>
|
127 |
|
|
</div>
|
128 |
|
|
</td>
|
129 |
|
|
</tr>
|
130 |
|
|
</table>
|
131 |
|
|
<?php include("fend.inc"); ?>
|
132 |
|
|
</body>
|
133 |
|
|
</html>
|