aboutsummaryrefslogtreecommitdiffstats
path: root/config/varnish64/varnish.inc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2010-04-27 22:08:53 -0400
committerScott Ullrich <sullrich@pfsense.org>2010-04-27 22:08:53 -0400
commit63f0333cf8e2832126c225f464e6613bb40693bd (patch)
treeef4987658915f6d2841a6a4f8017772d9c787e77 /config/varnish64/varnish.inc
parent89ad7b0561c17ef6ca35cf7d599d7b61790e0c2e (diff)
downloadpfsense-packages-63f0333cf8e2832126c225f464e6613bb40693bd.tar.gz
pfsense-packages-63f0333cf8e2832126c225f464e6613bb40693bd.tar.bz2
pfsense-packages-63f0333cf8e2832126c225f464e6613bb40693bd.zip
Add input validation for the settings page
Diffstat (limited to 'config/varnish64/varnish.inc')
-rw-r--r--config/varnish64/varnish.inc13
1 files changed, 13 insertions, 0 deletions
diff --git a/config/varnish64/varnish.inc b/config/varnish64/varnish.inc
index 295533b9..d2d10e2c 100644
--- a/config/varnish64/varnish.inc
+++ b/config/varnish64/varnish.inc
@@ -31,6 +31,19 @@
*/
/* ========================================================================== */
+function varnish_settings_post_validate($post, $input_errors) {
+ if($post['storagesize'] && !is_int($post['storagesize']))
+ $input_errors[] = "A valid number is required for the field 'Storage type'";
+ if($post['listeningport'] && !is_int($post['listeningport']))
+ $input_errors[] = "A valid number is required for the field 'Listening port'";
+ if($post['minworkers'] && !is_int($post['minworkers']))
+ $input_errors[] = "A valid number is required for the field 'Minimum worker threads'";
+ if($post['maxworkers'] && !is_int($post['maxworkers']))
+ $input_errors[] = "A valid number is required for the field 'Maximum worker threads'";
+ if($post['timeoutworkers'] && !is_int($post['timeoutworkers']))
+ $input_errors[] = "A valid number is required for the field 'Worker thread timeout'";
+}
+
function varnish_lb_directors_post_validate($post, $input_errors) {
if (preg_match("/[^a-zA-Z0-9]/", $post['directorname']))
$input_errors[] = "The directorname name must only contain the characters a-Z or 0-9";