diff --git a/TODO b/TODO index be8a54d..84559dd 100644 --- a/TODO +++ b/TODO @@ -9,9 +9,3 @@ add "only for plain text mails" to the TrailerText string check version history of Mail::Ezmlm -sort languages in selection - -define default interface in example/ezmlmwebrc? - -check ui_mode, ui_template in source - diff --git a/changelog b/changelog index dd40f0b..a5f0ad8 100644 --- a/changelog +++ b/changelog @@ -2,7 +2,7 @@ Version 3.2 - 08/07/02007 * support for multi-domain setups (multiple list directories) * detect preferred interface language * user-specific interface language selection - * user-specific interface types (easy/default/expert) + * user-specific interface types (easy/normal/expert) * simplified rules for subscribing, posting and archive access * support for listing of subscription log * support for downloading the subscribers list as a text file diff --git a/examples/ezmlmwebrc.dist b/examples/ezmlmwebrc.dist index 8b61307..889243c 100644 --- a/examples/ezmlmwebrc.dist +++ b/examples/ezmlmwebrc.dist @@ -78,6 +78,10 @@ $FILE_UPLOAD = 1; # disabled). The defaults below should be reasonable - I use them ;) $DEFAULT_OPTIONS = "aBDFGHiJkLMNOpQRSTUWx"; +# Which interface type should be displayed by default? +# available values are: easy, normal and expert +#$DEFAULT_INTERFACE_TYPE = "normal"; + # What is the title of this document? $HTML_TITLE = "ezmlm-web - a mailinglist administration interface"; diff --git a/ezmlm-web.cgi b/ezmlm-web.cgi index 0564b3c..2a55942 100755 --- a/ezmlm-web.cgi +++ b/ezmlm-web.cgi @@ -93,6 +93,8 @@ use vars qw[$FILE_UPLOAD $WEBUSERS_FILE $MAIL_DOMAIN $HTML_TITLE]; use vars qw[$TEMPLATE_DIR $LANGUAGE_DIR $HTML_LANGUAGE]; use vars qw[$HTML_CSS_COMMON $HTML_CSS_COLOR]; use vars qw[$MAIL_ADDRESS_PREFIX @HTML_LINKS]; +# default interface template (basic/normal/expert) +use vars qw[$DEFAULT_INTERFACE_TYPE]; # some settings for encrypted mailing lists use vars qw[$GPG_SUPPORT]; # settings for multi-domain setups @@ -109,7 +111,7 @@ use vars qw[$HTML_CSS_FILE]; # replaced by HTML_CSS_COMMON since v3.2 # "pagename" refers to the template file that should be used # "ui_template" is one of "basic", "normal" and "expert" use vars qw[$pagedata $pagename $error $customError $warning $customWarning $success]; -use vars qw[$ui_set $ui_template]; +use vars qw[$ui_template]; # Get user configuration stuff my $config_file; @@ -217,6 +219,9 @@ $HTML_TITLE = '' unless defined($HTML_TITLE); # check HTML_LINKS @HTML_LINKS = () unless defined(@HTML_LINKS); +# check DEFAULT_INTERFACE_TYPE +$DEFAULT_INTERFACE_TYPE = 'norma' unless defined($DEFAULT_INTERFACE_TYPE); + # determine MAIL_DOMAIN unless (defined($MAIL_DOMAIN) && ($MAIL_DOMAIN ne '')) { if ((-e "$QMAIL_BASE/virtualdomains") && open(VD, "<$QMAIL_BASE/virtualdomains")) { @@ -567,7 +572,7 @@ sub init_hdf { if ($q->param('template') eq $one_template); } } - $ui_template = 'normal' unless defined($ui_template); + $ui_template = $DEFAULT_INTERFACE_TYPE unless defined($ui_template); $hdf->setValue("Config.UI.LinkAttrs.template", $ui_template); @@ -582,7 +587,7 @@ sub init_hdf { # retrieve available languages and add them to the dataset my %languages = &get_available_interface_languages(); my $lang; - foreach $lang (keys %languages) { + foreach $lang (sort keys %languages) { $hdf->setValue("Config.UI.Languages.$lang", $languages{$lang}); } @@ -807,8 +812,6 @@ sub set_pagedata { # multi domain support? &set_pagedata_domains() if (%DOMAINS); - $pagedata->setValue("Data.LocalPrefix", $MAIL_ADDRESS_PREFIX); - $pagedata->setValue("Data.LocalPrefix", $MAIL_ADDRESS_PREFIX); $pagedata->setValue("Data.HostName", $MAIL_DOMAIN); @@ -1113,6 +1116,10 @@ sub set_pagedata4options { for ($i=0; $i<=9; $i++) { unless (($i eq 1) || ($i eq 2)) { $state = ($options =~ /\s-$i (?:'(.+?)')/); + # store the retrieved value (if possible) + $value = $1; + # reset "state" if the owner address starts with '/' + $state = (0==1) if (($i eq 5) && ($state) && ($value =~ m/^\//)); unless ($state) { # set default values if ($i eq 0) { @@ -1132,9 +1139,6 @@ sub set_pagedata4options { $value = "mod"; } } - } else { - # use the configured value (extracted by the pattern matching for 'state') - $value = $1; } $pagedata->setValue("Data.List.Settings." . $i . ".value", $value); $pagedata->setValue("Data.List.Settings." . $i . ".state", $state ? 1 : 0); diff --git a/man/ezmlmwebrc.5 b/man/ezmlmwebrc.5 index 024105a..baa9696 100644 --- a/man/ezmlmwebrc.5 +++ b/man/ezmlmwebrc.5 @@ -105,6 +105,9 @@ empty. Specify the defaut language of the web interface. This value will be overriden when the browser requests an available language or when the user explicitly selects a different language. The default value is \fIen\fR. +.IP \fB$DEFAULT_INTERFACE_TYPE\fR +Set the default interface template. Available values are \fIeasy\fR, +\fInormal\fR and \fIexpert\fR. The default value is \fInormal\fR. .IP \fB$GPG_SUPPORT\fR Enable support for encrypted mailing lists. Currently this feature is still considered as beta quality. User reports are warmly welcome!