Handle hostnames with upper-case letters
[webmin.git] / squid / delete_http_accesses.cgi
1 #!/usr/local/bin/perl
2 # Delete multiple proxy restrictions
3
4 require './squid-lib.pl';
5 &error_setup($text{'dhttp_err'});
6 $access{'actrl'} || &error($text{'eacl_ecannot'});
7 &ReadParse();
8 @d = split(/\0/, $in{'d'});
9 @d || &error($text{'dhttp_enone'});
10
11 # Get the existing restrictions
12 &lock_file($config{'squid_conf'});
13 $conf = &get_config();
14 @https = &find_config("http_access", $conf);
15
16 # Delete them
17 foreach $d (sort { $b <=> $c } @d) {
18         $http = $conf->[$d];
19         splice(@https, &indexof($http, @https), 1);
20         }
21
22 # Write out
23 &save_directive($conf, "http_access", \@https);
24 &flush_file_lines();
25 &unlock_file($config{'squid_conf'});
26 &webmin_log("delete", "https", scalar(@d));
27 &redirect("edit_acl.cgi?mode=http");
28