'modsub' and 'remote' can be configured differently

warning, if both of them are set at the same time
require Text::ParseWords
require Mail::Ezmlm v0.07
support charset and language
changed available options in mod-subscribers page
release policy added
prepared for release 3.1
This commit is contained in:
lars 2006-01-16 01:46:23 +00:00
parent 3bfff2708c
commit 7930994498
18 changed files with 145 additions and 92 deletions

13
INSTALL
View File

@ -23,8 +23,17 @@ OVERVIEW:
engine). See INSTALL.clearsilver for details.
1. Get ezmlm-web and extract the archive:
1. Choose a distribution form
1a) source installation
Get ezmlm-web and extract the archive:
tar xzf ezmlm-web-3.x.tar.gz
(for source installation continue with step 2)
1b) debian package
This is the (by far) most convenient way to install ezmlm-web.
Read debian-releated/README.Debian for details.
(debian users may stop reading here)
2. Copy ezmlm-web.cgi to some publically readable directory. It does not
@ -145,7 +154,7 @@ OVERVIEW:
(e.g /var/log/apache/error.log).
If you have any problems, then you can:
If you have any problems:
- take a look at https://systemausfall.org/toolforge/ezmlm-web
- send me an email: ezmlm-web@sumpfralle.de
- subscribe to the mailinglist: ezmlm-web-subscribe@lists.systemausfall.org

3
README
View File

@ -1,5 +1,5 @@
=================
| ezmlm-web-3.0 |
| ezmlm-web-3.1 |
=================
If you only want to know how to install ezmlm-web, then you should
@ -107,6 +107,7 @@ This version of ezmlm-web requires the following;
+ Getopt::Std v4.1
+ File::Find v?
+ File::Copy v2.02
+ Text::ParseWords v3.24
The version number indicates the version of the module that ezmlm-web was
developed with. Earlier versions may work, but then they haven't been

View File

@ -2,6 +2,12 @@ This file contains some useful hints for upgrading from a previous version of ez
##############################################################################
UPGRADING ezmlm-web 3.0 to ezmlm-web 3.1
1) update the perl module Mail::Ezmlm to v0.07
------------------------------------------------------------------------------
UPGRADING ezmlm-web 2.3 to ezmlm-web 3.0
1) install clearsilver (see INSTALL for details)

View File

@ -1,3 +1,14 @@
Version 3.1 - 01/14/02006
* fully compatible with ezmlm-idx v5.0
* change language of list (idx >= 5.0)
* change charset of list (idx >= 5.0)
* 'modsub' and 'remote' can be changed independently
* improved configuration parsing
* requires Mail::Ezmlm v0.07
Version 3.0.2 - 01/11/02006
* fixed two confusing description strings
Version 3.0.1 - 01/06/02006
* allow several special characters in local part of mail address (RFC2822)

View File

@ -1,9 +1,9 @@
Package: ezmlm-web
Version: 3.1-2
Version: 3.1-3
Section: admin
Priority: extra
Architecture: all
Depends: perl, httpd-cgi
Depends: perl, httpd-cgi, libemail-address-perl, libemail-ezmlm-perl (>= 0.07)
Suggests: qmail-src, bash (>=2.0), gcc
Maintainer: Lars Kruse <devel@sumpfralle.de>
Description: Web interface for ezmlm-idx mailing list administration
@ -16,5 +16,5 @@ Description: Web interface for ezmlm-idx mailing list administration
* qmail - http://cr.yp.to/qmail.html
* ezmlm-idx - http://ezmlm.org/
* clearsilver for perl (>= 0.10.2) - http://www.clearsilver.net/downloads/
* some perl modules (see README)
* some perl modules (see README.Debian)

View File

@ -15,17 +15,10 @@ you surely did this already :)
2) install required additional software
2.1) clearsilver perl bindings
clearsilver perl bindings:
* download clearsilver (http://clearsilver.net) v0.10.2 or higher
* compile and install it with perl enabled
2.2) additional perl modules
You can install the following modules via cpan:
+ Mail::Ezmlm v0.07 (current version!)
+ Mail::Address v1.15
+ DB_File v1.65
(simply run "cpan" and enter "install Mail::Ezmlm" ... at the cpan prompt)
3) create user-specific suid binaries
As perl-suid is considered deprecated, you have to compile a C-wrapper

View File

