aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/varnish64/varnish.inc13
-rw-r--r--config/varnish64/varnish_settings.xml3
2 files changed, 16 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";
diff --git a/config/varnish64/varnish_settings.xml b/config/varnish64/varnish_settings.xml
index 82f1fa18..c3304c1a 100644
--- a/config/varnish64/varnish_settings.xml
+++ b/config/varnish64/varnish_settings.xml
@@ -120,4 +120,7 @@
sync_package_varnish();
varnish_start();
</custom_php_resync_config_command>
+ <custom_php_validation_command>
+ varnish_settings_post_validate($_POST, &amp;$input_errors);
+ </custom_php_validation_command>
</packagegui> \ No newline at end of file