Handle hostnames with upper-case letters
[webmin.git] / pserver / save_config.cgi
1 #!/usr/local/bin/perl
2 # save_config.cgi
3 # Save server config options
4
5 require './pserver-lib.pl';
6 $access{'config'} || &error($text{'config_ecannot'});
7 &ReadParse();
8 &error_setup($text{'save_err'});
9
10 # Validate and save inputs
11 &lock_file($cvs_config_file);
12 @conf = &get_cvs_config();
13 if ($in{'auth'}) {
14         &save_cvs_config(\@conf, "SystemAuth", undef, "yes");
15         }
16 else {
17         &save_cvs_config(\@conf, "SystemAuth", "no", "yes");
18         }
19 if ($in{'top'}) {
20         &save_cvs_config(\@conf, "TopLevelAdmin", "yes", "no");
21         }
22 else {
23         &save_cvs_config(\@conf, "TopLevelAdmin", undef, "no");
24         }
25 if ($in{'hist_def'}) {
26         &save_cvs_config(\@conf, "LogHistory", undef, "all");
27         }
28 else {
29         &save_cvs_config(\@conf, "LogHistory",
30                          join("", split(/\0/, $in{'hist'})), "all");
31         }
32 if ($in{'lock_def'}) {
33         &save_cvs_config(\@conf, "LockDir", undef);
34         }
35 else {
36         -d $in{'lock'} || &error($text{'config_elock'});
37         &save_cvs_config(\@conf, "LockDir", $in{'lock'});
38         }
39 &flush_file_lines();
40 &unlock_file($cvs_config_file);
41 &webmin_log("config");
42 &redirect("");
43