Skip to content

Commit e9b033f

Browse files
author
Till Brehm
committed
Merge branch 'stable-3.0.5' of git.ispconfig.org:ispconfig/ispconfig3 into stable-3.0.5
2 parents 18b050c + 30848e2 commit e9b033f

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

interface/web/sites/web_domain_edit.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,11 @@ function onShowEnd() {
107107
$app->tpl->setVar("server_id", "<option value='$client[default_webserver]'>$tmp[server_name]</option>");
108108
unset($tmp);
109109

110-
//* Fill the IPv4 select field with the IP addresses that are allowed for this client
111-
$sql = "SELECT ip_address FROM server_ip WHERE server_id = ".$app->functions->intval($client['default_webserver'])." AND ip_type = 'IPv4' AND (client_id = 0 OR client_id=".$app->functions->intval($_SESSION['s']['user']['client_id']).")";
110+
//* Fill the IPv4 select field with the IP addresses that are allowed for this client; if website was created on a different server (e.g. by admin), display IP addresses from that server - otherwise IP will be changed to * if user changes the tab
111+
$sql = "SELECT ip_address FROM server_ip WHERE server_id = ".($app->functions->intval($this->dataRecord["server_id"]) > 0 && $app->functions->intval($this->dataRecord["server_id"]) != $app->functions->intval($client['default_webserver'])? $app->functions->intval($this->dataRecord["server_id"]) : $app->functions->intval($client['default_webserver']))." AND ip_type = 'IPv4' AND (client_id = 0 OR client_id=".$app->functions->intval($_SESSION['s']['user']['client_id']).")";
112112
$ips = $app->db->queryAllRecords($sql);
113113
$ip_select = ($web_config['enable_ip_wildcard'] == 'y')?"<option value='*'>*</option>":"";
114+
//if(!in_array($this->dataRecord["ip_address"], $ips)) $ip_select .= "<option value='".$this->dataRecord["ip_address"]."' SELECTED>".$this->dataRecord["ip_address"]."</option>\r\n";
114115
//$ip_select = "";
115116
if(is_array($ips)) {
116117
foreach( $ips as $ip) {
@@ -122,8 +123,8 @@ function onShowEnd() {
122123
unset($tmp);
123124
unset($ips);
124125

125-
//* Fill the IPv6 select field with the IP addresses that are allowed for this client
126-
$sql = "SELECT ip_address FROM server_ip WHERE server_id = ".$app->functions->intval($client['default_webserver'])." AND ip_type = 'IPv6' AND (client_id = 0 OR client_id=".$app->functions->intval($_SESSION['s']['user']['client_id']).")";
126+
//* Fill the IPv6 select field with the IP addresses that are allowed for this client; if website was created on a different server (e.g. by admin), display IP addresses from that server
127+
$sql = "SELECT ip_address FROM server_ip WHERE server_id = ".($app->functions->intval($this->dataRecord["server_id"]) > 0 && $app->functions->intval($this->dataRecord["server_id"]) != $app->functions->intval($client['default_webserver'])? $app->functions->intval($this->dataRecord["server_id"]) : $app->functions->intval($client['default_webserver']))." AND ip_type = 'IPv6' AND (client_id = 0 OR client_id=".$app->functions->intval($_SESSION['s']['user']['client_id']).")";
127128
$ips = $app->db->queryAllRecords($sql);
128129
$ip_select = "<option value=''></option>";
129130
//$ip_select = "";
@@ -198,10 +199,11 @@ function onShowEnd() {
198199
}
199200
$app->tpl->setVar("client_group_id", $client_select);
200201

201-
//* Fill the IPv4 select field with the IP addresses that are allowed for this client
202-
$sql = "SELECT ip_address FROM server_ip WHERE server_id = ".$app->functions->intval($client['default_webserver'])." AND ip_type = 'IPv4' AND (client_id = 0 OR client_id=".$app->functions->intval($_SESSION['s']['user']['client_id']).")";
202+
//* Fill the IPv4 select field with the IP addresses that are allowed for this client; if website was created on a different server (e.g. by admin), display IP addresses from that server - otherwise IP will be changed to * if user changes the tab
203+
$sql = "SELECT ip_address FROM server_ip WHERE server_id = ".($app->functions->intval($this->dataRecord["server_id"]) > 0 && $app->functions->intval($this->dataRecord["server_id"]) != $app->functions->intval($client['default_webserver'])? $app->functions->intval($this->dataRecord["server_id"]) : $app->functions->intval($client['default_webserver']))." AND ip_type = 'IPv4' AND (client_id = 0 OR client_id=".$app->functions->intval($_SESSION['s']['user']['client_id']).")";
203204
$ips = $app->db->queryAllRecords($sql);
204205
$ip_select = ($web_config['enable_ip_wildcard'] == 'y')?"<option value='*'>*</option>":"";
206+
//if(!in_array($this->dataRecord["ip_address"], $ips)) $ip_select .= "<option value='".$this->dataRecord["ip_address"]."' SELECTED>".$this->dataRecord["ip_address"]."</option>\r\n";
205207
//$ip_select = "";
206208
if(is_array($ips)) {
207209
foreach( $ips as $ip) {
@@ -213,8 +215,8 @@ function onShowEnd() {
213215
unset($tmp);
214216
unset($ips);
215217

216-
//* Fill the IPv6 select field with the IP addresses that are allowed for this client
217-
$sql = "SELECT ip_address FROM server_ip WHERE server_id = ".$app->functions->intval($client['default_webserver'])." AND ip_type = 'IPv6' AND (client_id = 0 OR client_id=".$app->functions->intval($_SESSION['s']['user']['client_id']).")";
218+
//* Fill the IPv6 select field with the IP addresses that are allowed for this client; if website was created on a different server (e.g. by admin), display IP addresses from that server
219+
$sql = "SELECT ip_address FROM server_ip WHERE server_id = ".($app->functions->intval($this->dataRecord["server_id"]) > 0 && $app->functions->intval($this->dataRecord["server_id"]) != $app->functions->intval($client['default_webserver'])? $app->functions->intval($this->dataRecord["server_id"]) : $app->functions->intval($client['default_webserver']))." AND ip_type = 'IPv6' AND (client_id = 0 OR client_id=".$app->functions->intval($_SESSION['s']['user']['client_id']).")";
218220
$ips = $app->db->queryAllRecords($sql);
219221
$ip_select = "<option value=''></option>";
220222
//$ip_select = "";

0 commit comments

Comments
 (0)