From 415544c8f026aa2db428b9528802a6982c6fa562 Mon Sep 17 00:00:00 2001
From: ftimme <ft@falkotimme.com>
Date: Tue, 19 Mar 2013 10:28:42 -0400
Subject: [PATCH] - Fixed FS#2796 - Don't attach target server IP to remote IPs list in database settings.
---
interface/web/sites/database_edit.php | 26 ++++++++++++++++++++++++++
1 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/interface/web/sites/database_edit.php b/interface/web/sites/database_edit.php
index a11d38a..c259ff0 100644
--- a/interface/web/sites/database_edit.php
+++ b/interface/web/sites/database_edit.php
@@ -248,11 +248,24 @@
// we need remote access rights for this server, so get it's ip address
$server_config = $app->getconf->get_server_config($tmp['server_id'], 'server');
if($server_config['ip_address']!='') {
+ /*
if($this->dataRecord['remote_access'] != 'y') $this->dataRecord['remote_ips'] = '';
$this->dataRecord['remote_access'] = 'y';
if(preg_match('/(^|,)' . preg_quote($server_config['ip_address'], '/') . '(,|$)/', $this->dataRecord['remote_ips']) == false) {
$this->dataRecord['remote_ips'] .= ($this->dataRecord['remote_ips'] != '' ? ',' : '') . $server_config['ip_address'];
}
+ */
+
+ if($this->dataRecord['remote_access'] != 'y'){
+ $this->dataRecord['remote_ips'] = $server_config['ip_address'];
+ $this->dataRecord['remote_access'] = 'y';
+ } else {
+ if($this->dataRecord['remote_ips'] != ''){
+ if(preg_match('/(^|,)' . preg_quote($server_config['ip_address'], '/') . '(,|$)/', $this->dataRecord['remote_ips']) == false) {
+ $this->dataRecord['remote_ips'] .= ',' . $server_config['ip_address'];
+ }
+ }
+ }
}
}
@@ -299,11 +312,24 @@
// we need remote access rights for this server, so get it's ip address
$server_config = $app->getconf->get_server_config($tmp['server_id'], 'server');
if($server_config['ip_address']!='') {
+ /*
if($this->dataRecord['remote_access'] != 'y') $this->dataRecord['remote_ips'] = '';
$this->dataRecord['remote_access'] = 'y';
if(preg_match('/(^|,)' . preg_quote($server_config['ip_address'], '/') . '(,|$)/', $this->dataRecord['remote_ips']) == false) {
$this->dataRecord['remote_ips'] .= ($this->dataRecord['remote_ips'] != '' ? ',' : '') . $server_config['ip_address'];
}
+ */
+
+ if($this->dataRecord['remote_access'] != 'y'){
+ $this->dataRecord['remote_ips'] = $server_config['ip_address'];
+ $this->dataRecord['remote_access'] = 'y';
+ } else {
+ if($this->dataRecord['remote_ips'] != ''){
+ if(preg_match('/(^|,)' . preg_quote($server_config['ip_address'], '/') . '(,|$)/', $this->dataRecord['remote_ips']) == false) {
+ $this->dataRecord['remote_ips'] .= ',' . $server_config['ip_address'];
+ }
+ }
+ }
}
}
--
Gitblit v1.9.1