Check for valid IP Address when needed.

Ticket #1055
This commit is contained in:
Scott Ullrich 2006-08-05 18:48:42 +00:00
parent 00c3915d9b
commit adf28e735e

View File

@ -117,13 +117,13 @@
<fieldname>synchronizelb</fieldname>
<description>When this option is enabled, this system will automatically sync the Load Balancer settings over to the other carp host when changes are made.</description>
<type>checkbox</type>
</field>
</field>
<field>
<fielddescr>Synchronize Virtual IPs</fielddescr>
<fieldname>synchronizevirtualip</fieldname>
<description>When this option is enabled, this system will automatically sync the Virtual IP (minus proxyarp) settings over to the other carp host when changes are made.</description>
<type>checkbox</type>
</field>
</field>
<field>
<fielddescr>Synchronize traffic shaper</fielddescr>
<fieldname>synchronizetrafficshaper</fieldname>
@ -135,7 +135,7 @@
<fieldname>synchronizednsforwarder</fieldname>
<description>When this option is enabled, this system will automatically sync the DNS Forwarder hosts/domains over to the other carp host when changes are made.</description>
<type>checkbox</type>
</field>
</field>
<field>
<fielddescr>Synchronize to IP</fielddescr>
<fieldname>synchronizetoip</fieldname>
@ -150,11 +150,16 @@
<type>password</type>
</field>
</fields>
<custom_php_validation_command>
if($_POST["synchronizetoip"])
if(!is_ipaddr($_POST["synchronizetoip"]))
$input_errors[] = "You must specify a valid IP address.";
</custom_php_validation_command>
<custom_add_php_command_late>
/* setup carp interfaces */
interfaces_carp_configure();
interfaces_carp_bring_up_final();
/* force a filter configure for syncing */
filter_configure();
</custom_add_php_command_late>
</custom_add_php_command_late>
</packagegui>