Handle hostnames with upper-case letters
[webmin.git] / majordomo / save_global.cgi
1 #!/usr/local/bin/perl
2 # save_global.cgi
3 # Save global majordomo options
4
5 require './majordomo-lib.pl';
6 &ReadParse();
7 %access = &get_module_acl();
8 $access{'global'} || &error($text{'global_ecannot'});
9 &lock_file($config{'majordomo_cf'});
10 $conf = &get_config();
11 &error_setup($text{'global_err'});
12
13 # Check inputs
14 $in{'whereami'} =~ /^[A-z0-9\-\.]+$/ ||
15         &error($text{'global_ewhereami'});
16 $in{'whoami'} =~ /^\S+$/ ||
17         &error($text{'global_ewhoami'});
18 $in{'whoami_owner'} =~ /^\S+$/ ||
19         &error($text{'global_eowner'});
20 -x $in{'sendmail_command'} ||
21         &error(&text('global_esendmail', "<tt>$in{'sendmail_command'}</tt>"));
22
23 # Save inputs
24 &save_directive($conf, "whereami", $in{'whereami'});
25 &save_directive($conf, "whoami", $in{'whoami'});
26 &save_directive($conf, "whoami_owner", $in{'whoami_owner'});
27 &save_directive($conf, "sendmail_command", $in{'sendmail_command'});
28 &flush_file_lines();
29 &unlock_file($config{'majordomo_cf'});
30 &webmin_log("global", undef, undef, \%in);
31 &redirect("");
32