Handle hostnames with upper-case letters
[webmin.git] / majordomo / save_digest.cgi
1 #!/usr/local/bin/perl
2 # save_digest.cgi
3 # Save digest options
4
5 require './majordomo-lib.pl';
6 &ReadParse();
7 %access = &get_module_acl();
8 &can_edit_list(\%access, $in{'name'}) || &error($text{'edit_ecannot'});
9 $list = &get_list($in{'name'}, &get_config());
10 &lock_file($list->{'config'});
11 $conf = &get_list_config($list->{'config'});
12
13 &save_opt($conf, $list->{'config'}, "digest_name");
14 &save_opt($conf, $list->{'config'}, "digest_maxdays", \&check_days);
15 &save_opt($conf, $list->{'config'}, "digest_maxlines", \&check_lines);
16 &save_opt($conf, $list->{'config'}, "digest_volume", \&check_volume);
17 &save_opt($conf, $list->{'config'}, "digest_issue", \&check_issue);
18
19 &flush_file_lines();
20 &unlock_file($list->{'config'});
21 &webmin_log("digest", undef, $in{'name'}, \%in);
22 &redirect("edit_list.cgi?name=$in{'name'}");
23
24 sub check_days
25 {
26 return $_[0] =~ /^\d+$/ ? undef : $text{'digest_edays'};
27 }
28
29 sub check_lines
30 {
31 return $_[0] =~ /^\d+$/ ? undef : $text{'digest_elines'};
32 }
33
34 sub check_volume
35 {
36 return $_[0] =~ /^\d+$/ ? undef : $text{'digest_evolume'};
37 }
38
39 sub check_issue
40 {
41 return $_[0] =~ /^\d+$/ ? undef : $text{'digest_eissue'};
42 }
43