Handle hostnames with upper-case letters
[webmin.git] / pserver / edit_config.cgi
1 #!/usr/local/bin/perl
2 # edit_config.cgi
3 # Display server configuration options
4
5 require './pserver-lib.pl';
6 $access{'config'} || &error($text{'config_ecannot'});
7 &ui_print_header(undef, $text{'config_title'}, "");
8 @conf = &get_cvs_config();
9
10 print "<form action=save_config.cgi>\n";
11 print "<table border>\n";
12 print "<tr $tb> <td><b>$text{'config_header'}</b></td> </tr>\n";
13 print "<tr $cb> <td><table width=100%>\n";
14
15 $auth = &find("SystemAuth", \@conf);
16 print "<tr> <td><b>$text{'config_auth'}</b></td>\n";
17 printf "<td><input type=radio name=auth value=1 %s> %s\n",
18         $auth->{'value'} eq 'no' ? "" : "checked", $text{'yes'};
19 printf "<input type=radio name=auth value=0 %s> %s</td> </tr>\n",
20         $auth->{'value'} eq 'no' ? "checked" : "", $text{'no'};
21
22 $top = &find("TopLevelAdmin", \@conf);
23 print "<tr> <td><b>$text{'config_top'}</b></td>\n";
24 printf "<td><input type=radio name=top value=1 %s> %s\n",
25         $top->{'value'} eq 'yes' ? "checked" : "", $text{'yes'};
26 printf "<input type=radio name=top value=0 %s> %s</td> </tr>\n",
27         $top->{'value'} eq 'yes' ? "" : "checked", $text{'no'};
28
29 $hist = &find("LogHistory", \@conf);
30 $all++ if (!$hist || lc($hist->{'value'}) eq 'all');
31 map { $hist{lc($_)}++ } split(//, $hist->{'value'}) if (!$all);
32 print "<tr> <td valign=top><b>$text{'config_hist'}</b></td>\n";
33 printf "<td><input type=radio name=hist_def value=1 %s> %s\n",
34         $all ? "checked" : "", $text{'config_hist_all'};
35 printf "<input type=radio name=hist_def value=0 %s> %s<br>\n",
36         $all ? "" : "checked", $text{'config_hist_sel'};
37 print "<table width=100%>\n";
38 $i = 0;
39 foreach $h (@hist_chars) {
40         print "<tr>\n" if ($i%2 == 0);
41         printf "<td><input type=checkbox name=hist value=%s %s> %s</td>\n",
42                 $h, $hist{lc($h)} ? "checked" : "", $text{'config_hist_'.$h};
43         print "</tr>\n" if ($i%2 == 1);
44         $i++;
45         }
46 print "</table></td></tr>\n";
47
48 $lock = &find("LockDir", \@conf);
49 print "<tr> <td><b>$text{'config_lock'}</b></td>\n";
50 printf "<td><input type=radio name=lock_def value=1 %s> %s\n",
51         $lock ? "" : "checked", $text{'default'};
52 printf "<input type=radio name=lock_def value=0 %s>\n",
53         $lock ? "checked" : "";
54 printf "<input name=lock size=30 value='%s'> %s</td> </tr>\n",
55         $lock->{'value'}, &file_chooser_button("lock");
56
57 print "</table></td></tr></table>\n";
58 print "<input type=submit value='$text{'save'}'></form>\n";
59
60 &ui_print_footer("", $text{'index_return'});
61