diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2007-03-24 00:19:30 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2007-03-24 00:19:30 +0000 |
commit | 80403d6e273923ed78a73f711a14b76f308d80ad (patch) | |
tree | 45b37cc55a0f5db3c1ed268031d79b261e918bdc /etc | |
parent | ffb714391b4ccc7c4ec02df85b67166f47b975cc (diff) | |
download | pfsense-80403d6e273923ed78a73f711a14b76f308d80ad.zip pfsense-80403d6e273923ed78a73f711a14b76f308d80ad.tar.gz |
Improve logic and minimize if statements
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/pfsense-utils.inc | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index 1b428e1..6327dd5 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -114,15 +114,8 @@ function get_time_based_rule_status($schedule) { } else { $positionstatus = true; } - if($week) { - if($day) { - if($hour) { - if($position) { - if($should_add_rule == false) - $should_add_rule = true; - } - } - } + if($week && $day && $hour && $position) { + $should_add_rule = true; } } @@ -188,7 +181,7 @@ function tdr_week($schedule) { * week 1, week 2, week 3, week 4 */ global $debug; - $todays_week = date("W"); + $todays_week = date("W"); $weeks = split(",", $schedule); foreach($weeks as $week) { if($week == $todays_week) |