From e519302daf4c840ea70087a3653973c8b5159a4c Mon Sep 17 00:00:00 2001 From: Florian Schaal <florian@schaal-24.de> Date: Fri, 26 Jan 2018 13:50:07 +0100 Subject: [PATCH] fixed interface/lib/classes/remoting.inc.php with no IPs set for remote-access --- interface/lib/classes/remoting.inc.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/interface/lib/classes/remoting.inc.php b/interface/lib/classes/remoting.inc.php index a3bb192d91..2aaf1930f0 100644 --- a/interface/lib/classes/remoting.inc.php +++ b/interface/lib/classes/remoting.inc.php @@ -144,17 +144,19 @@ class remoting { $sql = "SELECT * FROM remote_user WHERE remote_username = ? and remote_password = md5(?)"; $remote_user = $app->db->queryOneRecord($sql, $username, $password); if($remote_user['remote_userid'] > 0) { - $allowed_ips = explode(',',$remote_user['remote_ips']); - foreach($allowed_ips as $i => $allowed) { - if(!filter_var($allowed, FILTER_VALIDATE_IP)) { - // get the ip for a hostname - unset($allowed_ips[$i]); - $temp=dns_get_record($allowed, DNS_A+DNS_AAAA); - foreach($temp as $t) { - if(isset($t['ip'])) $allowed_ips[] = $t['ip']; - if(isset($t['ipv6'])) $allowed_ips[] = $t['ipv6']; + if (trim($remote_user['remote_ips']) != '') { + $allowed_ips = explode(',',$remote_user['remote_ips']); + foreach($allowed_ips as $i => $allowed) { + if(!filter_var($allowed, FILTER_VALIDATE_IP)) { + // get the ip for a hostname + unset($allowed_ips[$i]); + $temp=dns_get_record($allowed, DNS_A+DNS_AAAA); + foreach($temp as $t) { + if(isset($t['ip'])) $allowed_ips[] = $t['ip']; + if(isset($t['ipv6'])) $allowed_ips[] = $t['ipv6']; + } + unset($temp); } - unset($temp); } } $allowed_ips[] = '127.0.0.1'; -- GitLab