Project

General

Profile

Download (6.57 KB) Statistics
| Branch: | Tag: | Revision:
1 2f35382a Seth Mos
<?php
2
/* $Id$ */
3
/*
4
	system_gateway_groups.php
5
	part of pfSense (http://pfsense.com)
6
7
	Copyright (C) 2007 Seth Mos <seth.mos@xs4all.nl>.
8
	All rights reserved.
9
10
	Redistribution and use in source and binary forms, with or without
11
	modification, are permitted provided that the following conditions are met:
12
13
	1. Redistributions of source code must retain the above copyright notice,
14
	   this list of conditions and the following disclaimer.
15
16
	2. Redistributions in binary form must reproduce the above copyright
17
	   notice, this list of conditions and the following disclaimer in the
18
	   documentation and/or other materials provided with the distribution.
19
20
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
21
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
22
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
24
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29
	POSSIBILITY OF SUCH DAMAGE.
30
*/
31 1d333258 Scott Ullrich
/*
32
	pfSense_MODULE:	routing
33
*/
34 2f35382a Seth Mos
35 6b07c15a Matthew Grooms
##|+PRIV
36
##|*IDENT=page-system-gatewaygroups
37
##|*NAME=System: Gateway Groups page
38
##|*DESCR=Allow access to the 'System: Gateway Groups' page.
39
##|*MATCH=system_gateway_groups.php*
40
##|-PRIV
41
42 2f35382a Seth Mos
require("guiconfig.inc");
43 7a927e67 Scott Ullrich
require_once("functions.inc");
44
require_once("filter.inc");
45
require_once("shaper.inc");
46 2f35382a Seth Mos
47
if (!is_array($config['gateways']['gateway_group']))
48
	$config['gateways']['gateway_group'] = array();
