mirror of
https://github.com/webmin/webmin.git
synced 2026-06-04 20:30:22 +01:00
Fix regression and hide disabled default vhost files
This commit is contained in:
@@ -914,7 +914,8 @@ if (&can_manage_vhost_files()) {
|
||||
my @filevirts = @{$active_by_file{$file} || [ ]};
|
||||
my $active = @filevirts ? 1 : 0;
|
||||
if (!@filevirts) {
|
||||
@filevirts = grep { &can_edit_virt($_) }
|
||||
@filevirts = grep { &can_edit_virt($_) &&
|
||||
!&is_default_vhost($_) }
|
||||
&find_virtuals_in_file($file);
|
||||
}
|
||||
foreach my $v (@filevirts) {
|
||||
|
||||
@@ -227,6 +227,16 @@ subtest 'same-name symlink to another target is not disabled' => sub {
|
||||
is(readlink($link), $other, 'preserved symlink target is unchanged');
|
||||
};
|
||||
|
||||
subtest 'disabled default virtual hosts stay hidden' => sub {
|
||||
my $disabled_default = File::Spec->catfile($available,
|
||||
'zz-disabled-default.conf');
|
||||
write_text($disabled_default, vhost_conf(undef, '/srv/disabled-default'));
|
||||
|
||||
my @rows = main::get_virtual_list_rows(apache_config());
|
||||
ok(!(grep { $_->{'file'} eq $disabled_default } @rows),
|
||||
'disabled catch-all virtual host file is not listed as a normal vhost');
|
||||
};
|
||||
|
||||
subtest 'legacy webfile link helpers resolve relative link_dir' => sub {
|
||||
my $relative = File::Spec->catfile($available, 'relative.conf');
|
||||
my $link = File::Spec->catfile($enabled, 'relative.conf');
|
||||
|
||||
Reference in New Issue
Block a user