#!/usr/local/bin/perl # edit_list.cgi # Edit an existing mailing list require './majordomo-lib.pl'; &ReadParse(); %access = &get_module_acl(); &can_edit_list(\%access, $in{'name'}) || &error($text{'edit_ecannot'}); $list = &get_list($in{'name'}, &get_config()); $conf = &get_list_config($list->{'config'}); local $moderate= (&find_value('moderate', $conf) =~ /no/) ? "" : " (".$text{'index_moderated'}.")"; &ui_print_header( $text{'misc_header'}, $text{'edit_title'}.": ".&html_escape($in{'name'})."$moderate", ""); @links = ( "edit_access.cgi", "edit_misc.cgi" ); foreach $a (&foreign_call($aliases_module, "list_aliases", &get_aliases_file())) { if ($a->{'name'} =~ /-digestify$/i && $a->{'value'} =~ /\s$in{'name'}\s/i) { $isdigest++; } } if ($isdigest) { push(@links, "edit_digest.cgi"); } # 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 .= "
".&ui_submit($text{$submit})."
\n"; } print $otherbut; # css for table local $tcss='style="width: 98%; margin: 1% !important;"'; local $dcss='style="text-align: right; vertical-align: middle; padding: 0.3em 1em !important; min_heigth: 5em;"'; local $vcss='style="width: 40%; border: 1px solid lightgrey; padding: 0.3em !important;"'; local $xcss='style="width: 25%; border: 1px solid lightgrey; padding: 0.3em !important;"'; # list options print "\n"; print ""; print "\n"; print "
$text{'mesg_header'}
", &ui_submit($text{'modify'}),"
\n
\n"; print "\n"; print "\n"; print "
".$text{'mesg_reply'}."",&find_value("reply_to", $conf)."
".$text{'mesg_subject'}."".&find_value("subject_prefix", $conf)."
\n"; # title, descritpion, info print "\n"; print ""; print "\n"; print "
".$text{'info_title'}."
", &ui_submit($text{'modify'}),"
\n
\n"; print "\n"; $desc = &find_value("description", $conf); print "\n"; print "\n"; print "\n"; print "\n"; print "
".$text{'info_desc'}."$desc
",&text('info_info', $in{'name'}),""; open(INFO, $list->{'info'}); while() { print if (!/^\[Last updated on:/); } close(INFO); print "
".$text{'info_intro'}." \n"; open(INTRO, $list->{'intro'}); while() { print if (!/^\[Last updated on:/); } close(INTRO); print "
\n"; # header and footer print "\n"; print ""; print "\n"; print "
".$text{'head_title'}."
", &ui_submit($text{'modify'}),"
\n
\n"; print "\n"; print "\n"; print "\n"; print "
".$text{'head_fronter'}." \n"; print &find_value("message_fronter", $conf); print "
".$text{'head_footer'}." \n"; print &find_value("message_footer", $conf); print "
".$text{'head_headers'}." \n"; print &find_value("message_headers", $conf); print "
\n"; # owner and moderation print "\n"; print ""; print "\n"; print "
$text{'subs_title'}
", &ui_submit($text{'modify'}),"
\n
\n"; $pol = &find_value("subscribe_policy", $conf); if ($pol =~ /(\S+)\+confirm/) { $pol = $1; $confirm = 1; } print "\n"; $pol = &find_value("unsubscribe_policy", $conf); print "\n"; $aliases_files = &get_aliases_file(); @aliases = &foreign_call($aliases_module, "list_aliases", $aliases_files); foreach $a (@aliases) { $owner = $a->{'value'} if (lc($a->{'name'}) eq lc("$in{'name'}-owner") || lc($a->{'name'}) eq lc("owner-$in{'name'}")); $approval = $a->{'value'} if (lc($a->{'name'}) eq lc("$in{'name'}-approval")); } print "\n"; print "\n"; print "\n"; print "\n"; print "
$text{'subs_sub'}: \n"; print $pol eq "closed" ? $text{'subs_closed'} : $text{'subs_s'.$pol}; print "$text{'subs_unsub'}: \n"; print $pol eq "closed" ? $text{'subs_closed'} : $text{'subs_u'.$pol}; print "
$text{'subs_owner'}".&get_alias_owner($owner)."$text{'subs_approval'}".$approval."
\n"; # members print "\n"; print ""; print "\n"; print "
".$text{'members_title'}."
", &ui_submit($text{'modify'}),"
\n
\n"; local @cols, @tds, $count=0; print &ui_columns_start(\@cols, $tcss, 0, \@tds); open(MEMS, $list->{'members'}); while() { $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 "
\n"; #delete list print "
", &ui_submit($text{'edit_delete'})."
\n"; print "
$text{'edit_deletemsg'}
\n"; &ui_print_footer("", $text{'index_return'});