diff --git a/usr/local/www/firewall_rules_edit.php b/usr/local/www/firewall_rules_edit.php
index ddaa2f07bf..5b0e636748 100755
--- a/usr/local/www/firewall_rules_edit.php
+++ b/usr/local/www/firewall_rules_edit.php
@@ -100,6 +100,9 @@ if (isset($id) && $a_filter[$id]) {
/* Multi-WAN next-hop support */
$pconfig['gateway'] = $a_filter[$id]['gateway'];
+
+ //schedule support
+ $pconfig['sched'] = $a_filter[$id]['sched'];
} else {
/* defaults */
@@ -320,6 +323,10 @@ if ($_POST) {
$filterent['gateway'] = $_POST['gateway'];
}
+ if ($_POST['sched'] != "") {
+ $filterent['sched'] = $_POST['sched'];
+ }
+
if (isset($id) && $a_filter[$id])
$a_filter[$id] = $filterent;
else {
@@ -715,10 +722,42 @@ include("head.inc");
HINT: This prevents the rule from automatically syncing to other carp members.
+ "")
+ $schedules[] = $schedule['name'];
+ }
+ ?>
+
+
Schedule
+
+
+
Leave as 'none' to leave the rule enabled all the time.
+
+
+
"")
$gateways[]=$int['gateway'];
diff --git a/usr/local/www/firewall_schedule.php b/usr/local/www/firewall_schedule.php
new file mode 100644
index 0000000000..7be2967868
--- /dev/null
+++ b/usr/local/www/firewall_schedule.php
@@ -0,0 +1,218 @@
+.
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+*/
+
+
+$pgtitle = "Firewall: Schedules";
+
+$dayArray = array ('Sun','Mon','Tues','Wed','Thur','Fri','Sat');
+$monthArray = array ('January','February','March','April','May','June','July','August','September','October','November','December');
+
+require("guiconfig.inc");
+
+if (!is_array($config['schedules']['schedule']))
+ $config['schedules']['schedule'] = array();
+
+schedule_sort();
+$a_schedules = &$config['schedules']['schedule'];
+
+
+if ($_GET['act'] == "del") {
+ if ($a_schedules[$_GET['id']]) {
+ /* make sure rule is not being referenced by any nat or filter rules */
+ $is_schedule_referenced = false;
+ $referenced_by = false;
+ $schedule_name = $a_schedules[$_GET['id']]['name'];
+
+ if(is_array($config['filter']['rule'])) {
+ foreach($config['filter']['rule'] as $rule) {
+ //check for this later once this is established
+ if ($rule['sched'] = $schedule_name){
+ $referenced_by = $rule['descr'];
+ $is_schedule_referenced = true;
+ }
+ }
+ }
+
+ if($is_schedule_referenced == true) {
+ $savemsg = "Cannot delete Schedule. Currently in use by {$referenced_by}";
+ } else {
+ unset($a_schedules[$_GET['id']]);
+ write_config();
+ header("Location: firewall_schedule.php");
+ exit;
+ }
+ }
+}
+
+include("head.inc");
+?>
+
+
+
+