@ -288,7 +288,6 @@ sub load_hdf {
$hdf->readFile($LANGUAGE_DIR . '/' . $HTML_LANGUAGE . '.hdf');
# TODO: check for existence
&fatal_error("Template dir ($TEMPLATE_DIR) not found!") unless (-e $TEMPLATE_DIR);
$hdf->setValue("TemplateDir", "$TEMPLATE_DIR/");
&fatal_error("Language data dir ($LANGUAGE_DIR) not found!") unless (-e $LANGUAGE_DIR);
@ -448,10 +447,6 @@ sub set_pagedata4list
}
untie %pretty if ($PRETTY_NAMES);
$pagedata->setValue("Data.List.hasDenyList", 1) if ($list->isdeny);
$pagedata->setValue("Data.List.hasAllowList", 1) if ($list->isallow);
$pagedata->setValue("Data.List.hasDigestList", 1) if ($list->isdigest);
# Get the contents of some important files
$item = $list->getpart('prefix');
$pagedata->setValue("Data.List.Prefix", "$item");
@ -519,10 +514,9 @@ sub set_pagedata4list
# charset of the list
if (Mail::Ezmlm->get_version() >= 5) {
my $charset = $list->getpart('charset');
my $charset = $list->get_charset();
$charset =~ s/^#.*$//m;
$pagedata->setValue('Data.List.CharSet', "$charset") if ($charset);
$pagedata->setValue('Data.useCharSet', "1");
$pagedata->setValue('Data.List.CharSet', "$charset");
}
$pagedata->setValue('Data.List.Language', $list->get_lang());
@ -550,22 +544,33 @@ sub set_pagedata4options {
$key = lc(substr($options,$i,1));
}
if (Mail::Ezmlm->get_version() < 5) {
# for ezmlm-idx < 5.0 the options "t", "p" and "x" are only
# used to create a default value they have no meaning, so we
# should adapt them to reality
$pagedata->setValue("Data.List.Options.t" , 1)
if (defined($list->get_text_content('trailer')));
$pagedata->setValue("Data.List.Options.f" , 1)
if (-e "$dir_of_list/prefix");
$pagedata->setValue("Data.List.Options.x" , 1)
if ((-e "$dir_of_list/mimeremove") || (-e "$dir_of_list/mimereject"));
}
# the options "tpxmsr" are used to create a default value
# if they are unset, the next ezmlm-make will remove the appropriate files
# but: these files are used, if they exist - regardless of the flag
# we will look for the files, if someone created them without ezmlm-make
# this is easier for users, as the options now represent the current
# behaviour of the list and not the configured flag value
# this is especially necessary for "trailer", as this file can be created
# via ezmlm-web without touching the flag
$pagedata->setValue("Data.List.Options.t" , 1)
if (-e "$dir_of_list/trailer");
$pagedata->setValue("Data.List.Options.f" , 1)
if (-e "$dir_of_list/prefix");
$pagedata->setValue("Data.List.Options.x" , 1)
if ((-e "$dir_of_list/mimeremove") || (-e "$dir_of_list/mimereject"));
$pagedata->setValue("Data.List.Options.m" , 1)
if (-e "$dir_of_list/modpost");
$pagedata->setValue("Data.List.Options.s" , 1)
if (-e "$dir_of_list/modsub");
$pagedata->setValue("Data.List.Options.r" , 1)
if (-e "$dir_of_list/remote");
for ($i=0; $i<9; $i++) {
for ($i=0; $i<=9; $i++) {
unless (($i eq 1) || ($i eq 2)) {
$state = ($options =~ /$i (?:'(.+?)')/);
# TODO: maybe add "-" to the pattern to avoid strange directory settings ending in a digit :)
$state = ($options =~ /\s-$i (?:'(.+?)')/);
unless ($state) {
# set default values
if ($i eq 0) {
$value = 'mainlist@' . $DEFAULT_HOST;
} elsif ($i eq 3) {
@ -576,9 +581,7 @@ sub set_pagedata4options {
$value = 'owner_address@domain.org';
} elsif ($i eq 6) {
$value = 'host:port:user:password:database:table';
} elsif ($i eq 7) {
$value = "$dir_of_list/mod";
} elsif ($i eq 8) {
} elsif (($i >= 7) && ($i <= 9)) {
$value = "$dir_of_list/mod";
}
} else {
@ -852,18 +855,13 @@ sub set_pagedata4part_list {
# do we store things in different directories?
my $config = $list->getconfig;
# empty values represent default settings - everything else is considered as evil :)
my($postpath) = $config =~ m{7\s*'([^']+)'};
my($subpath) = $config =~ m{8\s*'([^']+)'};
my($remotepath) = $config =~ m{9\s*'([^']+)'};
$pagedata->setValue("Data.List.hasPostMod", ($list->ismodpost)? 1 : 0);
$pagedata->setValue("Data.List.PostModPath", "$postpath");
my($postpath) = $config =~ m{-7\s*'([^']+)'};
my($subpath) = $config =~ m{-8\s*'([^']+)'};
my($remotepath) = $config =~ m{-9\s*'([^']+)'};
$pagedata->setValue("Data.List.hasSubMod", ($list->ismodsub)? 1 : 0);
$pagedata->setValue("Data.List.SubModPath", "$subpath");
$pagedata->setValue("Data.List.hasRemoteAdmin", ($list->isremote)? 1 : 0);
$pagedata->setValue("Data.List.RemoteAdminPath", "$remotepath");
$pagedata->setValue("Data.List.hasCustomizedPostModPath", ($postpath ne '')? 1 : 0);
$pagedata->setValue("Data.List.hasCustomizedSubModPath", ($subpath ne '')? 1 : 0);
$pagedata->setValue("Data.List.hasCustomizedAdminPath", ($remotepath ne '')? 1 : 0);
}
}
@ -989,14 +987,17 @@ sub extract_options_from_params()
############### settings ################
$avail_settings = $q->param('settings_available');
for ($i=0; $i<9; $i++) {
for ($i=0; $i<=9; $i++) {
if ($avail_settings =~ m/$i/) {
# this setting was visible for the user
$options .= " -$i '" . $q->param("setting_value_$i") . "'"
if (defined($q->param("setting_state_$i")));
if (defined($q->param("setting_state_$i"))) {
$options .= " -$i '" . $q->param("setting_value_$i") . "'";
} else {
$options .= " -$i ''";
}
} else {
# import the previous setting
$state = ($old_options =~ /$i (?:'(.+?)')/);
$state = ($old_options =~ /\s-$i (?:'(.+?)')/);
$options .= " -$i '$1'" if ($state);
}
}
@ -1029,42 +1030,38 @@ sub update_config {
}
# update trailing text
# remove old one if the checkbox was not active
if (defined($q->param('trailing_text'))) {
if (defined($q->param('option_t'))) {
$list->set_text_content('trailer', $q->param('trailing_text'));
} else {
$list->reset_text('trailer');
# ezmlm-make automatically removes this file
}
}
# update prefix text
# remove old one if the checkbox was not active
if (defined($q->param('prefix'))) {
if (defined($q->param('option_f'))) {
$list->setpart('prefix', $q->param('prefix'))
} else {
unlink("$dir_of_list/prefix");
# ezmlm-make automatically removes this file
}
}
# update mimeremove
# remove old one if the checkbox was not active
if (defined($q->param('mimeremove'))) {
if (defined($q->param('option_x'))) {
$list->setpart('mimeremove', $q->param('mimeremove'))
} else {
unlink("$dir_of_list/mimeremove");
# ezmlm-make automatically removes this file
}
}
# update mimereject
# remove old one if the checkbox was not active
if (defined($q->param('mimereject'))) {
if (defined($q->param('option_x'))) {
$list->setpart('mimereject', $q->param('mimereject'))
} else {
unlink("$dir_of_list/mimereject");
# ezmlm-make automatically removes this file
}
}
@ -1086,7 +1083,20 @@ sub update_config {
$list->setpart('msgsize', "$old_msgsize");
}
# update charset
# only if it is different from the previous value and the language was NOT changed
# otherwise it could overwrite the default of a new selected language
# this has to be done before updating the language
if (defined($q->param('list_charset'))) {
if ((defined($q->param('list_language'))) && ($q->param('list_language') ne $list->get_lang()) && ($list->get_charset() eq $q->param('list_charset'))) {
$list->set_charset('');
} else {
$list->set_charset($q->param('list_charset'));
}
}
# update language
# this _must_ happen after set_charset to avaoid accidently overriding default charset
if (defined($q->param('list_language'))) {
if (&check_language($list, $q->param('list_language'))) {
$list->set_lang($q->param('list_language'));
@ -1095,15 +1105,6 @@ sub update_config {
}
}
# update charset
if (defined($q->param('list_charset'))) {
if ($q->param('list_charset') ne '') {
$list->setpart('charset', $q->param('list_charset'));
} else {
unlink "$list->{'LIST_NAME'}/charset" if (-e "$list->{'LIST_NAME'}/charset");
}
}
unless (&update_webusers()) {
$warning = 'WebUsersUpdate';
return (1==0);

View File

@ -136,14 +136,14 @@ Lang {
Settings {
0 = Diese Liste is nur eine Unterliste
0 = Diese Liste ist die Unterliste einer anderen
3 = Definiere die Absender-Adresse ausgehender Mails
4 = Eigene Einstellungen zum Versand von Zusammenfassungsmails (ezmlm-tstdig)
5 = Lege die Mailadresse der/des Verantwortlichen für diese Liste fest
6 = Verwende eine SQL-Datenbank
7 = Die Datenbank der Nachrichten-ModeratorInnen befindet sich in einem alternativen Verzeichnis
8 = Die Datenbank der Einschreibe-ModeratorInnen (und Fern-AdministratorInnen) befindet sich in einem alternativen Verzeichnis
# 9 => not used - it is only an alternative to (8)
8 = Die Datenbank der Einschreibe-ModeratorInnen befindet sich in einem alternativen Verzeichnis
9 = Die Datenbank der Fern-AdministratorInnen befindet sich in einem alternativen Verzeichnis
}
@ -188,6 +188,7 @@ Lang {
DefaultFiles = vorgegebene Dateien
ListLanguage = Sprache der Liste
ListCharset = Zeichensatz der Liste
ModSubOverridesRemote = Hinweis: falls sowohl die Datenbank der Einsende-ModeratorInnen als auch die der Fern-AdministratorInnen in einem nicht-Standard-Verzeichnis liegen, dann wird die Einsende-ModeratorInnen-Datenbank für beides verwendet
}

View File

@ -136,14 +136,14 @@ Lang {
Settings {
0 = Make the list a sublist of list mainlist@host
0 = Make the list a sublist of another list
3 = Set a custom "From:" header for outgoing messsages
4 = Define customized setting for digest creation (ezmlm-tstdig)
5 = Define the email address of the list owner
6 = Use a SQL database
7 = Define a custom path to the database for posting moderators
8 = Define a custom path to the database for remote administrators and subscription moderators
# 9 => not used - it is only an alternative to (8)
8 = Define a custom path to the database for subscription moderators
9 = Define a custom path to the database for remote administators
}
@ -188,6 +188,7 @@ Lang {
DefaultFiles = default files
ListLanguage = Language of the list
ListCharset = Charset of the list
ModSubOverridesRemote = Hint: if both the database of subscripton moderators and of remote administrators use customized locations, then the database of subscription moderators will be used for both of them
}

View File

@ -15,9 +15,6 @@ Data.List.DefaultFiles.*
Data.List.File.Name
Data.List.File.Content
Data.List.File.isDefault
Data.List.hasAllowList
Data.List.hasDenyList
Data.List.hasDigestList
Data.List.hasPostMod
Data.List.hasRemoteAdmin
Data.List.hasSubMod

19
spec/release-policy.txt Normal file
View File

@ -0,0 +1,19 @@
1) update version number
* README
* ezmlm-web.cgi
* UPGRADING
* template/footer.cs
2) update changelog
3) create tar.gz
./make-tar.sh X.Y.Z
4) create debian package
scripts/debian
scripts/debian check
5) upload debian package
scp XYZ.deb uml-bastelecke@systemausfall.org:/data/deb-repo/incoming/unstable
6) update website

