MOON
Server: Apache/2.2.31 (Unix) mod_ssl/2.2.31 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4
System: Linux csr818.wilogic.com 2.6.18-419.el5xen #1 SMP Fri Feb 24 22:50:37 UTC 2017 x86_64
User: digitals (531)
PHP: 5.4.45
Disabled: NONE
Upload Files
File: //var/usr/webmin-1.941/squid/move_refresh.cgi
#!/usr/bin/perl
# move_refresh.cgi
# Move a refresh_pattern directive up or down

use strict;
use warnings;
our (%text, %in, %access, $squid_version, %config);
require './squid-lib.pl';
$access{'refresh'} || &error($text{'header_ecannot'});
&lock_file($config{'squid_conf'});
my $conf = &get_config();
my ($pos, $move) = @ARGV;

my @refresh = &find_config("refresh_pattern", $conf);
my $newpos = $pos + $move;
my $oldv = $refresh[$pos]->{'values'};
$refresh[$pos]->{'values'} = $refresh[$newpos]->{'values'};
$refresh[$newpos]->{'values'} = $oldv;
&save_directive($conf, "refresh_pattern", \@refresh);
&flush_file_lines();
&unlock_file($config{'squid_conf'});
&webmin_log("move", "refresh", $oldv->[0] eq "-i" ? $oldv->[1] : $oldv->[0]);
&redirect("list_refresh.cgi");