@@ -89,13 +89,17 @@ function onShowEnd() {
8989
9090 $ app ->uses ('ini_parser,getconf ' );
9191
92+
9293 //* Client: If the logged in user is not admin and has no sub clients (no reseller)
9394 if ($ _SESSION ["s " ]["user " ]["typ " ] != 'admin ' && !$ app ->auth ->has_clients ($ _SESSION ['s ' ]['user ' ]['userid ' ])) {
9495
9596 // Get the limits of the client
9697 $ client_group_id = $ _SESSION ["s " ]["user " ]["default_group " ];
9798 $ client = $ app ->db ->queryOneRecord ("SELECT client.limit_web_domain, client.default_webserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $ client_group_id " );
98-
99+
100+ //* Get global web config
101+ $ web_config = $ app ->getconf ->get_server_config ($ client ['default_webserver ' ], 'web ' );
102+
99103 // Set the webserver to the default server of the client
100104 $ tmp = $ app ->db ->queryOneRecord ("SELECT server_name FROM server WHERE server_id = $ client [default_webserver]" );
101105 $ app ->tpl ->setVar ("server_id " ,"<option value=' $ client [default_webserver]'> $ tmp [server_name]</option> " );
@@ -104,7 +108,7 @@ function onShowEnd() {
104108 //* Fill the IPv4 select field with the IP addresses that are allowed for this client
105109 $ sql = "SELECT ip_address FROM server_ip WHERE server_id = " .$ client ['default_webserver ' ]." AND ip_type = 'IPv4' AND (client_id = 0 OR client_id= " .$ _SESSION ['s ' ]['user ' ]['client_id ' ].") " ;
106110 $ ips = $ app ->db ->queryAllRecords ($ sql );
107- $ ip_select = "<option value='*'>*</option> " ;
111+ $ ip_select = ( $ web_config [ ' enable_ip_wildcard ' ] == ' y ' )? "<option value='*'>*</option> " : " " ;
108112 //$ip_select = "";
109113 if (is_array ($ ips )) {
110114 foreach ( $ ips as $ ip ) {
@@ -133,7 +137,6 @@ function onShowEnd() {
133137
134138 //PHP Version Selection (FastCGI)
135139 $ server_type = 'apache ' ;
136- $ web_config = $ app ->getconf ->get_server_config ($ client ['default_webserver ' ], 'web ' );
137140 if (!empty ($ web_config ['server_type ' ])) $ server_type = $ web_config ['server_type ' ];
138141 if ($ server_type == 'nginx ' && $ this ->dataRecord ['php ' ] == 'fast-cgi ' ) $ this ->dataRecord ['php ' ] = 'php-fpm ' ;
139142 if ($ this ->dataRecord ['php ' ] == 'php-fpm ' ){
@@ -163,7 +166,10 @@ function onShowEnd() {
163166 // Get the limits of the client
164167 $ client_group_id = $ _SESSION ["s " ]["user " ]["default_group " ];
165168 $ client = $ app ->db ->queryOneRecord ("SELECT client.client_id, client.limit_web_domain, client.default_webserver, client.contact_name, CONCAT(client.company_name,' :: ',client.contact_name) as contactname, sys_group.name FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $ client_group_id " );
166-
169+
170+ //* Get global web config
171+ $ web_config = $ app ->getconf ->get_server_config ($ client ['default_webserver ' ], 'web ' );
172+
167173 // Set the webserver to the default server of the client
168174 $ tmp = $ app ->db ->queryOneRecord ("SELECT server_name FROM server WHERE server_id = $ client [default_webserver]" );
169175 $ app ->tpl ->setVar ("server_id " ,"<option value=' $ client [default_webserver]'> $ tmp [server_name]</option> " );
@@ -186,7 +192,7 @@ function onShowEnd() {
186192 //* Fill the IPv4 select field with the IP addresses that are allowed for this client
187193 $ sql = "SELECT ip_address FROM server_ip WHERE server_id = " .$ client ['default_webserver ' ]." AND ip_type = 'IPv4' AND (client_id = 0 OR client_id= " .$ _SESSION ['s ' ]['user ' ]['client_id ' ].") " ;
188194 $ ips = $ app ->db ->queryAllRecords ($ sql );
189- $ ip_select = "<option value='*'>*</option> " ;
195+ $ ip_select = ( $ web_config [ ' enable_ip_wildcard ' ] == ' y ' )? "<option value='*'>*</option> " : " " ;
190196 //$ip_select = "";
191197 if (is_array ($ ips )) {
192198 foreach ( $ ips as $ ip ) {
@@ -215,7 +221,6 @@ function onShowEnd() {
215221
216222 //PHP Version Selection (FastCGI)
217223 $ server_type = 'apache ' ;
218- $ web_config = $ app ->getconf ->get_server_config ($ client ['default_webserver ' ], 'web ' );
219224 if (!empty ($ web_config ['server_type ' ])) $ server_type = $ web_config ['server_type ' ];
220225 if ($ server_type == 'nginx ' && $ this ->dataRecord ['php ' ] == 'fast-cgi ' ) $ this ->dataRecord ['php ' ] = 'php-fpm ' ;
221226 if ($ this ->dataRecord ['php ' ] == 'php-fpm ' ){
@@ -255,11 +260,14 @@ function onShowEnd() {
255260 $ tmp = $ app ->db ->queryOneRecord ("SELECT server_id FROM server WHERE web_server = 1 ORDER BY server_name LIMIT 0,1 " );
256261 $ server_id = $ tmp ['server_id ' ];
257262 }
263+
264+ //* get global web config
265+ $ web_config = $ app ->getconf ->get_server_config ($ server_id , 'web ' );
258266
259267 //* Fill the IPv4 select field
260268 $ sql = "SELECT ip_address FROM server_ip WHERE ip_type = 'IPv4' AND server_id = $ server_id " ;
261269 $ ips = $ app ->db ->queryAllRecords ($ sql );
262- $ ip_select = "<option value='*'>*</option> " ;
270+ $ ip_select = ( $ web_config [ ' enable_ip_wildcard ' ] == ' y ' )? "<option value='*'>*</option> " : " " ;
263271 //$ip_select = "";
264272 if (is_array ($ ips )) {
265273 foreach ( $ ips as $ ip ) {
@@ -288,7 +296,6 @@ function onShowEnd() {
288296
289297 //PHP Version Selection (FastCGI)
290298 $ server_type = 'apache ' ;
291- $ web_config = $ app ->getconf ->get_server_config ($ server_id , 'web ' );
292299 if (!empty ($ web_config ['server_type ' ])) $ server_type = $ web_config ['server_type ' ];
293300 if ($ server_type == 'nginx ' && $ this ->dataRecord ['php ' ] == 'fast-cgi ' ) $ this ->dataRecord ['php ' ] = 'php-fpm ' ;
294301 if ($ this ->dataRecord ['php ' ] == 'php-fpm ' ){
0 commit comments