49
50
$a_gateway_groups = &$config['gateways']['gateway_group'];
51 5ccd9857 Seth Mos
$a_gateways = &$config['gateways']['gateway_item'];
52 2f35382a Seth Mos
$changedesc = "Gateway Groups: ";
53
54
if ($_POST) {
55
56
	$pconfig = $_POST;
57
58
	if ($_POST['apply']) {
59
60
		$retval = 0;
61
62
		$retval = system_routing_configure();
63
		$retval |= filter_configure();
64
65
		$savemsg = get_std_save_message($retval);
66 a368a026 Ermal Lu?i
		if ($retval == 0)
67
			clear_subsystem_dirty('staticroutes');
68 2f35382a Seth Mos
	}
69
}
70
71
if ($_GET['act'] == "del") {
72
	if ($a_gateway_groups[$_GET['id']]) {
73
		$changedesc .= "removed gateway group {$_GET['id']}";
74
		unset($a_gateway_groups[$_GET['id']]);
75
		write_config($changedesc);
76 a368a026 Ermal Lu?i
		mark_subsystem_dirty('staticroutes');
77 2f35382a Seth Mos
		header("Location: system_gateway_groups.php");
78
		exit;
79
	}
80
}
81
82
$pgtitle = array("System","Gateway Groups");
83
include("head.inc");
84
85
?>
86
87
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
88
<?php include("fbegin.inc"); ?>
89 5ccd9857 Seth Mos
<form action="system_gateway_groups.php" method="post">
90 2f35382a Seth Mos
<input type="hidden" name="y1" value="1">
91
<?php if ($savemsg) print_info_box($savemsg); ?>
92 a368a026 Ermal Lu?i
<?php if (is_subsystem_dirty('staticroutes')): ?><p>
93 2f35382a Seth Mos
<?php print_info_box_np("The gateway configuration has been changed.<br>You must apply the changes in order for them to take 
94
effect.");?><br>
95
<?php endif; ?>
96
	<table width="100%" border="0" cellpadding="0" cellspacing="0">
97
		<tr>
98
		  <td>
99
<?php
100
			$tab_array = array();
101
			$tab_array[0] = array("Gateways", false, "system_gateways.php");
102
			$tab_array[1] = array("Routes", false, "system_routes.php");
103
			$tab_array[2] = array("Groups", true, "system_gateway_groups.php");
104 db7b006f Seth Mos
			$tab_array[3] = array("Settings", false, "system_gateways_settings.php");
105 2f35382a Seth Mos
			display_top_tabs($tab_array);
106
?>
107
</td></tr>
108
 <tr>
109
   <td>
110
	<div id="mainarea">
111
             <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
112
                <tr>
113
                  <td width="15%" class="listhdrr">Group Name</td>
114
                  <td width="15%" class="listhdrr">Gateways</td>
115
                  <td width="20%" class="listhdrr">Priority</td>
116
                  <td width="30%" class="listhdr">Description</td>
117
                  <td width="10%" class="list">
118
			<table border="0" cellspacing="0" cellpadding="1">
119
			   <tr>
120
				<td width="17"></td>
121
				<td><a href="system_gateway_groups_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td>
122
			   </tr>
123
			</table>
124
		  </td>
125
		</tr>
126
			  <?php $i = 0; foreach ($a_gateway_groups as $gateway_group): ?>
127
                <tr>
128
                  <td class="listlr" ondblclick="document.location='system_gateway_groups_edit.php?id=<?=$i;?>';">
129
                    <?php
130
			echo $gateway_group['name'];
131
			?>
132
			
133
                  </td>
134
                  <td class="listr" ondblclick="document.location='system_gateway_groups_edit.php?id=<?=$i;?>';">
135
                    <?php
136 5ccd9857 Seth Mos
			foreach($gateway_group['item'] as $item) {
137
				$itemsplit = explode("|", $item);
138 adc79e41 Scott Ullrich
				echo htmlspecialchars(strtoupper($itemsplit[0])) . "<br/>\n";
139 5ccd9857 Seth Mos
			}
140
		    ?>
141 2f35382a Seth Mos
                  </td>
142
                  <td class="listr" ondblclick="document.location='system_gateway_groups_edit.php?id=<?=$i;?>';">
143
		    <?php
144 5ccd9857 Seth Mos
			foreach($gateway_group['item'] as $item) {
145
				$itemsplit = explode("|", $item);
146
				echo "Tier ". htmlspecialchars($itemsplit[1]) . "<br/>\n";
147
			}
148
		    ?>
149 2f35382a Seth Mos
                  </td>
150
                  <td class="listbg" ondblclick="document.location='system_gateway_groups_edit.php?id=<?=$i;?>';">
151 33300c73 Scott Ullrich
						<?=htmlspecialchars($gateway_group['descr']);?>&nbsp;
152 2f35382a Seth Mos
                  </td>
153
                  <td valign="middle" nowrap class="list">
154
			<table border="0" cellspacing="0" cellpadding="1">
155
			   <tr>
156
				<td><a href="system_gateway_groups_edit.php?id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a>
157
				<td><a href="system_gateway_groups.php?act=del&id=<?=$i;?>" onclick="return confirm('Do you really want to delete this gateway group?')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td>
158
			   </tr>
159
			   <tr>
160
				<td width="17"></td>
161
				<td><a href="system_gateway_groups_edit.php?dup=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td>
162
			   </tr>
163
			</table>
164
165
		</tr>
166
			  <?php $i++; endforeach; ?>
167
                <tr>
168
                  <td class="list" colspan="4"></td>
169
                  <td class="list">
170
			<table border="0" cellspacing="0" cellpadding="1">
171
			   <tr>
172
				<td width="17"></td>
173
				<td><a href="system_gateway_groups_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td>
174
			   </tr>
175
		                    </table>
176
				  </td>
177
		                </tr>
178
			</table>
179
			</div>
180
			</td>
181
		  </tr>
182
		</table>
183
            </form>
184
<?php include("fend.inc"); ?>
185
</body>
186
</html>