diff --git a/squid/clear.cgi b/squid/clear.cgi
index 1bc1dc585..f35b3ec5a 100755
--- a/squid/clear.cgi
+++ b/squid/clear.cgi
@@ -2,20 +2,24 @@
# clear.cgi
# Delete the cache, chown the directory to the correct user and re-run squid -z
+use strict;
+use warnings;
+our (%text, %in, %access, $squid_version, %config);
require './squid-lib.pl';
$access{'rebuild'} || &error($text{'clear_ecannot'});
&ReadParse();
$config{'cache_dir'} =~ /^\/\S+/ || &error("Cache directory not set");
-$conf = &get_config();
+my $conf = &get_config();
if (!$in{'confirm'}) {
# Ask the user if he is sure
&ui_print_header(undef, $text{'clear_header'}, "");
- print $text{'clear_msgclear'},"
\n";
- print $text{'clear_msgclear2'},"
\n"; - print "
\n"; + + print &ui_confirmation_form( + "clear.cgi", + $text{'clear_msgclear'}."\n";
-$cmd = "$config{'squid_path'} -f $config{'squid_conf'} -z";
+my $cmd = "$config{'squid_path'} -f $config{'squid_conf'} -z";
print &text('clear_init',$cmd)."
\n";
print "
\n";
&additional_log('exec', undef, $cmd);
@@ -92,10 +93,10 @@ print "$text{'clear_done'}\n";
# Try to re-start squid
if ($stopped) {
- $temp = &transname();
+ my $temp = &transname();
&system_logged("$config{'squid_path'} -sY -f $config{'squid_conf'} >$temp 2>&1 /dev/null 2>&1");
diff --git a/squid/edit_cachemgr.cgi b/squid/edit_cachemgr.cgi
index 25c67ef83..13f904b27 100755
--- a/squid/edit_cachemgr.cgi
+++ b/squid/edit_cachemgr.cgi
@@ -1,14 +1,17 @@
#!/usr/local/bin/perl
# Show a list of per-function cache manager passwords
+use strict;
+use warnings;
+our (%text, %in, %access, $squid_version, %config);
require './squid-lib.pl';
$access{'cachemgr'} || &error($text{'cachemgr_ecannot'});
&ui_print_header(undef, $text{'cachemgr_title'}, "", "edit_cachemgr", 0, 0, 0,
&restart_button());
# Find password directives
-$conf = &get_config();
-@cachemgr = &find_config("cachemgr_passwd", $conf);
+my $conf = &get_config();
+my @cachemgr = &find_config("cachemgr_passwd", $conf);
# Show them in a table
print &ui_form_start("save_cachemgr.cgi", "post");
@@ -16,17 +19,17 @@ print &ui_radio("cachemgr_def", @cachemgr ? 0 : 1,
[ [ 1, $text{'cachemgr_def1'} ], [ 0, $text{'cachemgr_def0'} ] ]),"
\n";
print &ui_columns_start([ $text{'cachemgr_pass'},
$text{'cachemsg_actions'} ], 100, 0);
-$i = 0;
-foreach $c (@cachemgr, { 'values' => [ 'none' ] }) {
- @grid = ( );
- ($p, @acts) = @{$c->{'values'}};
- %acts = map { $_, 1 } @acts;
+my $i = 0;
+foreach my $c (@cachemgr, { 'values' => [ 'none' ] }) {
+ my @grid = ( );
+ my ($p, @acts) = @{$c->{'values'}};
+ my %acts = map { $_, 1 } @acts;
foreach my $a (&list_cachemgr_actions()) {
push(@grid, &ui_checkbox("action_$i", $a, $a, $acts{$a}));
delete($acts{$a});
}
- @others = grep { $_ ne 'all' } keys %acts;
- $pmode = $p eq "none" ? "none" : $p eq "disable" ? "disable" : undef;
+ my @others = grep { $_ ne 'all' } keys %acts;
+ my $pmode = $p eq "none" ? "none" : $p eq "disable" ? "disable" : undef;
print &ui_columns_row([
&ui_radio("pass_def_$i", $pmode,
[ [ "none", $text{'cachemgr_none'}."
" ],
diff --git a/squid/save_cachemgr.cgi b/squid/save_cachemgr.cgi
index 124e7b415..492b5ed24 100755
--- a/squid/save_cachemgr.cgi
+++ b/squid/save_cachemgr.cgi
@@ -1,6 +1,9 @@
#!/usr/local/bin/perl
# Save the list of per-function cache manager passwords
+use strict;
+use warnings;
+our (%text, %in, %access, $squid_version, %config);
require './squid-lib.pl';
&error_setup($text{'cachemgr_err'});
$access{'cachemgr'} || &error($text{'cachemgr_ecannot'});
@@ -8,7 +11,7 @@ $access{'cachemgr'} || &error($text{'cachemgr_ecannot'});
# Validate and store inputs
&lock_file($config{'squid_conf'});
-$conf = &get_config();
+my $conf = &get_config();
if ($in{'cachemgr_def'}) {
# Clear them all
@@ -16,8 +19,10 @@ if ($in{'cachemgr_def'}) {
}
else {
# Build up list and save
- for($i=0; defined($pmode = $in{"pass_def_$i"}); $i++) {
- $pass = $pmode || $in{"pass_$i"};
+ my @rv;
+ for(my $i=0; defined(my $pmode = $in{"pass_def_$i"}); $i++) {
+ my $pass = $pmode || $in{"pass_$i"};
+ my @actions;
if ($in{"all_$i"}) {
@actions = ( "all" );
}