2 # Save the list of per-function cache manager passwords
4 require './squid-lib.pl';
5 &error_setup($text{'cachemgr_err'});
6 $access{'cachemgr'} || &error($text{'cachemgr_ecannot'});
9 # Validate and store inputs
10 &lock_file($config{'squid_conf'});
11 $conf = &get_config();
13 if ($in{'cachemgr_def'}) {
15 &save_directive($conf, "cachemgr_passwd", [ ]);
18 # Build up list and save
19 for($i=0; defined($pmode = $in{"pass_def_$i"}); $i++) {
20 $pass = $pmode || $in{"pass_$i"};
25 @actions = ( split(/\0/, $in{"action_$i"}),
26 split(/\s+/, $in{"others_$i"}) );
28 if ($pass && @actions) {
29 push(@rv, { 'name' => 'cachemgr_passwd',
30 'values' => [ $pass, @actions ] });
34 @rv || &error($text{'cachemgr_enone'});
35 &save_directive($conf, "cachemgr_passwd", \@rv);
40 &unlock_file($config{'squid_conf'});
41 &webmin_log("cachemgr");