2 # http_reply_access_save.cgi
3 # Save or delete a proxy REPLY restriction
5 require './squid-lib.pl';
6 $access{'actrl'} || &error($text{'eacl_ecannot'});
8 &lock_file($config{'squid_conf'});
10 $whatfailed = $text{'sahttp_replyftspr'};
12 @http_replies = &find_config("http_reply_access", $conf);
13 if (defined($in{'index'})) {
14 $http = $conf->[$in{'index'}];
17 # delete this restriction
18 splice(@http_replies, &indexof($http, @http_replies), 1);
22 @vals = ( $in{'action'} );
23 foreach $y (split(/\0/, $in{'yes'})) { push(@vals, $y); }
24 foreach $n (split(/\0/, $in{'no'})) { push(@vals, "!$n"); }
25 $newhttp = { 'name' => 'http_reply_access', 'values' => \@vals };
26 if ($http) { splice(@http_replies, &indexof($http, @http_replies), 1, $newhttp); }
27 else { push(@http_replies, $newhttp); }
29 &save_directive($conf, "http_reply_access", \@http_replies);
31 &unlock_file($config{'squid_conf'});
32 &webmin_log($in{'delete'} ? 'delete' : $http ? 'modify' : 'create', "http");
33 &redirect("edit_acl.cgi?mode=reply");