Skip to content

Commit 1901ab2

Browse files
author
Till Brehm
committed
Merge branch 'default-mysql-remote-ip' into 'develop'
Enable Default Remote IP for MySQL user regardless of the database and web server See merge request ispconfig/ispconfig3!1744
2 parents 9539e9b + e1adb40 commit 1901ab2

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

interface/web/sites/database_edit.php

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

393403
if ($app->tform->errorMessage == '') {
@@ -478,6 +488,16 @@ function onBeforeInsert() {
478488
}
479489
}
480490
}
491+
} else {
492+
if(!empty($global_config['default_remote_dbserver'])) {
493+
// Add default remote_ips from Main Configuration.
494+
$remote_ips = explode(",", $global_config['default_remote_dbserver']);
495+
496+
if($this->dataRecord['remote_access'] != 'y'){
497+
$this->dataRecord['remote_ips'] = implode(',', $remote_ips);
498+
$this->dataRecord['remote_access'] = 'y';
499+
}
500+
}
481501
}
482502

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

0 commit comments

Comments
 (0)