@@ -188,7 +188,7 @@ function onShowEnd() {
188188 }
189189 $ server_id = intval (@$ this ->dataRecord ["server_id " ]);
190190 } else {
191- $ server_id = (isset ($ web_servers [0 ])) ? intval ($ web_servers [0 ]['server_id ' ]) : 1 ;
191+ $ server_id = (isset ($ web_servers [0 ])) ? intval ($ web_servers [0 ]['server_id ' ]) : 0 ;
192192 }
193193
194194 if ($ app ->functions ->intval ($ this ->dataRecord ["server_id " ]) > 0 ) {
@@ -200,9 +200,9 @@ function onShowEnd() {
200200 }
201201 }
202202
203- //* Fill the IPv4 select field with the IP addresses that are allowed for this client
204- $ sql = "SELECT ip_address FROM server_ip WHERE server_id IN ? AND ip_type = 'IPv4' AND (client_id = 0 OR client_id= " .$ _SESSION ['s ' ]['user ' ]['client_id ' ].") " ;
205- $ ips = $ app ->db ->queryAllRecords ($ sql , explode ( ' , ' , $ client [ ' web_servers ' ]) );
203+ //* Fill the IPv4 select field with the IP addresses that are allowed for this client on the current server
204+ $ sql = "SELECT ip_address FROM server_ip WHERE server_id = ? AND ip_type = 'IPv4' AND (client_id = 0 OR client_id= " .$ _SESSION ['s ' ]['user ' ]['client_id ' ].") " ;
205+ $ ips = $ app ->db ->queryAllRecords ($ sql , $ server_id );
206206 $ ip_select = ($ web_config [$ server_id ]['enable_ip_wildcard ' ] == 'y ' )?"<option value='*'>*</option> " :"" ;
207207 //if(!in_array($this->dataRecord["ip_address"], $ips)) $ip_select .= "<option value='".$this->dataRecord["ip_address"]."' SELECTED>".$this->dataRecord["ip_address"]."</option>\r\n";
208208 //$ip_select = "";
@@ -217,8 +217,8 @@ function onShowEnd() {
217217 unset($ ips );
218218
219219 //* Fill the IPv6 select field with the IP addresses that are allowed for this client
220- $ sql = "SELECT ip_address FROM server_ip WHERE server_id IN ? AND ip_type = 'IPv6' AND (client_id = 0 OR client_id=?) " ;
221- $ ips = $ app ->db ->queryAllRecords ($ sql , explode ( ' , ' , $ client [ ' web_servers ' ]) , $ _SESSION ['s ' ]['user ' ]['client_id ' ]);
220+ $ sql = "SELECT ip_address FROM server_ip WHERE server_id = ? AND ip_type = 'IPv6' AND (client_id = 0 OR client_id=?) " ;
221+ $ ips = $ app ->db ->queryAllRecords ($ sql , $ server_id , $ _SESSION ['s ' ]['user ' ]['client_id ' ]);
222222 //$ip_select = ($web_config[$server_id]['enable_ip_wildcard'] == 'y')?"<option value='*'>*</option>":"";
223223 //$ip_select = "";
224224 $ ip_select = "<option value=''></option> " ;
@@ -314,7 +314,7 @@ function onShowEnd() {
314314 }
315315 $ server_id = intval (@$ this ->dataRecord ["server_id " ]);
316316 } else {
317- $ server_id = (isset ($ web_servers [0 ])) ? intval ($ web_servers [0 ]['server_id ' ]) : 1 ;
317+ $ server_id = (isset ($ web_servers [0 ])) ? intval ($ web_servers [0 ]['server_id ' ]) : 0 ;
318318 }
319319
320320 if ($ settings ['use_domain_module ' ] != 'y ' ) {
@@ -346,8 +346,8 @@ function onShowEnd() {
346346 }
347347
348348 //* Fill the IPv4 select field with the IP addresses that are allowed for this client
349- $ sql = "SELECT ip_address FROM server_ip WHERE server_id IN ? AND ip_type = 'IPv4' AND (client_id = 0 OR client_id=?) " ;
350- $ ips = $ app ->db ->queryAllRecords ($ sql , explode ( ' , ' , $ client [ ' web_servers ' ]) , $ _SESSION ['s ' ]['user ' ]['client_id ' ]);
349+ $ sql = "SELECT ip_address FROM server_ip WHERE server_id = ? AND ip_type = 'IPv4' AND (client_id = 0 OR client_id=?) " ;
350+ $ ips = $ app ->db ->queryAllRecords ($ sql , $ server_id , $ _SESSION ['s ' ]['user ' ]['client_id ' ]);
351351 $ ip_select = ($ web_config [$ server_id ]['enable_ip_wildcard ' ] == 'y ' )?"<option value='*'>*</option> " :"" ;
352352 //if(!in_array($this->dataRecord["ip_address"], $ips)) $ip_select .= "<option value='".$this->dataRecord["ip_address"]."' SELECTED>".$this->dataRecord["ip_address"]."</option>\r\n";
353353 //$ip_select = "";
@@ -362,8 +362,8 @@ function onShowEnd() {
362362 unset($ ips );
363363
364364 //* Fill the IPv6 select field with the IP addresses that are allowed for this client
365- $ sql = "SELECT ip_address FROM server_ip WHERE server_id IN ? AND ip_type = 'IPv6' AND (client_id = 0 OR client_id=?) " ;
366- $ ips = $ app ->db ->queryAllRecords ($ sql , $ client [ ' web_servers ' ] , $ _SESSION ['s ' ]['user ' ]['client_id ' ]);
365+ $ sql = "SELECT ip_address FROM server_ip WHERE server_id = ? AND ip_type = 'IPv6' AND (client_id = 0 OR client_id=?) " ;
366+ $ ips = $ app ->db ->queryAllRecords ($ sql , $ server_id , $ _SESSION ['s ' ]['user ' ]['client_id ' ]);
367367 $ ip_select = "<option value=''></option> " ;
368368 //$ip_select = "";
369369 if (is_array ($ ips )) {
0 commit comments