Project

General

Profile

Download (4.97 KB) Statistics
| Branch: | Tag: | Revision:
1 c9f0b1c2 Ermal Luçi
<?php
2
/* $Id$ */
3
/*
4 a368a026 Ermal Lu?i
	firewall_shaper_wizards.php
5 c9f0b1c2 Ermal Luçi
	Copyright (C) 2004, 2005 Scott Ullrich
6
	Copyright (C) 2008 Ermal Lu?i
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 7ac5a4cb Scott Ullrich
/*
31
	pfSense_BUILDER_BINARIES:	/usr/bin/killall
32
	pfSense_MODULE:	shaper
33
*/
34 c9f0b1c2 Ermal Luçi
35 6b07c15a Matthew Grooms
##|+PRIV
36
##|*IDENT=page-firewall-trafficshaper-wizard
37
##|*NAME=Firewall: Traffic Shaper: Wizard page
38
##|*DESCR=Allow access to the 'Firewall: Traffic Shaper: Wizard' page.
39
##|*MATCH=firewall_shaper_wizards.php*
40
##|-PRIV
41
42 c9f0b1c2 Ermal Luçi
require("guiconfig.inc");
43 7a927e67 Scott Ullrich
require_once("functions.inc");
44
require_once("filter.inc");
45
require_once("shaper.inc");
46 c9f0b1c2 Ermal Luçi
47
if($_GET['reset'] <> "") {
48 7ac5a4cb Scott Ullrich
	/* XXX: Huh, why are we killing php? */
49
	mwexec("/usr/bin/killall -9 pfctl php");
50 c9f0b1c2 Ermal Luçi
	exit;
51
}
52
53 96b777d6 Ermal Luçi
if ($_POST['apply']) {
54
          write_config();
55
56
          $retval = 0;
57
        /* Setup pf rules since the user may have changed the optimization value */
58
                        $retval = filter_configure();
59 0027de0a Ermal Lu?i
         $savemsg = get_std_save_message($retval);
60 96b777d6 Ermal Luçi
                        if (stristr($retval, "error") <> true)
61
                                $savemsg = get_std_save_message($retval);
62
                        else
63
                                $savemsg = $retval;
64
65
                /* reset rrd queues */
66
                system("rm -f /var/db/rrd/*queuedrops.rrd");
67
                system("rm -f /var/db/rrd/*queues.rrd");
68
                        enable_rrd_graphing();
69
70 a368a026 Ermal Lu?i
		clear_subsystem_dirty('shaper');
71 96b777d6 Ermal Luçi
}
72
73 9eae6681 Renato Botelho
$pgtitle = array(gettext("Firewall"),gettext("Traffic Shaper"),gettext("Wizards"));
74 b9b9b4d8 jim-p
$statusurl = "status_queues.php";
75 c9f0b1c2 Ermal Luçi
76 a389635b heitor.lessa
$wizards = array(gettext("Single Lan multi Wan") => "traffic_shaper_wizard.xml",
77 9eae6681 Renato Botelho
                gettext("Single Wan multi Lan") => "traffic_shaper_wizard_multi_lan.xml",
78
				gettext("Multiple Lan/Wan") => "traffic_shaper_wizard_multi_all.xml",
79
				gettext("Dedicated Links") => "traffic_shaper_wizard_dedicated.xml",
80 a389635b heitor.lessa
				);
81 c9f0b1c2 Ermal Luçi
82
include("head.inc");
83
?>
84
85
<body link="#0000CC" vlink="#0000CC" alink="#0000CC" >
86
<link rel="stylesheet" type="text/css" media="all" href="./tree/tree.css" />
87
<?php
88
include("fbegin.inc"); 
89
?>
90
<?php if ($input_errors) print_input_errors($input_errors); ?>
91
92
<form action="firewall_shaper_wizards.php" method="post" id="iform" name="iform">
93
94
<?php if ($savemsg) print_info_box($savemsg); ?>
95 a368a026 Ermal Lu?i
<?php if (is_subsystem_dirty('shaper')): ?><p>
96 c056f625 Vinicius Coque
<?php print_info_box_np(gettext("The traffic shaper configuration has been changed.")."<br>".gettext("You must apply the changes in order for them to take effect."));?><br>
97 c9f0b1c2 Ermal Luçi
<?php endif; ?>
98
<table width="100%" border="0" cellpadding="0" cellspacing="0">
99
  <tr><td>
100
<?php
101
	$tab_array = array();
102 c056f625 Vinicius Coque
	$tab_array[0] = array(gettext("By Interface"), false, "firewall_shaper.php");
103
	$tab_array[1] = array(gettext("By Queue"), false, "firewall_shaper_queues.php");
104
	$tab_array[2] = array(gettext("Limiter"), false, "firewall_shaper_vinterface.php");
105
	$tab_array[3] = array(gettext("Layer7"), false, "firewall_shaper_layer7.php");
106
	$tab_array[4] = array(gettext("Wizards"), true, "firewall_shaper_wizards.php");
107 c9f0b1c2 Ermal Luçi
	display_top_tabs($tab_array);
108
?>
109
  </td></tr>
110
  <tr>
111
    <td>
112
	<div id="mainarea">
113
              <table  width="100%" border="0" cellpadding="0" cellspacing="0">
114
			  <tr>
115 c056f625 Vinicius Coque
			  		<td class="listhdrr" width="25%" align="center" ><?=gettext("Wizard function");?></td>
116
			  		<td class="listhdrr" width="75%" align="center"><?=gettext("Wizard Link");?></td>
117 c9f0b1c2 Ermal Luçi
			  </tr>
118
			  <?php	foreach ($wizards as $key => $wizard):  ?>
119
                        <tr class="tabcont"><td class="listlr" style="background-color: #e0e0e0" width="25%" align="center">
120
				<?php echo $key;?>
121
                        </td><td class="listr" style="background-color: #e0e0e0" width="75%" align="center">
122
				<?php echo "<a href=\"wizard.php?xml=" . $wizard ."\" >" .$wizard . "</a>"; ?>
123
				</td></tr>
124
				<?php endforeach; ?>
125
             </table>
126
		</div>
127
	  </td>
128
	</tr>
129
</table>
130
</form>
131
<?php include("fend.inc"); 
132
?>
133
</body>
134
</html>