Skip to content
Snippets Groups Projects
Commit 2a054259 authored by Till Brehm's avatar Till Brehm
Browse files

Merge branch 'stable-3.1' into 'stable-3.1'

fixed interface/lib/classes/remoting.inc.php with no IPs set for remote-access

See merge request ispconfig/ispconfig3!720
parents e7d2e96e cd3b3a72
No related branches found
No related tags found
1 merge request!720fixed interface/lib/classes/remoting.inc.php with no IPs set for remote-access
......@@ -19,4 +19,4 @@ user_query = SELECT email as user, maildir as home, CONCAT( maildir_format, ':',
# The iterate_query is required for the doveadm command only and works only on dovecot 2 servers.
# Do not enable it on Dovecot 1.x servers
# iterate_query = SELECT email as user FROM mail_user WHERE `disable%Ls` = 'n' AND server_id = '{server_id}'
# iterate_query = SELECT email as user FROM mail_user WHERE server_id = '{server_id}'
......@@ -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';
......
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