Commit cc2fe484 authored by fantu's avatar fantu
Browse files

add ip validator in some form

parent db81c7c7
......@@ -69,7 +69,7 @@ $form["tabs"]['server'] = array (
'formtype' => 'TEXT',
'default' => '192.168.0.105',
'validators' => array ( 0 => array ( 'type' => 'ISIPV4',
'errmsg'=> 'ip_address_error_empty'),
'errmsg'=> 'ip_address_error_wrong'),
),
'value' => '',
'width' => '15',
......@@ -79,8 +79,8 @@ $form["tabs"]['server'] = array (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'default' => '255.255.255.0',
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
'errmsg'=> 'netmask_error_empty'),
'validators' => array ( 0 => array ( 'type' => 'ISIPV4',
'errmsg'=> 'netmask_error_wrong'),
),
'value' => '',
'width' => '15',
......@@ -90,8 +90,8 @@ $form["tabs"]['server'] = array (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'default' => '192.168.0.1',
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
'errmsg'=> 'gateway_error_empty'),
'validators' => array ( 0 => array ( 'type' => 'ISIPV4',
'errmsg'=> 'gateway_error_wrong'),
),
'value' => '',
'width' => '15',
......
......@@ -98,13 +98,10 @@ $form["tabs"]['server_ip'] = array (
'ip_address' => array (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
'errmsg'=> 'ip_error_empty'),
'validators' => array ( 0 => array ( 'type' => 'ISIPV4',
'errmsg'=> 'ip_error_wrong'),
1 => array ( 'type' => 'UNIQUE',
'errmsg'=> 'ip_error_unique'),
2 => array ( 'type' => 'REGEX',
'regex' => '/^[0-9\.]{7,15}$/',
'errmsg'=> 'ip_err'),
),
'default' => '',
'value' => '',
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment