Merge branch 'master' of git@github.com:webmin/webmin

This commit is contained in:
Jamie Cameron
2017-05-27 21:42:32 -07:00
7 changed files with 130 additions and 47 deletions

View File

@@ -169,7 +169,7 @@ main_title2=Webmin
main_title3=Webmin $1 ($2)
main_unused=Nicht benutzte Module
main_version=Version $1 auf $2 ($3)
modify=Modifizieren
modify=Anpassen
modules_all=Alle Module
modules_cancel=Abbrechen
modules_clear=Löschen

View File

@@ -84,11 +84,8 @@ if ($in{'confirm'}) {
}
else {
# ask the user if he is sure
&ui_print_header(undef, $text{'delete_title'}, "");
print "<form action=delete_list.cgi>\n";
print "<input type=hidden name=name value=\"$name\">\n";
print "<input type=hidden name=confirm value=1>\n";
print "<b>",&text('delete_rusure', "<tt>".&html_escape($name)."</tt>"),
&ui_print_header(undef, $text{'delete_title'}."<br><font color=\"red\"><em>".&html_escape($name)."</em></font>", "");
print "<b>",&text('delete_rusure', "<font color=\"red\"><em>".&html_escape($name)."</em></font>"),
"</b><br>\n";
print "<ul>\n";
foreach $f (@files) {
@@ -102,9 +99,9 @@ else {
"</tt><br>\n";
}
print "</ul>\n";
print "<center><input type=submit ",
"value='$text{'delete_ok'}'></center>\n";
print "</form>\n";
local $bcss=' style="padding: 10px; text-align: center;"';
print "<div $bcss><form action=\"delete_list.cgi".$name_link."&confirm=1\" method=\"post\">",
&ui_submit($text{'delete_ok'})."</form></div>\n";
&ui_print_footer("edit_list.cgi?name=$name", $text{'edit_return'});
}

View File

@@ -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,89 @@ 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;
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";
# 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";
&ui_print_footer("", $text{'index_return'});

View File

@@ -1,4 +1,4 @@
#!/usr/bin/perl
#!/usr/local/bin/perl
# index.cgi
# Display all mailing lists and majordomo options
@@ -113,17 +113,19 @@ if (!$majordomo_alias) {
@lists = sort { $a cmp $b } @lists if ($config{'sort_mode'});
map { $lcan{$_}++ } split(/\s+/, $access{'lists'});
# top links
local $otherbut, $bcss=' style="display: box; float: left; padding: 10px;"';
if ($access{'create'}) {
@crlinks = ( &ui_link("create_form.cgi",$text{'index_add'}) );
push(@crlinks, &ui_link("digest_form.cgi",$text{'index_digest'}));
print "<div $bcss><form action=\"create_form.cgi\">".&ui_submit($text{'index_add'})."</form></div>\n";
print "<div $bcss><form action=\"digest_form.cgi\">".&ui_submit($text{'index_digest'})."</form></div>\n";
print "<style>hr {display: none;></style>"
}
if (@lists) {
# table header
local @hcols, @tds;
push(@hcols, "", "");
push(@hcols, $text{'index_name'}, $text{'index_info'}, $text{'index_owner'}, $text{'index_moderated'}, $text{'index_count'});
push(@tds, "width=5" ,"" );
push(@tds, "width=200", "", "width=200", "", "");
push(@hcols, $text{'index_name'}, $text{'index_info'}, $text{'index_mail'}, $text{'index_moderated'}, $text{'index_count'});
push(@tds, "width=5" ,"width=100" );
push(@tds, "", "", "width=100", "", "");
print &ui_columns_start(\@hcols, 100, 0, \@tds);
# mailing lists
foreach $l (grep { $lcan{$_} || $lcan{"*"} } @lists) {
@@ -133,30 +135,31 @@ if (@lists) {
push(@cols, "","<a href=edit_list.cgi?name=$l><img src=images/smallicon.gif></a>");
push(@cols, "<a href=edit_list.cgi?name=$l>". &html_escape($l) ."</a>" );
open(INFO, $list->{'info'});
push(@cols, "<em>".<INFO>."</em>" ."&nbsp;&nbsp;<em>[<a href=edit_info.cgi?name=$l>edit</a>]</em>");
push(@cols, "<em>".<INFO>."</em>" ."&nbsp;&nbsp;<em><a href=edit_info.cgi?name=$l><span>edit</span></a></em>");
close(INFO);
#push(@cols, $l . "-owner");
push(@cols, "<em>". &find_value('reply_to', $conf) ."</em>");
push(@cols, "<em>". $text{&find_value('moderate', $conf)} ."</em>");
push(@cols, `cat $list->{'members'} | wc -l` . "&nbsp;&nbsp;<em>[<a href=edit_members.cgi?name=$l>edit</a>]</em>");
push(@cols, "<center><em>". $text{&find_value('moderate', $conf)} ."</em></center>");
push(@cols, "<center>".`cat $list->{'members'} | wc -l` . "&nbsp;&nbsp;<em><a href=edit_members.cgi?name=$l><span>edit</span></a></em></center>");
print&ui_columns_row(\@cols, \@tds);
}
} else {
print "<b>$text{'index_none'}</b>.<p>\n";
}
if ($access{'create'}) {
print &ui_links_row(\@crlinks);
}
if ($access{'global'}) {
print &ui_hr();
print "<table> <tr>\n";
print "<form action=edit_global.cgi>\n";
print "<td><input type=submit value='$text{'index_global'}'></td>\n";
print "<td>$text{'index_globaldesc'}</td> </tr> </form>\n";
print "</table>\n";
print "<div $bcss><form action=\"edit_global.cgi\" method=\"post\">",
&ui_submit($text{'index_global'})."</form></div>\n";
print "<div style=\"padding-top: 10px;\">$text{'index_globaldesc'}</div>\n";
}
&ui_print_footer("/", $text{'index'});
print "<script>",
"f__lnk_t_btn(['/majordomo/', '/majordomo/index.cgi'], 'table tbody td',",
" 'a[href*=\"edit_info.cgi?\"], a[href*=\"edit_members.cgi?\"]',",
" 'btn btn-transparent btn-xs vertical-align-top margined-top-2', 'fa-edit');",
"document.querySelectorAll('tbody td .btn.btn-transparent').forEach(function(button) {",
" button.innerHTML=button.innerHTML.replace(/<\\/i>.*edit/,'');});",
"</script>",
"<style>.btn.btn-transparent { padding: 0 !important; color: grey;}</style>";

View File

@@ -218,3 +218,8 @@ access_adv0=Jedermann
create_archive=Mailingliste archivieren?
index_globaldesc=Bearbeiten der globalen Majordomo-Einstellungen, die auf alle Mailinglisten angewandt werden
delete_title=L&#246;sche die Liste
index_name=Name Mailingliste
index_info=Kurzbescheibung
index_mail=Mail Adresse
index_moderated=Modieriert
index_count=# Teilnehmer

View File

@@ -218,6 +218,9 @@ access_adv0=Jedermann
create_archive=Mailingliste archivieren?
index_globaldesc=Bearbeiten der globalen Majordomo-Einstellungen, die auf alle Mailinglisten angewandt werden
delete_title=Lösche die Liste
index_name=Name der Mailingliste
index_name=Name Mailingliste
index_info=Kurzbescheibung
index_count=# der Teilnehmer
index_mail=Mail Adresse
index_moderated=Modieriert
index_count=# Teilnehmer
list_title=&Uuml;bersicht Mailingliste

View File

@@ -18,8 +18,10 @@ index_global=Edit Majordomo Options
index_globaldesc=Edit global Majordomo options that apply to all mailing lists
index_return=mailing lists
index_version=Majordomo version $1
index_name=Name of list
index_name=List name
index_info=List info
index_mail=Mail adress
index_moderated=Moderated
index_count=# of users
global_title=Global Options