From 9a68088e5550dad2c24ec9b4da3df890270cba5f Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Sun, 14 Jun 2020 16:41:32 -0700 Subject: [PATCH] Remove Files directive created by this module https://github.com/virtualmin/virtualmin-htpasswd/issues/1 --- delete.cgi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/delete.cgi b/delete.cgi index 35bb157..10afaf0 100755 --- a/delete.cgi +++ b/delete.cgi @@ -18,6 +18,7 @@ if ($in{'dom'}) { } my @dirs = &htaccess_htpasswd::list_directories(); +my $htusers = $htaccess_htpasswd::config{'htpasswd'} || "htusers"; foreach my $path (@d) { &can_directory($path, $d) || &error($text{'delete_ecannot'}); my ($dir) = grep { $_->[0] eq $path } @dirs; @@ -31,6 +32,9 @@ foreach my $path (@d) { &apache::save_directive("AuthType", [ ], $conf, $conf); &apache::save_directive("AuthName", [ ], $conf, $conf); &apache::save_directive("require", [ ], $conf, $conf); + my @files = &apache::find_directive_struct("Files", $conf); + @files = grep { $_->{'value'} ne $htusers } @files; + &apache::save_directive("Files", \@files, $conf, $conf); if ($main::file_cache{$file}) { &virtual_server::write_as_domain_user($d, sub { &flush_file_lines($file) });