Project

General

Profile

Download (4.81 KB) Statistics
| Branch: | Tag: | Revision:
1
<?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
	Copyright (C) 2004-2009 Scott Ullrich
11
	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
/*
35
	pfSense_BUILDER_BINARIES:	/bin/kill	/sbin/ifconfig	
36
	pfSense_MODULE:	interfaces
37
*/
38

    
39
##|+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
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
	$iflist = get_configured_interface_list(false, true);
56
	foreach ($iflist as $if) {
57
		if ($config['interfaces'][$if]['if'] == "ppp{$num}")
58
			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
		interfaces_ppp_configure();
71
		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
	$tab_array[1] = array("Interface Groups", false, "interfaces_groups.php");
90
	$tab_array[2] = array("VLANs", false, "interfaces_vlan.php");
91
	$tab_array[3] = array("QinQs", false, "interfaces_qinq.php");
92
	$tab_array[4] = array("PPP", true, "interfaces_ppp.php");
93
	$tab_array[5] = array("GRE", false, "interfaces_gre.php");
94
	$tab_array[6] = array("GIF", false, "interfaces_gif.php");
95
	$tab_array[7] = array("Bridges", false, "interfaces_bridge.php");
96
	$tab_array[8] = array("LAGG", false, "interfaces_lagg.php");
97
	display_top_tabs($tab_array);
98
?>
99
  </td></tr>
100
  <tr>
101
    <td>
102
	<div id="mainarea">
103
	<table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
104
                <tr>
105
                  <td width="20%" class="listhdrr">Serial Port</td>
106
                  <td width="50%" class="listhdr">Description</td>
107
                  <td width="10%" class="list"></td>
108
				</tr>
109
			  <?php $i = 0; foreach ($a_ppps as $id => $ppp): ?>
110
                <tr>
111
                  <td class="listr">
112
					<?=htmlspecialchars($ppp['port']);?>
113
                  </td>
114
                  <td class="listbg">
115
                    <?=htmlspecialchars($ppp['descr']);?>&nbsp;
116
                  </td>
117
                  <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>
118
                     &nbsp;<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>
119
				</tr>
120
			  <?php $i++; endforeach; ?>
121
                <tr>
122
                  <td class="list" colspan="2">&nbsp;</td>
123
                  <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>
124
				</tr>
125
              </table>
126
	      </div>
127
	</td>
128
	</tr>
129
</table>
130
<?php include("fend.inc"); ?>
131
</body>
132
</html>
(90-90/216)