Handle hostnames with upper-case letters
[webmin.git] / majordomo / edit_info.cgi
1 #!/usr/local/bin/perl
2 # edit_info.cgi
3 # Display a form for editing the intro message for a list
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 $conf = &get_list_config($list->{'config'});
11 $desc = &text('edit_for', "<tt>".&html_escape($in{'name'})."</tt>");
12 &ui_print_header($desc, $text{'info_title'}, "");
13
14 print "<form action=save_info.cgi method=post>\n";
15 print "<input type=hidden name=name value=$in{'name'}>\n";
16 print "<table border width=100%>\n";
17 print "<tr $tb> <td><b>$text{'info_header'}</b></td> </tr>\n";
18 print "<tr $cb> <td><table>\n";
19
20 print "<tr> <td><b>$text{'info_desc'}</b></td>\n";
21 $desc = &find_value("description", $conf);
22 print "<td><input name=description size=40 value=\"$desc\"></td> </tr>\n";
23
24 print "<tr> <td valign=top><b>",&text('info_info', $in{'name'}),"</b></td>\n";
25 print "<td><textarea rows=5 cols=80 name=info>\n";
26 open(INFO, $list->{'info'});
27 while(<INFO>) {
28         print if (!/^\[Last updated on:/);
29         }
30 close(INFO);
31 print "</textarea></td> </tr>\n";
32
33 print "<tr> <td valign=top><b>$text{'info_intro'}</b></td> <td>\n";
34 $intro = -r $list->{'intro'};
35 printf "<input type=radio name=intro_def value=1 %s> $text{'info_same'}\n",
36         $intro ? "" : "checked";
37 printf "<input type=radio name=intro_def value=0 %s> $text{'info_below'}<br>\n",
38         $intro ? "checked" : "";
39 print "<textarea rows=5 cols=80 name=intro>\n";
40 open(INTRO, $list->{'intro'});
41 while(<INTRO>) {
42         print if (!/^\[Last updated on:/);
43         }
44 close(INTRO);
45 print "</textarea></td> </tr>\n";
46
47 print "</table></td></tr></table>\n";
48 print "<input type=submit value=\"$text{'save'}\"></form>\n";
49
50 &ui_print_footer("edit_list.cgi?name=$in{'name'}", $text{'edit_return'});
51