mirror of
https://github.com/webmin/webmin.git
synced 2025-07-21 23:40:34 +00:00
28 lines
662 B
Perl
Executable File
28 lines
662 B
Perl
Executable File
#!/usr/local/bin/perl
|
|
# save_delay.cgi
|
|
# Save global delay pool options
|
|
|
|
use strict;
|
|
use warnings;
|
|
no warnings 'redefine';
|
|
no warnings 'uninitialized';
|
|
our (%text, %in, %access, $squid_version, %config);
|
|
require './squid-lib.pl';
|
|
$access{'delay'} || &error($text{'delay_ecannot'});
|
|
&ReadParse();
|
|
&lock_file($config{'squid_conf'});
|
|
my $conf = &get_config();
|
|
&error_setup($text{'delay_err'});
|
|
|
|
&save_opt("delay_initial_bucket_level", \&check_initial, $conf);
|
|
&flush_file_lines();
|
|
&unlock_file($config{'squid_conf'});
|
|
&webmin_log("delay", undef, undef, \%in);
|
|
&redirect("");
|
|
|
|
sub check_initial
|
|
{
|
|
return $_[0] =~ /^\d+$/ ? undef : &text('delay_epercent', $_[0]);
|
|
}
|
|
|