Skip to content

Commit 8bc80d3

Browse files
author
Till Brehm
committed
Merge branch '6626-mirror-ip-db' into 'develop'
Resolve "Mirror server IP not automatically added to database Remote Access IPs list" Closes #6626 See merge request ispconfig/ispconfig3!1837
2 parents 19b4e1e + 18e4355 commit 8bc80d3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

interface/web/sites/database_edit.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,14 @@ function onBeforeUpdate() {
374374
}
375375
if (!in_array($server_config['ip_address'], $remote_ips)) { $remote_ips[] = $server_config['ip_address']; }
376376

377+
// If server has a slave ... add it.
378+
$mirrors = $app->db->queryAllRecords("SELECT server_id FROM server WHERE mirror_server_id = ?", $tmp['server_id']);
379+
foreach ($mirrors as $mirror) {
380+
// we need remote access rights for this server, so get it's ip address
381+
$mirror_server_config = $app->getconf->get_server_config($mirror['server_id'], 'server');
382+
if (!in_array($server_config['ip_address'], $remote_ips)) { $remote_ips[] = $mirror_server_config['ip_address']; }
383+
}
384+
377385
if($server_config['ip_address']!='') {
378386
if($this->dataRecord['remote_access'] != 'y'){
379387
$this->dataRecord['remote_ips'] = implode(',', $remote_ips);

0 commit comments

Comments
 (0)