View File

@ -24,7 +24,7 @@
<li><?cs call:checkbox("n") ?></li>
<!-- custom path to administrators database -->
<li><?cs call:setting("8") ?></li>
<li><?cs call:setting("9") ?><?cs if:(Data.List.Settings.8.state && Data.List.Settings.9.state) ?>(<?cs var:Lang.Misc.ModSubOverridesRemote ?>)<?cs /if ?></li>
</ul></li>
<li><!-- include default form values -->

View File

@ -87,6 +87,9 @@
<!-- custom path to subscription moderators -->
<li><?cs call:setting("8") ?></li>
<!-- custom path to remote administrators -->
<li><?cs call:setting("9") ?>(<?cs var:Lang.Misc.ModSubOverridesRemote ?>)</li>
<!-- subject prefix -->
<li><?cs call:checkbox("f") ?>
<ul><li><input type="text" name="prefix" value="<?cs
@ -155,7 +158,7 @@
</select></li><?cs /if ?>
<!-- charset -->
<?cs if:Data.useCharSet ?>
<?cs if:Data.List.CharSet ?>
<li><label for="list_charset"><?cs var:html_escape(Lang.Misc.ListCharset)
?>:</label>
<input type="text" name="list_charset" id="list_charset" size="30"

View File

@ -26,7 +26,7 @@
</select></li><?cs /if ?>
<!-- charset -->
<?cs if:Data.useCharSet ?>
<?cs if:Data.List.CharSet ?>
<li><label for="list_charset"><?cs var:html_escape(Lang.Misc.ListCharset)
?>:</label>
<input type="text" name="list_charset" id="list_charset" size="30"

