From f353d3c7a464e2047eef93d444db13d9e69aec5c Mon Sep 17 00:00:00 2001 From: ftimme <ft@falkotimme.com> Date: Tue, 19 Mar 2013 12:47:56 -0400 Subject: [PATCH] - Fixed FS#2765 - Rename DNS zone make new file, but old is not deleted. --- 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