Skip to content

Commit 4d30273

Browse files
author
Branislav Viest
committed
Configure Default mysql remote server regardless where website and database are created
1 parent 7c43aab commit 4d30273

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

interface/web/sites/database_edit.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,14 @@ function onBeforeUpdate() {
388388
}
389389
}
390390
}
391+
} else {
392+
// Add default remote_ips from Main Configuration.
393+
$remote_ips = explode(",", $global_config['default_remote_dbserver']);
394+
395+
if($this->dataRecord['remote_access'] != 'y'){
396+
$this->dataRecord['remote_ips'] = implode(',', $remote_ips);
397+
$this->dataRecord['remote_access'] = 'y';
398+
}
391399
}
392400

393401
if ($app->tform->errorMessage == '') {
@@ -478,6 +486,14 @@ function onBeforeInsert() {
478486
}
479487
}
480488
}
489+
} else {
490+
// Add default remote_ips from Main Configuration.
491+
$remote_ips = explode(",", $global_config['default_remote_dbserver']);
492+
493+
if($this->dataRecord['remote_access'] != 'y'){
494+
$this->dataRecord['remote_ips'] = implode(',', $remote_ips);
495+
$this->dataRecord['remote_access'] = 'y';
496+
}
481497
}
482498

483499
if ($app->tform->errorMessage == '') {

0 commit comments

Comments
 (0)