View File

@ -27,7 +27,7 @@
<li><?cs call:checkbox("s") ?>
<ul>
<!-- custom path to subscription moderators -->
<li><?cs call:setting("8") ?></li>
<li><?cs call:setting("8") ?><?cs if:(Data.List.Settings.8.state && Data.List.Settings.9.state) ?>(<?cs var:Lang.Misc.ModSubOverridesRemote ?>)<?cs /if ?></li>
</ul></li>
<li><!-- include default form values -->

View File

@ -1,6 +1,6 @@
<div id="footer">
<a href="https://systemausfall.org/toolforge/ezmlm-web">ezmlm-web</a> (v3.0) - <?cs var:html_escape(Lang.Misc.FooterText) ?> <a href="http://www.ezmlm.org/" target="_blank">ezmlm</a>
<a href="https://systemausfall.org/toolforge/ezmlm-web">ezmlm-web</a> (v3.1) - <?cs var:html_escape(Lang.Misc.FooterText) ?> <a href="http://www.ezmlm.org/" target="_blank">ezmlm</a>
<br />
</div>

View File

@ -1,20 +1,20 @@
<!-- posting moderation -->
<?cs if:Data.List.PostModPath ?>
<?cs if:Data.List.hasCustomizedPostModPath ?>
<div class="warning">
<?cs var:html_escape(Lang.Misc.PostModPathWarn) ?> (<?cs var:Data.List.PostModPath ?>).<br/><?cs var:html_escape(Lang.Misc.SuggestDefaultPath) ?>
<?cs var:html_escape(Lang.Misc.PostModPathWarn) ?> (<?cs var:Data.List.Settings.7.value ?>).<br/><?cs var:html_escape(Lang.Misc.SuggestDefaultPath) ?>
</div>
<?cs /if ?>
<!-- subscription moderation -->
<?cs if:Data.List.SubModPath ?>
<?cs if:Data.List.hasCustomizedSubModPath ?>
<div class="warning">
<?cs var:html_escape(Lang.Misc.SubModPathWarn) ?> (<?cs var:Data.List.SubModPath ?>).<br/><?cs var:html_escape(Lang.Misc.SuggestDefaultPath) ?>
<?cs var:html_escape(Lang.Misc.SubModPathWarn) ?> (<?cs var:Data.List.Settings.8.value ?>).<br/><?cs var:html_escape(Lang.Misc.SuggestDefaultPath) ?>
</div>
<?cs /if ?>
<!-- remote administration -->
<?cs if:Data.List.RemoteAdminPath ?>
<?cs if:Data.List.hasCustomizedAdminPath ?>
<div class="warning">
<?cs var:html_escape(Lang.Misc.RemoteAdminPathWarn) ?> (<?cs var:Data.List.RemoteAdminPath ?>).<br/><?cs var:html_escape(Lang.Misc.SuggestDefaultPath) ?>
<?cs var:html_escape(Lang.Misc.RemoteAdminPathWarn) ?> (<?cs var:Data.List.Settings.9.value ?>).<br/><?cs var:html_escape(Lang.Misc.SuggestDefaultPath) ?>
</div>
<?cs /if ?>

View File

@ -42,8 +42,19 @@
<?cs elif:(Data.List.PartType == "deny") ?>
<li><?cs call:checkbox("k") ?></li>
<?cs elif:(Data.List.PartType == "mod") ?>
<li><?cs call:setting("7") ?></li>
<li><?cs call:setting("8") ?></li>
<li><?cs call:checkbox("m") ?>
<?cs if:Data.List.Options.m ?>
<ul><li><?cs call:setting("7") ?></li></ul><?cs /if ?>
</li>
<li><?cs call:checkbox("s") ?>
<?cs if:Data.List.Options.s ?>
<ul><li><?cs call:setting("8") ?></li></ul><?cs /if ?>
</li>
<li><?cs call:checkbox("r") ?>
<?cs if:Data.List.Options.r ?>
<ul><li><?cs call:setting("9") ?>
<?cs var:Lang.Misc.ModSubOverridesRemote ?></li></ul><?cs /if ?>
</li>
<?cs /if ?>
<li><!-- include default form values -->