Project

General

Profile

« Previous | Next » 

Revision 206aa9fc

Added by Pierre POMES over 13 years ago

Ticket #2205 - Add input validation, keep same logic as 2.0.1 and abore for default values

View differences:

usr/local/www/load_balancer_setting.php
61 61
                $savemsg = get_std_save_message($retval);
62 62
                clear_subsystem_dirty('loadbalancer');
63 63
        } else {
64
		unset($input_errors);
64 65
		$pconfig = $_POST;
66
	
67
		/* input validation */
68
		if ($_POST['timeout'] && !is_numeric($_POST['timeout'])) {
69
			$input_errors[] = gettext("Timeout must be a numeric value");
70
		}
65 71

  
66
		$lbsetting['timeout'] = $_POST['timeout'];
67
		$lbsetting['interval'] = $_POST['interval'];
72
                if ($_POST['interval'] && !is_numeric($_POST['interval'])) {
73
                        $input_errors[] = gettext("Interval must be a numeric value");
74
                }
68 75

  
69
        	write_config();
70
        	mark_subsystem_dirty('loadbalancer');
76
		/* update config if user entry is valid */
77
		if (!$input_errors) {
78
			$lbsetting['timeout'] = $_POST['timeout'];
79
			$lbsetting['interval'] = $_POST['interval'];
80

  
81
        		write_config();
82
        		mark_subsystem_dirty('loadbalancer');
83
		}
71 84
	}
72
        header("Location: load_balancer_setting.php");
73
        exit;
74 85
}
75 86

  
76 87
$pgtitle = array(gettext("Services"),gettext("Load Balancer"),gettext("Settings"));

Also available in: Unified diff