aboutsummaryrefslogtreecommitdiffstats
path: root/config/squid3/31/squid.inc
diff options
context:
space:
mode:
authorStephane Lapie <stephane.lapie@asahinet.com>2014-06-23 23:41:59 +0900
committerStephane Lapie <stephane.lapie@asahinet.com>2014-06-23 23:41:59 +0900
commitec079fc18a1289be2676fa57c15829b20cb4a912 (patch)
tree658ebfeb07d9ead4fb5c8d86d723a94819d02511 /config/squid3/31/squid.inc
parentab69db91000fd3d83bf86811ede117062f57f438 (diff)
parent5b4c84c4ecc9a6eded4ce3443a665eae2c8a43f9 (diff)
downloadpfsense-packages-ec079fc18a1289be2676fa57c15829b20cb4a912.tar.gz
pfsense-packages-ec079fc18a1289be2676fa57c15829b20cb4a912.tar.bz2
pfsense-packages-ec079fc18a1289be2676fa57c15829b20cb4a912.zip
Merge https://github.com/pfsense/pfsense-packages
Conflicts: pkg_config.10.xml pkg_config.8.xml pkg_config.8.xml.amd64
Diffstat (limited to 'config/squid3/31/squid.inc')
-rw-r--r--config/squid3/31/squid.inc37
1 files changed, 17 insertions, 20 deletions
diff --git a/config/squid3/31/squid.inc b/config/squid3/31/squid.inc
index 0256d078..ef346e1a 100644
--- a/config/squid3/31/squid.inc
+++ b/config/squid3/31/squid.inc
@@ -365,7 +365,7 @@ function squid_deinstall_command() {
filter_configure();
}
-function squid_before_form_general($pkg) {
+function squid_before_form_general(&$pkg) {
$values = get_dir(SQUID_CONFBASE . '/errors/');
// Get rid of '..' and '.' and ...
array_shift($values);
@@ -389,7 +389,7 @@ function squid_before_form_general($pkg) {
$field['options']['option'][] = array('name' => $names[$i], 'value' => $values[$i]);
}
-function squid_validate_general($post, $input_errors) {
+function squid_validate_general($post, &$input_errors) {
global $config;
if (is_array($config['installedpackages']['squid']))
$settings = $config['installedpackages']['squid']['config'][0];
@@ -402,6 +402,7 @@ function squid_validate_general($post, $input_errors) {
if (!empty($icp_port) && !is_port($icp_port))
$input_errors[] = 'You must enter a valid port number in the \'ICP port\' field';
+
if (substr($post['log_dir'], -1, 1) == '/')
$input_errors[] = 'You may not end log location with an / mark';
@@ -451,7 +452,7 @@ function squid_validate_general($post, $input_errors) {
}}
}
-function squid_validate_upstream($post, $input_errors) {
+function squid_validate_upstream($post, &$input_errors) {
if ($post['enabled'] == 'on') {
$addr = trim($post['proxyaddr']);
if (empty($addr))
@@ -473,7 +474,7 @@ function squid_validate_upstream($post, $input_errors) {
}
}
-function squid_validate_cache($post, $input_errors) {
+function squid_validate_cache($post, &$input_errors) {
$num_fields = array( 'harddisk_cache_size' => 'Hard disk cache size',
'memory_cache_size' => 'Memory cache size',
'maximum_object_size' => 'Maximum object size',
@@ -512,7 +513,7 @@ function squid_validate_cache($post, $input_errors) {
}
-function squid_validate_nac($post, $input_errors) {
+function squid_validate_nac($post, &$input_errors) {
$allowed_subnets = explode("\n", $post['allowed_subnets']);
foreach ($allowed_subnets as $subnet) {
$subnet = trim($subnet);
@@ -558,7 +559,7 @@ function squid_validate_nac($post, $input_errors) {
}}
}
-function squid_validate_traffic($post, $input_errors) {
+function squid_validate_traffic($post, &$input_errors) {
$num_fields = array( 'max_download_size' => 'Maximum download size',
'max_upload_size' => 'Maximum upload size',
'perhost_throttling' => 'Per-host bandwidth throttling',
@@ -589,14 +590,13 @@ function squid_validate_traffic($post, $input_errors) {
}
}
-function squid_validate_reverse($post, $input_errors) {
+function squid_validate_reverse($post, &$input_errors) {
if(!empty($post['reverse_ip'])) {
$reverse_ip = explode(";", ($post['reverse_ip']));
foreach ($reverse_ip as $reip) {
- if (!is_ipaddr($reip))
- $input_errors[] = 'You must enter a valid IP address in the \'User-defined reverse-proxy IPs\' field';
- break;
+ if (!is_ipaddr(trim($reip)))
+ $input_errors[] = 'You must enter a valid IP address in the \'User-defined reverse-proxy IPs\' field'.' -> \''.$reip.'\' is invalid.';
}}
$fqdn = trim($post['reverse_external_fqdn']);
@@ -618,15 +618,12 @@ function squid_validate_reverse($post, $input_errors) {
$input_errors[] = "You have to enable reverse HTTPS before enabling OWA support.";
}
-/*
- if (!is_cert($post['reverse_int_ca']))
- $input_errors[] = 'A valid certificate for the external interface must be selected';
-*/
-
- $rowa = trim($post['reverse_owa_ip']);
- if (!empty($rowa) && !is_ipaddr($rowa))
- $input_errors[] = 'The field \'OWA frontend IP address\' must contain a valid IP address';
-
+ if(!empty($post['reverse_owa_ip'])) {
+ $reverse_owa_ip = explode(";", ($post['reverse_owa_ip']));
+ foreach ($reverse_owa_ip as $reowaip) {
+ if (!is_ipaddr(trim($reowaip)))
+ $input_errors[] = 'You must enter a valid IP address in the \'CAS-Array / OWA frontend IP address\' field'.' -> \''.$reowaip.'\' is invalid.';
+ }}
$contents = $post['reverse_cache_peer'];
if(!empty($contents)) {
@@ -644,7 +641,7 @@ function squid_validate_reverse($post, $input_errors) {
}
-function squid_validate_auth($post, $input_errors) {
+function squid_validate_auth($post, &$input_errors) {
$num_fields = array( array('auth_processes', 'Authentication processes', 1),
array('auth_ttl', 'Authentication TTL', 0),
);