Project

General

Profile

Download (6.46 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
32 6b07c15a Matthew Grooms
##|+PRIV
33
##|*IDENT=page-system-gatewaygroups
34
##|*NAME=System: Gateway Groups page
35
##|*DESCR=Allow access to the 'System: Gateway Groups' page.
36
##|*MATCH=system_gateway_groups.php*
37
##|-PRIV
38
39
40 2f35382a Seth Mos
require("guiconfig.inc");
41
42
if (!is_array($config['gateways']['gateway_group']))
43
	$config['gateways']['gateway_group'] = array();
44
45
$a_gateway_groups = &$config['gateways']['gateway_group'];
46 5ccd9857 Seth Mos
$a_gateways = &$config['gateways']['gateway_item'];
47 2f35382a Seth Mos
$changedesc = "Gateway Groups: ";
48
49
if ($_POST) {
50
51
	$pconfig = $_POST;
52
53
	if ($_POST['apply']) {
54
55
		$retval = 0;
56
57
		$retval = system_routing_configure();
58
		$retval |= filter_configure();
59
60
		$savemsg = get_std_save_message($retval);
61 a368a026 Ermal Lu?i
		if ($retval == 0)
62
			clear_subsystem_dirty('staticroutes');
63 2f35382a Seth Mos
	}
64
}
65
66
if ($_GET['act'] == "del") {
67
	if ($a_gateway_groups[$_GET['id']]) {
68
		$changedesc .= "removed gateway group {$_GET['id']}";
69
		unset($a_gateway_groups[$_GET['id']]);
70
		write_config($changedesc);
71 a368a026 Ermal Lu?i
		mark_subsystem_dirty('staticroutes');
72 2f35382a Seth Mos
		header("Location: system_gateway_groups.php");
73
		exit;
74
	}
75
}
76
77
$pgtitle = array("System","Gateway Groups");
78
include("head.inc");
79
80
?>
81
82
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
83
<?php include("fbegin.inc"); ?>
84 5ccd9857 Seth Mos
<form action="system_gateway_groups.php" method="post">
85 2f35382a Seth Mos
<input type="hidden" name="y1" value="1">
86
<?php if ($savemsg) print_info_box($savemsg); ?>
87 a368a026 Ermal Lu?i
<?php if (is_subsystem_dirty('staticroutes')): ?><p>
88 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 
89
effect.");?><br>
90
<?php endif; ?>
91
	<table width="100%" border="0" cellpadding="0" cellspacing="0">
92
		<tr>
93
		  <td>
94
<?php
95
			$tab_array = array();
96
			$tab_array[0] = array("Gateways", false, "system_gateways.php");
97
			$tab_array[1] = array("Routes", false, "system_routes.php");
98
			$tab_array[2] = array("Groups", true, "system_gateway_groups.php");
99 db7b006f Seth Mos
			$tab_array[3] = array("Settings", false, "system_gateways_settings.php");
100 2f35382a Seth Mos
			display_top_tabs($tab_array);
101
?>
102
</td></tr>
103
 <tr>
104
   <td>
105
	<div id="mainarea">
106
             <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
107
                <tr>
108
                  <td width="15%" class="listhdrr">Group Name</td>
109
                  <td width="15%" class="listhdrr">Gateways</td>
110
                  <td width="20%" class="listhdrr">Priority</td>
111
                  <td width="30%" class="listhdr">Description</td>
112
                  <td width="10%" class="list">
113
			<table border="0" cellspacing="0" cellpadding="1">
114
			   <tr>
115
				<td width="17"></td>
116
				<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>
117
			   </tr>
118
			</table>
119
		  </td>
120
		</tr>
121
			  <?php $i = 0; foreach ($a_gateway_groups as $gateway_group): ?>
122
                <tr>
123
                  <td class="listlr" ondblclick="document.location='system_gateway_groups_edit.php?id=<?=$i;?>';">
124
                    <?php
125
			echo $gateway_group['name'];
126
			?>
127
			
128
                  </td>
129
                  <td class="listr" ondblclick="document.location='system_gateway_groups_edit.php?id=<?=$i;?>';">
130
                    <?php
131 5ccd9857 Seth Mos
			foreach($gateway_group['item'] as $item) {
132
				$itemsplit = explode("|", $item);
133 adc79e41 Scott Ullrich
				echo htmlspecialchars(strtoupper($itemsplit[0])) . "<br/>\n";
134 5ccd9857 Seth Mos
			}
135
		    ?>
136 2f35382a Seth Mos
                  </td>
137
                  <td class="listr" ondblclick="document.location='system_gateway_groups_edit.php?id=<?=$i;?>';">
138
		    <?php
139 5ccd9857 Seth Mos
			foreach($gateway_group['item'] as $item) {
140
				$itemsplit = explode("|", $item);
141
				echo "Tier ". htmlspecialchars($itemsplit[1]) . "<br/>\n";
142
			}
143
		    ?>
144 2f35382a Seth Mos
                  </td>
145
                  <td class="listbg" ondblclick="document.location='system_gateway_groups_edit.php?id=<?=$i;?>';">
146 33300c73 Scott Ullrich
						<?=htmlspecialchars($gateway_group['descr']);?>&nbsp;
147 2f35382a Seth Mos
                  </td>
148
                  <td valign="middle" nowrap class="list">
149
			<table border="0" cellspacing="0" cellpadding="1">
150
			   <tr>
151
				<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>
152
				<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>
153
			   </tr>
154
			   <tr>
155
				<td width="17"></td>
156
				<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>
157
			   </tr>
158
			</table>
159
160
		</tr>
161
			  <?php $i++; endforeach; ?>
162
                <tr>
163
                  <td class="list" colspan="4"></td>
164
                  <td class="list">
165
			<table border="0" cellspacing="0" cellpadding="1">
166
			   <tr>
167
				<td width="17"></td>
168
				<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>
169
			   </tr>
170
		                    </table>
171
				  </td>
172
		                </tr>
173
			</table>
174
			</div>
175
			</td>
176
		  </tr>
177
		</table>
178
            </form>
179
<?php include("fend.inc"); ?>
180
</body>
181
</html>