@@ -12,11 +12,13 @@ my $server = &find_server($in{'id'});
1212$server || &error($text {' server_egone' });
1313&can_edit_server($server ) || &error($text {' server_ecannot' });
1414
15- &nginx_opt_parse(" root" , $server , undef , ' ^\/.*$' );
16- $in {' root_def' } || &can_directory($in {' root' }) ||
17- &error(&text(' location_ecannot' ,
18- " <tt>" .&html_escape($in {' root' })." </tt>" ,
19- " <tt>" .&html_escape($access {' root' })." </tt>" ));
15+ if (!&foreign_check(" virtual-server" )) {
16+ &nginx_opt_parse(" root" , $server , undef , ' ^\/.*$' );
17+ $in {' root_def' } || &can_directory($in {' root' }) ||
18+ &error(&text(' location_ecannot' ,
19+ " <tt>" .&html_escape($in {' root' })." </tt>" ,
20+ " <tt>" .&html_escape($access {' root' })." </tt>" ));
21+ }
2022
2123&nginx_opt_parse(" index" , $server , undef , undef , undef , 1);
2224
@@ -28,17 +30,19 @@ $in{'root_def'} || &can_directory($in{'root'}) ||
2830my $name = &find_value(" server_name" , $server );
2931&webmin_log(" sdocs" , " server" , $name );
3032
31- # Redirect with the the new root directory if it was changed
32- my ($dom , $domroot_curr ) = split (/ ;/ , $in {' id' });
33- my $domroot_new = $in {' root' } ? $in {' root' } : undef ;
34- my ($return_id , $return_query ) = ($in {' id' }, " " );
35- if ($domroot_new && $domroot_new ne $domroot_curr ) {
36- &foreign_require(" virtual-server" );
37- my $d = &virtual_server::get_domain_by(' dom' , $dom );
38- if ($d ) {
39- &virtual_server::clear_links_cache($d );
40- $return_id = " $dom ;$domroot_new " ;
41- $return_query = " refresh=1" ;
33+ if (!&foreign_check(" virtual-server" )) {
34+ # Redirect with the the new root directory if it was changed
35+ my ($dom , $domroot_curr ) = split (/ ;/ , $in {' id' });
36+ my $domroot_new = $in {' root' } ? $in {' root' } : undef ;
37+ my ($return_id , $return_query ) = ($in {' id' }, " " );
38+ if ($domroot_new && $domroot_new ne $domroot_curr ) {
39+ &foreign_require(" virtual-server" );
40+ my $d = &virtual_server::get_domain_by(' dom' , $dom );
41+ if ($d ) {
42+ &virtual_server::clear_links_cache($d );
43+ $return_id = " $dom ;$domroot_new " ;
44+ $return_query = " refresh=1" ;
45+ }
4246 }
4347 }
4448
0 commit comments