diff options
author | D. V. Serg <dvserg@pfsense.org> | 2009-02-03 20:16:56 +0000 |
---|---|---|
committer | D. V. Serg <dvserg@pfsense.org> | 2009-02-03 20:16:56 +0000 |
commit | c47f71f4111fe0d3419c06716495b7ee03329fdd (patch) | |
tree | e276b4ab059e5e6b53e9a6cc397823f61167c347 /packages | |
parent | 4f10431e90ca6b614c3bd031fe1eb6c3c53a76b6 (diff) | |
download | pfsense-packages-c47f71f4111fe0d3419c06716495b7ee03329fdd.tar.gz pfsense-packages-c47f71f4111fe0d3419c06716495b7ee03329fdd.tar.bz2 pfsense-packages-c47f71f4111fe0d3419c06716495b7ee03329fdd.zip |
Bug fix (ACL)
Diffstat (limited to 'packages')
-rw-r--r-- | packages/squidGuard/squidguard.inc | 56 |
1 files changed, 35 insertions, 21 deletions
diff --git a/packages/squidGuard/squidguard.inc b/packages/squidGuard/squidguard.inc index 4b712e70..38ab4b7c 100644 --- a/packages/squidGuard/squidguard.inc +++ b/packages/squidGuard/squidguard.inc @@ -454,7 +454,7 @@ function squidguard_before_form_acl($pkg, $is_acl=true) { $fld['options']['option'][] = array('name'=>$nm, 'value'=>$nm); } } - # test + # order if (is_array($source_items) && $field['fieldname'] == 'order') { $fld = &$pkg['fields']['field'][$i]; foreach($source_items as $nmkey => $nm) @@ -468,36 +468,50 @@ function squidguard_before_form_acl($pkg, $is_acl=true) { # destinations # acls pass ---> prepare data for destinations; dest format 'uptime_dests_list [overtime_dests_list]' $acl_dest = ''; + $acl_overdest = ''; # acl & default - if ($pkg['name'] !== MODULE_DEFAULT) - $acl_dest = $squidguard_config[F_ACLS]['item'][$current_id][F_DESTINATIONNAME]; + if ($pkg['name'] !== MODULE_DEFAULT) { + $acl_dest = $squidguard_config[F_ACLS]['item'][$current_id][F_DESTINATIONNAME]; + $acl_overdest = $squidguard_config[F_ACLS]['item'][$current_id][F_OVERDESTINATIONNAME]; + } else $acl_dest = $squidguard_config[F_DEFAULT][F_DESTINATIONNAME]; + # acl dest ontime if ($acl_dest) { - $overtime = ''; - $pss = explode(' ', str_replace(']', '', $acl_dest)); + # 'none' > to '!all' + $acl_dest = str_replace('none', '!all', $acl_dest); + + $pss = explode(' ', $acl_dest); foreach($pss as $val) { $name = $val; $name = str_replace('!', '', $name); $name = str_replace('^', '', $name); - if ($val === '[') { $overtime = 'yes'; continue; } - elseif ($val === ']') { break; } - if (empty($overtime)) { - if (!empty($val)) { - switch($val[0]) { - case '!': $acls_up[$name] = 'deny'; break; - case '^': $acls_up[$name] = 'white'; break; - default : $acls_up[$name] = 'allow'; break; - } + if (!empty($val)) { + switch($val[0]) { + case '!': $acls_up[$name] = 'deny'; break; + case '^': $acls_up[$name] = 'white'; break; + default : $acls_up[$name] = 'allow'; break; } - } else { - if (!empty($val)) { - switch($val[0]) { - case '!': $acls_over[$name] = 'deny'; break; - case '^': $acls_over[$name] = 'white'; break; - default : $acls_over[$name] = 'allow'; break; - } + } + } + } + + # acl dest overtime + if ($acl_overdest) { + # 'none' > to '!all' + $acl_overdest = str_replace('none', '!all', $acl_overdest); + + $pss = explode(' ', $acl_overdest); + foreach($pss as $val) { + $name = $val; + $name = str_replace('!', '', $name); + $name = str_replace('^', '', $name); + if (!empty($val)) { + switch($val[0]) { + case '!': $acls_over[$name] = 'deny'; break; + case '^': $acls_over[$name] = 'white'; break; + default : $acls_over[$name] = 'allow'; break; } } } |