Skip to content
Snippets Groups Projects
Commit 352d6a49 authored by Florian Schaal's avatar Florian Schaal
Browse files

server_ip_add not working by API (Fixes #4884)

parent 2ae1eb77
No related branches found
No related tags found
1 merge request!683Option to limit access for remote-user to specified IP(s) / hostname(s) (#4881)
......@@ -46,11 +46,15 @@ class validate_server {
* Validator function for server-ip
*/
function check_server_ip($field_name, $field_value, $validator) {
if($_POST['ip_type'] == 'IPv4') {
global $app;
$type=(isset($app->remoting_lib->dataRecord['ip_type']))?$app->remoting_lib->dataRecord['ip_type']:$_POST['ip_type'];
if($type == 'IPv4') {
if(!filter_var($field_value, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
return $this->get_error($validator['errmsg']);
}
} elseif ($_POST['ip_type'] == 'IPv6') {
} elseif ($type == 'IPv6') {
if(!filter_var($field_value, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
return $this->get_error($validator['errmsg']);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment