3 # Store the info and intro message for a list
5 require './majordomo-lib.pl';
8 %access = &get_module_acl();
9 &can_edit_list(\%access, $in{'name'}) || &error($text{'edit_ecannot'});
10 $list = &get_list($in{'name'}, &get_config());
11 &lock_file($list->{'config'});
12 &lock_file($list->{'info'});
13 &lock_file($list->{'intro'});
14 $conf = &get_list_config($list->{'config'});
15 chop($ctime = ctime(time()));
16 $updated = "[Last updated on: $ctime]\n";
18 $in{'info'} =~ s/\r//g;
19 &open_tempfile(INFO, ">$list->{'info'}");
20 if (&find_value("date_info", $conf) eq "yes") {
21 &print_tempfile(INFO, $updated);
23 &print_tempfile(INFO, $in{'info'});
24 &print_tempfile(INFO, "\n") if ($in{'info'} !~ /\n$/);
25 &close_tempfile(INFO);
26 if ($in{'intro_def'}) {
27 unlink($list->{'intro'});
30 $in{'intro'} =~ s/\r//g;
31 &open_tempfile(INTRO, ">$list->{'intro'}");
32 if (&find_value("date_intro", $conf) eq "yes") {
33 &print_tempfile(INTRO, $updated);
35 &print_tempfile(INTRO, $in{'intro'});
36 &print_tempfile(INTRO, "\n") if ($in{'intro'} !~ /\n$/);
37 &close_tempfile(INTRO);
38 &set_permissions($list->{'intro'});
40 &save_list_directive($conf, $list->{'config'},
41 "description", $in{'description'});
44 &webmin_log("info", undef, $in{'name'});
45 &redirect("edit_list.cgi?name=$in{'name'}");