diff options
author | Scott Dale <sdale@pfsense.org> | 2007-05-07 11:47:09 +0000 |
---|---|---|
committer | Scott Dale <sdale@pfsense.org> | 2007-05-07 11:47:09 +0000 |
commit | e56fcb7132abc3b6de844682ca37b7b4834b3f47 (patch) | |
tree | 53f1b9b52cc8c3b9f9a45d77332b1a9641aba19c /usr/local | |
parent | 3abc1918b8a64dd5bacfa12c2634d7ca06b3d715 (diff) | |
download | pfsense-e56fcb7132abc3b6de844682ca37b7b4834b3f47.zip pfsense-e56fcb7132abc3b6de844682ca37b7b4834b3f47.tar.gz |
correctly determine if time range exists
Diffstat (limited to 'usr/local')
-rw-r--r-- | usr/local/www/firewall_schedule_edit.php | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/usr/local/www/firewall_schedule_edit.php b/usr/local/www/firewall_schedule_edit.php index a187723..df0fff2 100644 --- a/usr/local/www/firewall_schedule_edit.php +++ b/usr/local/www/firewall_schedule_edit.php @@ -77,10 +77,6 @@ if ($_POST) { $input_errors[] = "The schedule name may only consist of the characters a-z, A-Z, 0-9"; } - if (!$_POST['schedule0']) - $input_errors[] = "The schedule must have at least one time range configured."; - - /* check for name conflicts */ foreach ($a_schedules as $schedule) { if (isset($id) && ($a_schedules[$id]) && ($a_schedules[$id] === $schedule)) @@ -96,9 +92,10 @@ if ($_POST) { $schedule['name'] = $_POST['name']; $schedule['descr'] = htmlentities($_POST['descr'], ENT_QUOTES, 'UTF-8'); - + $timerangeFound = false; for ($x=0; $x<99; $x++){ if($_POST['schedule' . $x]) { + $timerangeFound = true; $timeparts = array(); $firstprint = false; $timestr = $_POST['schedule' . $x]; @@ -141,8 +138,9 @@ if ($_POST) { $schedule['timerange'][$x] = $timeparts; } } - + if (!$timerangeFound) + $input_errors[] = "The schedule must have at least one time range configured."; if (!$input_errors) { |