Handle hostnames with upper-case letters
[webmin.git] / syslog-ng / delete_filters.cgi
1 #!/usr/local/bin/perl
2 # Delete multiple filters
3
4 require './syslog-ng-lib.pl';
5 &ReadParse();
6 &error_setup($text{'fdelete_err'});
7 @d = split(/\0/, $in{'d'});
8 @d || &error($text{'fdelete_enone'});
9 foreach my $d (@d) {
10         &check_dependencies('filter', $d) &&
11             &error(&text('fdelete_eused', $d));
12         }
13
14 &lock_file($config{'syslogng_conf'});
15 $conf = &get_config();
16 @dests = &find("filter", $conf);
17 foreach my $d (@d) {
18         ($dest) = grep { $_->{'value'} eq $d } @dests;
19         $dest || &error($text{'filter_egone'});
20         &save_directive($conf, undef, $dest, undef, 0);
21         }
22
23 &unlock_file($config{'syslogng_conf'});
24 &webmin_log('delete', 'filters', scalar(@d));
25 &redirect("list_filters.cgi");