Project

General

Profile

Download (5.05 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 b32dd0a6 jim-p
$shortcut_section = "trafficshaper";
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 4271dfb8 Colin Fleming
$closehead = false;
83 c9f0b1c2 Ermal Luçi
include("head.inc");
84
?>
85 4271dfb8 Colin Fleming
<link rel="stylesheet" type="text/css" media="all" href="./tree/tree.css" />
86
</head>
87 c9f0b1c2 Ermal Luçi
88
<body link="#0000CC" vlink="#0000CC" alink="#0000CC" >
89 4271dfb8 Colin Fleming
90
<?php include("fbegin.inc");  ?>
91 c9f0b1c2 Ermal Luçi
<?php if ($input_errors) print_input_errors($input_errors); ?>
92
93
<form action="firewall_shaper_wizards.php" method="post" id="iform" name="iform">
94
95
<?php if ($savemsg) print_info_box($savemsg); ?>
96 a368a026 Ermal Lu?i
<?php if (is_subsystem_dirty('shaper')): ?><p>
97 4271dfb8 Colin Fleming
<?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/></p>
98 c9f0b1c2 Ermal Luçi
<?php endif; ?>
99 4271dfb8 Colin Fleming
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="traffic shaper wizard">
100 c9f0b1c2 Ermal Luçi
  <tr><td>
101
<?php
102
	$tab_array = array();
103 c056f625 Vinicius Coque
	$tab_array[0] = array(gettext("By Interface"), false, "firewall_shaper.php");
104
	$tab_array[1] = array(gettext("By Queue"), false, "firewall_shaper_queues.php");
105
	$tab_array[2] = array(gettext("Limiter"), false, "firewall_shaper_vinterface.php");
106
	$tab_array[3] = array(gettext("Layer7"), false, "firewall_shaper_layer7.php");
107
	$tab_array[4] = array(gettext("Wizards"), true, "firewall_shaper_wizards.php");
108 c9f0b1c2 Ermal Luçi
	display_top_tabs($tab_array);
109
?>
110
  </td></tr>
111
  <tr>
112
    <td>
113
	<div id="mainarea">
114 4271dfb8 Colin Fleming
              <table  width="100%" border="0" cellpadding="0" cellspacing="0" summary="main area">
115 c9f0b1c2 Ermal Luçi
			  <tr>
116 4271dfb8 Colin Fleming
		  		<td class="listhdrr" width="25%" align="center" ><?=gettext("Wizard function");?></td>
117
		  		<td class="listhdrr" width="75%" align="center"><?=gettext("Wizard Link");?></td>
118 c9f0b1c2 Ermal Luçi
			  </tr>
119
			  <?php	foreach ($wizards as $key => $wizard):  ?>
120
                        <tr class="tabcont"><td class="listlr" style="background-color: #e0e0e0" width="25%" align="center">
121
				<?php echo $key;?>
122
                        </td><td class="listr" style="background-color: #e0e0e0" width="75%" align="center">
123
				<?php echo "<a href=\"wizard.php?xml=" . $wizard ."\" >" .$wizard . "</a>"; ?>
124
				</td></tr>
125
				<?php endforeach; ?>
126
             </table>
127
		</div>
128
	  </td>
129
	</tr>
130
</table>
131
</form>
132 4271dfb8 Colin Fleming
<?php include("fend.inc"); ?>
133 c9f0b1c2 Ermal Luçi
</body>
134
</html>