|
|
|
|
@@ -1,4 +1,4 @@
|
|
|
|
|
#!/usr/local/bin/perl
|
|
|
|
|
#!/usr/bin/perl
|
|
|
|
|
# edit_list.cgi
|
|
|
|
|
# Edit an existing mailing list
|
|
|
|
|
|
|
|
|
|
@@ -7,11 +7,14 @@ require './majordomo-lib.pl';
|
|
|
|
|
%access = &get_module_acl();
|
|
|
|
|
&can_edit_list(\%access, $in{'name'}) ||
|
|
|
|
|
&error($text{'edit_ecannot'});
|
|
|
|
|
$desc = &text('edit_for', "<tt>".&html_escape($in{'name'})."</tt>");
|
|
|
|
|
&ui_print_header($desc, $text{'edit_title'}, "");
|
|
|
|
|
$list = &get_list($in{'name'}, &get_config());
|
|
|
|
|
$conf = &get_list_config($list->{'config'});
|
|
|
|
|
local $moderate= (&find_value('moderate', $conf) =~ /no/) ? "" : " (".$text{'index_moderated'}.")";
|
|
|
|
|
|
|
|
|
|
@links = ( "edit_members.cgi", "edit_info.cgi", "edit_subs.cgi",
|
|
|
|
|
"edit_mesg.cgi", "edit_access.cgi", "edit_head.cgi",
|
|
|
|
|
&ui_print_header(undef, $text{'edit_title'}."<br><em>".&html_escape($in{'name'})."</em><tt>$moderate</tt>", "");
|
|
|
|
|
|
|
|
|
|
@links = ( "edit_subs.cgi",
|
|
|
|
|
"edit_mesg.cgi", "edit_access.cgi",
|
|
|
|
|
"edit_misc.cgi" );
|
|
|
|
|
foreach $a (&foreign_call($aliases_module, "list_aliases",
|
|
|
|
|
&get_aliases_file())) {
|
|
|
|
|
@@ -23,19 +26,90 @@ foreach $a (&foreign_call($aliases_module, "list_aliases",
|
|
|
|
|
if ($isdigest) {
|
|
|
|
|
push(@links, "edit_digest.cgi");
|
|
|
|
|
}
|
|
|
|
|
map { s/edit_(\S+).cgi/images\/$1.gif/ } (@icons = @links);
|
|
|
|
|
map { s/edit_(\S+).cgi/$text{"$1_title"}/ } (@titles = @links);
|
|
|
|
|
@links = map { $_."?name=".&urlize($in{'name'}) } @links;
|
|
|
|
|
&icons_table(\@links, \@titles, \@icons);
|
|
|
|
|
# name to add to links
|
|
|
|
|
$name_link="?name=".&urlize($in{'name'});
|
|
|
|
|
# other buttons
|
|
|
|
|
local $otherbut, $bcss=' style="display: box; float: left; padding: 10px;"';
|
|
|
|
|
foreach (@links)
|
|
|
|
|
{
|
|
|
|
|
$action = $_ .$name_link, ($submit=$_) =~ s/edit_(\S+).cgi/$1_title/;
|
|
|
|
|
$otherbut .= "<div $bcss><form action=\"".$action."\" method=\"post\">".&ui_submit($text{$submit})."</form></div>\n";
|
|
|
|
|
}
|
|
|
|
|
print $otherbut;
|
|
|
|
|
|
|
|
|
|
# css for table
|
|
|
|
|
local $tcss='style="width: 98%; margin: 1% !important;"';
|
|
|
|
|
local $dcss='style="text-align: right; vertical-align: top; padding: 5px !important; min_heigth: 5em;"';
|
|
|
|
|
local $vcss='style="width: 40%; border: 1px solid lightgrey; padding: 5px !important;"';
|
|
|
|
|
|
|
|
|
|
# title, descritpion, info
|
|
|
|
|
print "<table border width=100%>\n";
|
|
|
|
|
print "<tr $tb> <td><b>".$text{'info_title'}."</b></td>";
|
|
|
|
|
print "<td width=10% nowrap><form action=\"edit_info.cgi".$name_link."\" method=\"post\">",
|
|
|
|
|
&ui_submit($text{'modify'}),"</form>\n</tr>\n";
|
|
|
|
|
print "<tr $cb> <td colspan=2><table $tcss>\n";
|
|
|
|
|
print "<tr> <td $dcss><b>".$text{'info_desc'}."</b></td>\n";
|
|
|
|
|
$desc = &find_value("description", $conf);
|
|
|
|
|
print "<td $vcss>$desc</td> </tr>\n";
|
|
|
|
|
print "<tr> <td $dcss><b>",&text('info_info', $in{'name'}),"</b></td>\n";
|
|
|
|
|
print "<td $vcss>";
|
|
|
|
|
open(INFO, $list->{'info'});
|
|
|
|
|
while(<INFO>) {
|
|
|
|
|
print if (!/^\[Last updated on:/);
|
|
|
|
|
}
|
|
|
|
|
close(INFO);
|
|
|
|
|
print "</td> </tr>\n";
|
|
|
|
|
print "<tr> <td $dcss><b>".$text{'info_intro'}."</b></td> <td $vcss>\n";
|
|
|
|
|
open(INTRO, $list->{'intro'});
|
|
|
|
|
while(<INTRO>) {
|
|
|
|
|
print if (!/^\[Last updated on:/);
|
|
|
|
|
}
|
|
|
|
|
close(INTRO);
|
|
|
|
|
print "</td> </tr>\n";
|
|
|
|
|
print "</table></td></tr></table>\n";
|
|
|
|
|
|
|
|
|
|
# header and footer
|
|
|
|
|
print "<table border width=100%>\n";
|
|
|
|
|
print "<tr $tb> <td><b>".$text{'head_title'}."</b></td>";
|
|
|
|
|
print "<td width=10% nowrap><form action=\"edit_head.cgi".$name_link."\" method=\"post\">",
|
|
|
|
|
&ui_submit($text{'modify'}),"</form>\n</tr>\n";
|
|
|
|
|
print "<tr $cb> <td colspan=2><table $tcss>\n";
|
|
|
|
|
print "<tr> <td $dcss><b>".$text{'head_fronter'}."</b></td> <td $vcss>\n";
|
|
|
|
|
print &find_value("message_fronter", $conf);
|
|
|
|
|
print "</td></tr>\n";
|
|
|
|
|
print "<tr> <td $dcss><b>".$text{'head_footer'}."</b></td> <td $vcss>\n";
|
|
|
|
|
print &find_value("message_footer", $conf);
|
|
|
|
|
print "</td></tr>\n";
|
|
|
|
|
print "<tr> <td $dcss><b>".$text{'head_headers'}."</b></td> <td $vcss>\n";
|
|
|
|
|
print &find_value("message_headers", $conf);
|
|
|
|
|
print "</td></tr>\n";
|
|
|
|
|
print "</table></td></tr></table>\n";
|
|
|
|
|
|
|
|
|
|
# members
|
|
|
|
|
print "<table border width=100%>\n";
|
|
|
|
|
print "<tr $tb> <td><b>".$text{'members_title'}."</b></td>";
|
|
|
|
|
print "<td width=10% nowrap><form action=\"edit_members.cgi".$name_link."\" method=\"post\">",
|
|
|
|
|
&ui_submit($text{'modify'}),"</form>\n</tr>\n";
|
|
|
|
|
print "<tr $cb> <td colspan=2>\n";
|
|
|
|
|
local @cols, @tds, $count=0;
|
|
|
|
|
print &ui_columns_start(\@cols, $tcss, 0, \@tds);
|
|
|
|
|
open(MEMS, $list->{'members'});
|
|
|
|
|
while(<MEMS>) {
|
|
|
|
|
$count++;
|
|
|
|
|
push(@cols, $_);
|
|
|
|
|
if($count % 3 == 0) {print &ui_columns_row(\@cols, \@tds); @cols=();}
|
|
|
|
|
}
|
|
|
|
|
close(MEMS);
|
|
|
|
|
push(@cols,"","") if $count % 3 == 1;
|
|
|
|
|
push(@cols, "") if $count % 3 == 2;
|
|
|
|
|
print &ui_columns_row(\@cols, \@tds);
|
|
|
|
|
print "</table></td></tr></table>\n";
|
|
|
|
|
|
|
|
|
|
#delete list
|
|
|
|
|
print "<div $bcss><form action=\"delete_list.cgi".$name_link."\" method=\"post\">",
|
|
|
|
|
&ui_submit($text{'edit_delete'})."</form></div>\n";
|
|
|
|
|
print "<div style=\"padding-top: 20px;\">$text{'edit_deletemsg'}</div>\n";
|
|
|
|
|
|
|
|
|
|
print &ui_hr();
|
|
|
|
|
print "<table>\n";
|
|
|
|
|
print "<form action=delete_list.cgi>\n";
|
|
|
|
|
print "<input type=hidden name=name value=\"$in{'name'}\">\n";
|
|
|
|
|
print "<tr> <td><input type=submit value=\"$text{'edit_delete'}\"></td>\n";
|
|
|
|
|
print "<td>$text{'edit_deletemsg'}</td> </tr>\n";
|
|
|
|
|
print "</form>\n";
|
|
|
|
|
print "</table>\n";
|
|
|
|
|
|
|
|
|
|
&ui_print_footer("", $text{'index_return'});
|
|
|
|
|
|
|
|
|
|
|