Skip to content

Commit e519302

Browse files
author
Florian Schaal
committed
fixed interface/lib/classes/remoting.inc.php with no IPs set for remote-access
1 parent 41e1628 commit e519302

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

interface/lib/classes/remoting.inc.php

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -144,17 +144,19 @@ public function login($username, $password, $client_login = false)
144144
$sql = "SELECT * FROM remote_user WHERE remote_username = ? and remote_password = md5(?)";
145145
$remote_user = $app->db->queryOneRecord($sql, $username, $password);
146146
if($remote_user['remote_userid'] > 0) {
147-
$allowed_ips = explode(',',$remote_user['remote_ips']);
148-
foreach($allowed_ips as $i => $allowed) {
149-
if(!filter_var($allowed, FILTER_VALIDATE_IP)) {
150-
// get the ip for a hostname
151-
unset($allowed_ips[$i]);
152-
$temp=dns_get_record($allowed, DNS_A+DNS_AAAA);
153-
foreach($temp as $t) {
154-
if(isset($t['ip'])) $allowed_ips[] = $t['ip'];
155-
if(isset($t['ipv6'])) $allowed_ips[] = $t['ipv6'];
147+
if (trim($remote_user['remote_ips']) != '') {
148+
$allowed_ips = explode(',',$remote_user['remote_ips']);
149+
foreach($allowed_ips as $i => $allowed) {
150+
if(!filter_var($allowed, FILTER_VALIDATE_IP)) {
151+
// get the ip for a hostname
152+
unset($allowed_ips[$i]);
153+
$temp=dns_get_record($allowed, DNS_A+DNS_AAAA);
154+
foreach($temp as $t) {
155+
if(isset($t['ip'])) $allowed_ips[] = $t['ip'];
156+
if(isset($t['ipv6'])) $allowed_ips[] = $t['ipv6'];
157+
}
158+
unset($temp);
156159
}
157-
unset($temp);
158160
}
159161
}
160162
$allowed_ips[] = '127.0.0.1';

0 commit comments

Comments
 (0)