5 require './squid-lib.pl';
6 $access{'admopts'} || &error($text{'eadm_ecannot'});
8 &lock_file($config{'squid_conf'});
10 $whatfailed = $text{'sadmin_ftsao'};
12 ($olduser, $oldgroup) = &get_squid_user($conf);
13 if ($squid_version < 2) {
14 if ($in{'effective_def'}) {
15 &save_directive($conf, "cache_effective_user", [ ]);
18 %dir = ( 'name', 'cache_effective_user',
19 'values', [ $in{'effective_u'}, $in{'effective_g'} ] );
20 &save_directive($conf, "cache_effective_user", [ \%dir ]);
24 &save_opt("cache_effective_user", undef, $conf);
25 &save_opt("cache_effective_group", undef, $conf);
27 &save_opt("cache_mgr", \&check_email, $conf);
28 &save_opt("visible_hostname", \&check_hostname, $conf);
29 if ($squid_version < 2) {
30 &save_opt("announce_to", undef, $conf);
31 &save_opt("cache_announce", \&check_announce, $conf);
34 &save_opt("unique_hostname", \&check_hostname, $conf);
35 if ($squid_version >= 2.4) {
36 &save_opt("hostname_aliases", undef, $conf);
38 &save_opt("announce_host", \&check_hostname, $conf);
39 &save_opt("announce_port", \&check_port, $conf);
40 &save_opt("announce_file", undef, $conf);
41 &save_opt_time("announce_period", $conf);
44 &unlock_file($config{'squid_conf'});
45 &webmin_log("admin", undef, undef, \%in);
47 ($user, $group) = &get_squid_user($conf);
48 if (($olduser ne $user || $oldgroup ne $group) && $user && $group) {
49 # User/group has changed! Ask user if he wants to chown log/cache/pid
50 &ui_print_header(undef, $text{'sadmin_header'}, "");
51 print $text{'sadmin_msg1'},"\n";
52 print "<center><form action=chown.cgi>\n";
53 print "<input type=submit value=\"$text{'sadmin_buttco'}\">\n";
54 print "</form></center>\n";
55 &ui_print_footer("", $text{'sadmin_return'});
57 else { &redirect(""); }
61 return $_[0] =~ /^\S+$/ ? undef : &text('sadmin_inavea',$_[0]);
66 return $_[0] =~ /^\S+$/ ? undef : &text('sadmin_inavh',$_[0]);
71 return $_[0] =~ /^\d+$/ ? undef : &text('sadmin_inavap',$_[0]);
76 return $_[0] =~ /^\d+$/ ? undef : &text('sadmin_inavp',$_[0]);