Skip to content

Commit 90eb2ee

Browse files
author
Florian Schaal
committed
add ipv6 during "reconfigure permissions in database", too
1 parent c56bb14 commit 90eb2ee

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

install/lib/installer_base.lib.php

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -497,15 +497,22 @@ public function grant_master_database_rights($verbose = false) {
497497

498498
//* insert the ispconfig user in the remote server
499499
$from_host = $conf['hostname'];
500-
$from_ip = gethostbyname($conf['hostname']);
501500

502501
$hosts[$from_host]['user'] = $conf['mysql']['master_ispconfig_user'];
503502
$hosts[$from_host]['db'] = $conf['mysql']['master_database'];
504503
$hosts[$from_host]['pwd'] = $conf['mysql']['master_ispconfig_password'];
505504

506-
$hosts[$from_ip]['user'] = $conf['mysql']['master_ispconfig_user'];
507-
$hosts[$from_ip]['db'] = $conf['mysql']['master_database'];
508-
$hosts[$from_ip]['pwd'] = $conf['mysql']['master_ispconfig_password'];
505+
$ip_list=array();
506+
$ip_rec=dns_get_record($conf['hostname'], DNS_A + DNS_AAAA);
507+
if(!empty($ip_rec)) foreach($ip_rec as $rec => $ip) $ip_list[]=@(isset($ip['ip']))?$ip['ip']:$ip['ipv6'];
508+
509+
if(!empty($ip_list)) {
510+
foreach($ip_list as $ip) {
511+
$hosts[$ip]['user'] = $conf['mysql']['master_ispconfig_user'];
512+
$hosts[$ip]['db'] = $conf['mysql']['master_database'];
513+
$hosts[$ip]['pwd'] = $conf['mysql']['master_ispconfig_password'];
514+
}
515+
}
509516
} else{
510517
/*
511518
* it is NOT a master-slave - Setup so we have to find out all clients and their

0 commit comments

Comments
 (0)