💥 Add whitelist module

This commit is contained in:
Yohann D'anello 2020-07-13 15:51:33 +02:00
parent 5c2230b77d
commit c12741d67f
9 changed files with 1572 additions and 0 deletions

View File

@ -69,6 +69,12 @@ RUN touch /etc/sympa/transport.sympa \
RUN postmap hash:/etc/sympa/transport.sympa && \
postmap hash:/etc/sympa/virtual.sympa
COPY whitelist-1.1/custom_actions /etc/sympa
COPY whitelist-1.1/scenari /etc/sympa
COPY whitelist-1.1/web_tt2 /etc/sympa
RUN touch /etc/sympa/search_filters/whitelist.txt /etc/sympa/search_filters/modlist.txt
RUN chown -R sympa:sympa /etc/sympa
EXPOSE 25 80 465
VOLUME /var/lib/sympa \

View File

@ -0,0 +1,90 @@
#============================================================= -*-Perl-*-
#
# DESCRIPTION
# Sympa 6.2 plugin for whitelist management
#
# AUTHOR
# Steve Shipway
# University of Auckland, New Zealand
# September 2015
#
#============================================================================
# v0.1 - initial release for Sympa 6.1
# v0.2 - cope with situation where no robot subdir is used
# v1.0 - Sympa 6.2 conversion
# v1.1 - Strange processing of multiple @cap entries
package modlist_plugin;
#use Sympa::Constants;
use strict;
our $VERSION = 1.01;
our $FILENAME = "modlist";
sub process {
my( $listref ) = shift; # reference to list object
my( $action ); # sub-action for this lca
my( %stash ) = (); # variables to pass back to TT2 template
my($rv) = "";
my($sfdir)='';
my(@data) = (); # file content as array
my($data) = ''; # file content as single string
$action = shift; # extract plugin action
$data = join '/',@_; # rejoin all parameters
$data =~ s/\x00//g; # remove nulls caused by multiple @cap parameters
# Must run in list context
return 'home' if(!ref $listref);
# All use same TT2
$stash{x_name} = $FILENAME;
$stash{x_ucfname} = ucfirst $FILENAME;
$stash{next_action} = "lca:whitelist";
$stash{x_saved}=0;
# Identify the search_filters directory.
$sfdir = $listref->{'dir'}."/search_filters";
$stash{sfdir}=$sfdir;
if( ! -d $sfdir ) { mkdir $sfdir; }
if( ! -d $sfdir ) {
$stash{x_saveerror}="Unable to make list search_filters directory";
return \%stash;
}
# IF IN SAVE CONTEXT then save the new content
if( $action eq 'save' ) {
$data =~ s/\s*[\r\n]\s+/\n/g; # kill blank lines
if( open MYFILE,(">${sfdir}/${FILENAME}.txt" )) {
print MYFILE $data;
close MYFILE;
$stash{x_saved}=1;
} else {
$rv = "Unable to save: $!";
$stash{x_saveerror}=$rv;
}
$stash{x_data}=$data;
my @rows = split /\n/,$data;
$stash{x_rows}=($#rows + 1);
return \%stash;
}
# Load the content
if( -r "${sfdir}/${FILENAME}.txt") {
open MYFILE,"<${sfdir}/${FILENAME}.txt";
@data = <MYFILE>;
close MYFILE;
} else {
push @data, "# No $FILENAME found\n";
push @data, "# list your email address patterns here\n";
}
$data = join "",@data;
$stash{x_data}=$data;
$stash{x_rows}=($#data + 1);
return \%stash;
}
1;

View File

@ -0,0 +1,90 @@
#============================================================= -*-Perl-*-
#
# DESCRIPTION
# Sympa 6.2 plugin for whitelist management
#
# AUTHOR
# Steve Shipway
# University of Auckland, New Zealand
# September 2015
#
#============================================================================
# v0.1 - initial release for Sympa 6.1
# v0.2 - cope with situation where no robot subdir is used
# v1.0 - Sympa 6.2 conversion
# v1.1 - Strange processing of multiple @cap entries
package whitelist_plugin;
#use Sympa::Constants;
use strict;
our $VERSION = 1.01;
our $FILENAME = "whitelist";
sub process {
my( $listref ) = shift; # reference to list object
my( $action ); # sub-action for this lca
my( %stash ) = (); # variables to pass back to TT2 template
my($rv) = "";
my($sfdir)='';
my(@data) = (); # file content as array
my($data) = ''; # file content as single string
$action = shift; # extract plugin action
$data = join '/',@_; # rejoin all parameters
$data =~ s/\x00//g; # remove nulls caused by multiple @cap parameters
# Must run in list context
return 'home' if(!ref $listref);
# All use same TT2
$stash{x_name} = $FILENAME;
$stash{x_ucfname} = ucfirst $FILENAME;
$stash{next_action} = "lca:whitelist";
$stash{x_saved}=0;
# Identify the search_filters directory.
$sfdir = $listref->{'dir'}."/search_filters";
$stash{sfdir}=$sfdir;
if( ! -d $sfdir ) { mkdir $sfdir; }
if( ! -d $sfdir ) {
$stash{x_saveerror}="Unable to make list search_filters directory";
return \%stash;
}
# IF IN SAVE CONTEXT then save the new content
if( $action eq 'save' ) {
$data =~ s/\s*[\r\n]\s+/\n/g; # kill blank lines
if( open MYFILE,(">${sfdir}/${FILENAME}.txt" )) {
print MYFILE $data;
close MYFILE;
$stash{x_saved}=1;
} else {
$rv = "Unable to save: $!";
$stash{x_saveerror}=$rv;
}
$stash{x_data}=$data;
my @rows = split /\n/,$data;
$stash{x_rows}=($#rows + 1);
return \%stash;
}
# Load the content
if( -r "${sfdir}/${FILENAME}.txt") {
open MYFILE,"<${sfdir}/${FILENAME}.txt";
@data = <MYFILE>;
close MYFILE;
} else {
push @data, "# No $FILENAME found\n";
push @data, "# list your email address patterns here\n";
}
$data = join "",@data;
$stash{x_data}=$data;
$stash{x_rows}=($#data + 1);
return \%stash;
}
1;

View File

@ -0,0 +1,8 @@
title.gettext Process whitelist and modlist, if they exist
# Copy/rename this scenario to be include.send.header to make white/mod lists
# work for every list regardless of the chosen scenario
search(modlist.txt) smtp,smime -> editorkey,quiet
search(whitelist.txt) smtp,smime -> do_it

View File

@ -0,0 +1,89 @@
<!-- admin.tt2 -->
<h2>[%|loc%]Casual administration[%END%]</h2>
<ul>
[% IF is_listmaster || is_owner %]
<li><strong><a href="[% 'edit_list_request' | url_rel([list]) %]">[%|loc%]Edit List Config:[%END%]</a></strong> [%|loc%]It must be used with care. It allows you to modify some of the list parameters. The list of parameters you can modify depends on your privilege.[%END%]</li>
[% END %]
[% IF is_listmaster || is_owner || may_del %]
<li><strong><a href="[% 'review' | url_rel([list]) %]">[%|loc%]Manage Subscribers:[%END%]</a></strong> [%|loc%]Allows you to add or delete list members, moderate subscriptions, and so on.[%END%]</li>
[% IF conf.use_blacklist != 'none' %]
<li><strong><a href="[% 'blacklist' | url_rel([list]) %]" >[%|loc%]Blacklist:[%END%]</a></strong> [%|loc%]Handles the set of black-listed mail addresses for this list.[%END%]</li>
[% END %]
<li><strong><a href="[% path_cgi %]/lca/modlist/[% list %]" >[%|loc%]Liste modérée :[%END%]</a></strong> [%|loc%]Permet de consulter et modifier les adresses devant être modérées pour cette liste.[%END%]</li>
<li><strong><a href="[% path_cgi %]/lca/whitelist/[% list %]" >[%|loc%]Liste blanche :[%END%]</a></strong> [%|loc%]Permet de consulter et modifier les adresses en liste noire pour cette liste.[%END%]</li>
[% END %]
[% IF is_listmaster || is_owner %]
[% IF is_archived %]
<li><strong><a href="[% 'arc_manage' | url_rel([list]) %]">[%|loc%]Manage archives:[%END%]</a></strong> [%|loc%]Allows you to download and delete list archives.[%END%]</li>
[% END %]
[% IF is_listmaster || is_owner || ( is_editor && may_review ) %]
<li><strong><a href="[% 'reviewbouncing' | url_rel([list]) %]">[%|loc%]Bounces:[%END%]</a></strong> [%|loc%]Manage non-delivery reports (also called bounces).[%END%]</li>
[% END %]
[% IF is_priv || is_listmaster %]
<li><strong><a href="[% 'viewlogs' | url_rel([list]) %]">[%|loc%]Logs:[%END%]</a></strong> [%|loc%]A tool for exploring the list logs.[%END%]</li>
[% END %]
[% END %]
</ul>
[% IF is_listmaster || is_owner || is_privileged_owner %]
<h2>[%|loc%]Drastic operations[%END%]</h2>
[% IF is_privileged_owner %]
[% IF list_conf.status == 'closed' ~%]
<form name="manage_list_status" action="[% path_cgi %]" method="post">
<div>
<input class="MainMenuLinks" type="submit" name="action_open_list"
value="[%|loc%]Restore List[%END%]" />
[%|loc%]This list is currently closed. Clicking this button will make it active again.[%END%]
<input type="hidden" name="previous_action" value="[% action %]"/>
<input type="hidden" name="list" value="[% list %]"/>
</div>
</form>
[%~ ELSIF is_included ~%]
<p>[%|loc%]Closing or renaming this list is impossible, because it is included by other mailing list(s).[%END%]
<br /><a class="button" href="[% 'including_lists' | url_rel([list]) %]">
[%|loc(list)%]View lists including %1[%END%]
</a></p>
[%~ ELSE ~%]
<form name="manage_list_status" action="[% path_cgi %]" method="post">
<div>
<input class="MainMenuLinks" type="submit" name="action_close_list"
value="[%|loc%]Remove List[%END%]" />
[%|loc%]Completely removes the current list. Listmaster privileges are required to restore a list once it has been removed.[%END%]
<input type="hidden" name="list" value="[% list %]"/>
</div>
</form>
[%~ END %]
[% IF may_create_list && ! is_included ~%]
<form name="manage_list_name" action="[% path_cgi %]" method="post">
<fieldset>
<input class="MainMenuLinks" type="submit" name="action_rename_list_request" value="[%|loc%]Rename List[%END%]"/> [%|loc%]Allows you to change this list's name. Everything related to the list will be renamed, including the mail aliases and the web archives.[%END%]
<input type="hidden" name="list" value="[% list %]"/>
</fieldset>
</form>
[%~ END ~%]
[% END %]
[% IF is_listmaster || is_owner %]
<form name="manage_shared_status" action="[% path_cgi %]" method="post">
<div>
[% IF shared == 'none' %]
<input class="MainMenuLinks" type="submit" name="action_d_admin" value="[%|loc%]Create Shared[%END%]"/> [%|loc%]Initializes the shared document web space.[%END%]
<input type="hidden" name="list" value="[% list %]"/>
<input type="hidden" name="d_admin" value="create"/>
[% ELSIF shared == 'exist' %]
<input class="MainMenuLinks" type="submit" name="action_d_admin"
value="[%|loc%]Delete Shared[%END%]" />
[%|loc%]Closes the shared document web space. It can be restored using "Restore shared" button.[%END%]</li>
<input type="hidden" name="list" value="[% list %]"/>
<input type="hidden" name="d_admin" value="delete"/>
[% ELSIF shared == 'deleted' %]
<input class="MainMenuLinks" type="submit" name="action_d_admin" value="[%|loc%]Restore Shared[%END%]"/> [%|loc%]Restores the previously closed shared document web space.[%END%]</li>
<input type="hidden" name="list" value="[% list %]"/>
<input type="hidden" name="d_admin" value="restore"/>
[% END %]
</div>
</form>
[% END %]
[% END %]
<!-- end admin.tt2 -->

View File

@ -0,0 +1,324 @@
<!-- nav.tt2 -->
[% IF action == 'create_list_request' %]
[% IF all_lists.size > 0 ~%]
<h2 class="show-for-medium">
<i class="fa fa-plus"></i> [%|loc%]Create list[%END%]
<a class="openInNewWindow"
href="[% 'nomenu/help' | url_rel(['admin-createlist.html']) %]" target="wws_help">
<i class="fa fa-info-circle" title="[%|loc%]Help[%END%]"
aria-hidden="true"></i>
</a>
</h2>
<div class="title-bar"
data-responsive-toggle="sympa-nav-bar" data-hide-for="medium">
<span class="menu-text" aria-hidden="true">
<i class="fa fa-plus"></i>
</span>
<div class="title-bar-right">
<div class="title-bar-title">
<span>[%|loc%]Create list[%END%]</span>
</div>
<a class="menu-icon" href="#" data-toggle="sympa-nav-bar"></a>
</div>
</div>
<nav class="top-bar" id="sympa-nav-bar">
<menu class="top-bar-left">
<ul class="vertical medium-horizontal menu"
data-responsive-menu="drilldown medium-dropdown">
<li><a href="#list_create">[%|loc%]Create a list using a template[%END%]</a></li>
[% IF 0 %]<li class="divider" role="separator"></li>[% END %]
<li><a href="#list_copy">[%|loc%]Copy an existing list[%END%]</a></li>
</ul>
</menu>
</nav>
[%~ END %]
[% END %]
[% IF action == 'serveradmin' or action == 'skinsedit' or action == 'edit_config' or action == 'get_pending_lists' or action == 'get_closed_lists' or action == 'get_latest_lists' or action == 'get_inactive_lists' %]
<h2 class="show-for-medium">
<i class="fa fa-wrench"></i> [%|loc%]Listmaster Admin[%END%]
</h2>
<div class="title-bar"
data-responsive-toggle="sympa-nav-bar" data-hide-for="medium">
<span class="menu-text" aria-hidden="true">
<i class="fa fa-wrench"></i>
</span>
<div class="title-bar-right">
<div class="title-bar-title">
<span>[%|loc%]Listmaster Admin[%END%]</span>
</div>
<a class="menu-icon" href="#" data-toggle="sympa-nav-bar"></a>
</div>
</div>
<nav class="top-bar" id="sympa-nav-bar">
<menu class="top-bar-left">
<ul class="vertical medium-horizontal menu"
data-responsive-menu="drilldown medium-dropdown">
[% IF (subaction == '' or subaction == 'm_lists') and action != 'skinsedit' %][% SET class = 'active' %][% ELSE %][% SET class = '' %][% END %]
<li class="[% class %]"><a href="[% 'serveradmin/m_lists' | url_rel %]">[%|loc%]Lists[%END%]</a>
<ul class="vertical menu">
<li><a href="[% 'get_pending_lists' | url_rel %]">[%|loc%]View Pending (Requested) lists[%END%]</a></li>
<li><a href="[% 'get_closed_lists' | url_rel %]">[%|loc%]View Closed Lists[%END%]</a></li>
<li><a href="[% 'get_latest_lists' | url_rel %]">[%|loc%]View Lists sorted by Creation Date[%END%]</a></li>
<li><a href="[% 'get_inactive_lists' | url_rel %]">[%|loc%]View Lists sorted by Last Message Date[%END%]</a></li>
</ul>
</li>
[% IF subaction == 'users' %][% SET class = 'active' %][% ELSE %][% SET class = '' %][% END %]
<li class="[% class %]"><a href="[% 'serveradmin/users' | url_rel %]">[%|loc%]Users[%END%]</a></li>
[% IF subaction == 'archives' %][% SET class = 'active' %][% ELSE %][% SET class = '' %][% END %]
<li class="[% class %]"><a href="[% 'serveradmin/archives' | url_rel %]">[%|loc%]Archives[%END%]</a></li>
[% IF subaction == 'logs' %][% SET class = 'active' %][% ELSE %][% SET class = '' %][% END %]
<li class="[% class %]"><a href="[% 'serveradmin/logs' | url_rel %]">[%|loc%]System log[%END%]</a></li>
[% IF subaction == 'templates' %][% SET class = 'active' %][% ELSE %][% SET class = '' %][% END %]
<li class="[% class %]"><a href="[% 'serveradmin/templates' | url_rel %]">[%|loc%]Templates[%END%]</a></li>
[% IF action == 'skinsedit' %][% SET class = 'active' %][% ELSE %][% SET class = '' %][% END %]
<li class="[% class %]"><a href="[% 'skinsedit' | url_rel %]">[%|loc%]Skins, CSS and colors[%END%]</a></li>
[% IF main_robot && robots ~%]
[% IF subaction == 'vhosts' %][% SET class = 'active' %][% ELSE %][% SET class = '' %][% END %]
<li class="[% class %]"><a href="[% 'serveradmin/vhosts' | url_rel %]">[%|loc%]Virtual Robots[%END%]</a></li>
[%~ END %]
[% IF main_robot ~%]
[% IF action == 'edit_config' %][% SET class = 'active' %][% ELSE %][% SET class = '' %][% END %]
<li class="[% class %]"><a href="[% 'edit_config' | url_rel %]">[%|loc%]Edit Robot Config[%END%]</a></li>
[%~ END %]
[% IF families -%]
[% IF subaction == 'families' %][% SET class = 'active' %][% ELSE %][% SET class = '' %][% END %]
<li class="[% class %]"><a href="[% 'serveradmin/families' | url_rel %]">[%|loc%]Families[%END%]</a></li>
[% END %]
[% IF subaction == 'translation' %][% SET class = 'active' %][% ELSE %][% SET class = '' %][% END %]
<li class="[% class %]"><a href="[% 'serveradmin/translation' | url_rel %]">[%|loc%]Translating Sympa[%END%]</a></li>
[% IF subaction == 'tracker' %][% SET class = 'active' %][% ELSE %][% SET class = '' %][% END %]
<li class="[% class %]"><a href="[% 'serveradmin/tracker' | url_rel %]">[%|loc%]Submitting a bug, a feature request[%END%]</a></li>
</ul>
</menu>
</nav>
[% END %]
[% IF action == 'lists' %]
<h2 class="show-for-medium">
<i class="fa fa-list"></i> [%|loc%]Index of lists[%END%]
</h2>
[% letters = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','others' ] ~%]
<div class="title-bar"
data-responsive-toggle="sympa-nav-bar" data-hide-for="medium">
<span class="menu-text" aria-hidden="true">
<i class="fa fa-list"></i>
</span>
<div class="title-bar-right">
<div class="title-bar-title">
<span>[%|loc%]Index of lists[%END%]</span>
</div>
<a class="menu-icon" href="#" data-toggle="sympa-nav-bar"></a>
</div>
</div>
<nav class="top-bar" id="sympa-nav-bar">
<menu class="top-bar-left">
<ul class="vertical medium-horizontal menu"
data-responsive-menu="drilldown medium-dropdown">
[% FOREACH letter IN letters %]
[% IF orderedlist.$letter.0 %]
<li class="letter"><a href="#[%letter%]">[%IF letter == 'others'%][%|loc%]others[%END%][%ELSE%][%letter%][%END%]</a></li>
[% ELSE %]
<li class="nolink letter">[%IF letter == 'others'%][%|loc%]others[%END%][%ELSE%][%letter%][%END%]</li>
[% END %]
[% END %]
<li class="letter">
[% topic_paths = [];
IF topic;
topic_paths.push(topic);
IF subtopic; topic_paths.push(subtopic); END;
END;
~%]
<a class="heavyWork" href="[% 'lists' | url_rel(topic_paths) %]">[%|loc%]All[%END%]</a> </li>
</ul>
</menu>
</nav>
[% END %]
[% IF action == 'admin' || action_type == 'admin' || action == 'editfile' ~%]
<h2 class="show-for-medium">[%|loc%]Basic Operations[%END%]</h2>
<div class="title-bar"
data-responsive-toggle="sympa-nav-bar" data-hide-for="medium">
<div class="title-bar-right">
<div class="title-bar-title">
<span>[%|loc%]Basic Operations[%END%]</span>
</div>
<a class="menu-icon" href="#" data-toggle="sympa-nav-bar"></a>
</div>
</div>
[% IF action == 'edit_list_request' || action == 'editfile' %][% SET class = 'active' %][% ELSE %][% SET class = '' %][% END %]
<nav class="top-bar" id="sympa-nav-bar">
<menu class="top-bar-left">
<ul class="vertical medium-horizontal menu"
data-responsive-menu="drilldown medium-dropdown">
<li class="[% class %]"><a href="[% 'edit_list_request' | url_rel([list,'description']) %]">[%|loc%]Edit List Config[%END%]</a>
<ul class="vertical menu">
[% IF group == 'description' %][% SET class = 'active' %][% ELSE %][% SET class = '' %][% END %]
<li class="[% class %]"><a href="[% 'edit_list_request' | url_rel([list,'description']) %]" >[%|loc%]List definition[%END%]</a></li>
[% IF group == 'sending' %][% SET class = 'active' %][% ELSE %][% SET class = '' %][% END %]
<li class="[% class %]"><a href="[% 'edit_list_request' | url_rel([list,'sending']) %]" >[%|loc%]Sending/receiving setup[%END%]</a></li>
[% IF group == 'command' %][% SET class = 'active' %][% ELSE %][% SET class = '' %][% END %]
<li class="[% class %]"><a href="[% 'edit_list_request' | url_rel([list,'command']) %]" >[%|loc%]Privileges[%END%]</a></li>
[% IF group == 'archives' %][% SET class = 'active' %][% ELSE %][% SET class = '' %][% END %]
<li class="[% class %]"><a href="[% 'edit_list_request' | url_rel([list,'archives']) %]" >[%|loc%]Archives[%END%]</a></li>
[% IF group == 'bounces' %][% SET class = 'active' %][% ELSE %][% SET class = '' %][% END %]
<li class="[% class %]"><a href="[% 'edit_list_request' | url_rel([list,'bounces']) %]" >[%|loc%]Bounces[%END%]</a></li>
[% IF group == 'data_source' %][% SET class = 'active' %][% ELSE %][% SET class = '' %][% END %]
<li class="[% class %]"><a href="[% 'edit_list_request' | url_rel([list,'data_source']) %]" >[%|loc%]Data sources setup[%END%]</a></li>
[% IF group == 'dkim' %][% SET class = 'active' %][% ELSE %][% SET class = '' %][% END %]
<li class="[% class %]"><a href="[% 'edit_list_request' | url_rel([list,'dkim']) %]"
>[%|loc%]DKIM/DMARC/ARC[%END%]</a></li>
[% IF action == 'editfile' && selected_file == 'description_templates' %][% SET class = 'active' %][% ELSE %][% SET class = '' %][% END %]
<li class="[% class %]"><a href="[% 'editfile' | url_rel([list,'description_templates']) %]">[%|loc%]List description/homepage[%END%]</a></li>
[% IF action == 'editfile' && selected_file == 'message_templates' %][% SET class = 'active' %][% ELSE %][% SET class = '' %][% END %]
<li class="[% class %]"><a href="[% 'editfile' | url_rel([list,'message_templates']) %]">[%|loc%]Message templates[%END%]</a></li>
[% IF group == 'other' %][% SET class = 'active' %][% ELSE %][% SET class = '' %][% END %]
<li class="[% class %]"><a href="[% 'edit_list_request' | url_rel([list,'other']) %]" >[%|loc%]Miscellaneous[%END%]</a></li>
</ul>
</li>
[% IF is_owner ~%]
[% IF action == 'review' %][% SET class = 'active' %][% ELSE %][% SET class = '' %][%END%]
<li class="[% class %]">
<a href="#">
[%|loc%]Users[%END%]
</a>
<ul class="vertical menu">
<li [% IF page.match('^\d+$') %]class="active"[%END%]>
<a href="[% 'review' | url_rel([list]) %]" >
[%|loc%]Subscribers[%END%]
</a>
</li>
<li [% IF page == 'owner' %]class="active"[%END%]>
<a href="[% 'review' | url_rel([list,'owner']) %]" >
[%|loc%]Owners[%END%]
</a>
</li>
<li [% IF page == 'editor' %]class="active"[%END%]>
<a href="[% 'review' | url_rel([list,'editor']) %]" >
[%|loc%]Moderators[%END%]
</a>
</li>
</ul>
</li>
[%~ END %]
<li class="[% class %]">
<a href="#">
[%|loc%]Lists[%END%]
</a>
<ul class="vertical menu">
[% IF conf.use_blacklist != 'none' %]
[% IF action == 'blacklist' %][% SET class = 'active' %][% ELSE %][% SET class = '' %][% END %]
<li class="[% class %]"><a href="[% 'blacklist' | url_rel([list]) %]" >[%|loc%]Blacklist[%END%]</a></li>
[% END %]
<li class="[% class %]"><a href="[% path_cgi %]/lca/modlist/[% list %]" >[%|loc%]Liste modérée[%END%]</a></li>
<li class="[% class %]"><a href="[% path_cgi %]/lca/whitelist/[% list %]" >[%|loc%]Liste blanche[%END%]</a></li>
</ul>
</li>
[% IF is_archived %]
[% IF action == 'arc_manage' %][% SET class = 'active' %][% ELSE %][% SET class = '' %][% END %]
<li class="[% class %]"><a href="[% 'arc_manage' | url_rel([list]) %]">[%|loc%]Manage Archives[%END%]</a></li>
[% END %]
[% IF is_owner %]
[% IF action == 'reviewbouncing' %][% SET class = 'active' %][% ELSE %][% SET class = '' %][% END %]
<li class="[% class %]"><a href="[% 'reviewbouncing' | url_rel([list]) %]">[%|loc%]Bounces[%END%]</a></li>
[% END %]
[% IF is_priv || is_listmaster %]
[% IF action == 'viewlogs' %][% SET class = 'active' %][% ELSE %][% SET class = '' %][% END %]
<li class="[% class %]"><a href="[% 'viewlogs' | url_rel([list]) %]" >[%|loc%]Logs[%END%]</a></li>
[% END %]
</ul>
</menu>
</nav>
[% END %]
[% IF action == 'compose_mail' %]
<h2 class="show-for-medium">
[% IF subaction == "html_news_letter" ~%]
[%|loc%]Sending an HTML page to the list[%END%]
[%~ ELSE ~%]
[%|loc%]Sending a message to the list[%END%]
[%~ END %]
<a class="openInNewWindow"
href="[% 'nomenu/help' | url_rel(['user-sendmsg.html']) %]" target="wws_help">
<i class="fa fa-info-circle" title="[%|loc%]Help[%END%]"
aria-hidden="true"></i>
</a>
</h2>
<div class="title-bar"
data-responsive-toggle="sympa-nav-bar" data-hide-for="medium">
<div class="title-bar-right">
<div class="title-bar-title">
<span>
[% IF subaction == "html_news_letter" ~%]
[%|loc%]Sending an HTML page to the list[%END%]
[%~ ELSE ~%]
[%|loc%]Sending a message to the list[%END%]
[%~ END %]
</span>
</div>
<a class="menu-icon" href="#" data-toggle="sympa-nav-bar"></a>
</div>
</div>
[% IF subaction == '' %][% SET class = 'active' %][% ELSE %][% SET class = '' %][% END %]
<nav class="top-bar" id="sympa-nav-bar">
<menu class="top-bar-left">
<ul class="vertical medium-horizontal menu"
data-responsive-menu="drilldown medium-dropdown">
<li class="[% class %]"><a href="[% 'compose_mail' | url_rel([list]) %]">[%|loc%]Send a message[%END%]</a></li>
[% IF subaction == 'html_news_letter' %][% SET class = 'active' %][% ELSE %][% SET class = '' %][% END %]
<li class="[% class %]"><a href="[% 'compose_mail' | url_rel([list,'html_news_letter']) %]">[%|loc%]Send an html page[%END%]</a></li>
</ul>
</menu>
</nav>
[% END %]
[% IF action == 'd_read' ~%]
<h2 class="show-for-medium">
[%|loc%]Shared documents[%END%]
<a class="openInNewWindow"
href="[% 'nomenu/help' | url_rel(['shared.html']) %]" target="wws_help">
<i class="fa fa-info-circle" title="[%|loc%]Help[%END%]"
aria-hidden="true"></i>
</a>
</h2>
<div class="title-bar"
data-responsive-toggle="sympa-nav-bar" data-hide-for="medium">
<div class="title-bar-right">
<div class="title-bar-title">
<span>[%|loc%]Shared documents[%END%]</span>
</div>
<a class="menu-icon" href="#" data-toggle="sympa-nav-bar"></a>
</div>
</div>
<nav class="top-bar" id="sympa-nav-bar">
<menu class="top-bar-left">
<ul class="vertical medium-horizontal menu"
data-responsive-menu="drilldown medium-dropdown">
<li class="[% UNLESS expert_page %]active not-click[%END%]">
<a href="[% 'd_read' | url_rel([list,shared_doc.paths_d],{type=>'directory',previous_action=>'d_read',show_user_page=>'1'}) %]">
<i class="fa fa-user "></i> [%|loc%]User mode[%END%]</a> </li>
[%IF 0%]<li class="divider" role="separator"></li>[%END%]
<li class="[% IF expert_page %]active not-click[%END%]">
<a href="[% 'd_read' | url_rel([list,shared_doc.paths_d],{type=>'directory',previous_action=>'d_read',show_expert_page=>'1'}) %]">
<i class="fa fa-cogs"></i> [%|loc%]Expert mode[%END%]</a> </li>
</ul>
</menu>
</nav>
[%~ END %]
<!-- end nav.tt2 -->

View File

@ -0,0 +1,445 @@
<!-- review.tt2 -->
[% IF !page || page.match('^\d*$') ~%]
[% PROCESS ReviewMembers ~%]
[%~ ELSIF page == 'owner' ~%]
[% PROCESS ReviewUsers
role = page
users = owners %]
[%~ ELSIF page == 'editor' ~%]
[% PROCESS ReviewUsers
role = page
users = editors %]
[%~ END %]
[%~ BLOCK ReviewMembers # (members) ~%]
[% IF is_owner %]
<h2>[%|loc%]Manage list members[%END%]
<a class="openInNewWindow"
href="[% 'nomenu/help' | url_rel(['admin-members.html']) %]" target="wws_help">
<i class="fa fa-info-circle" title="[%|loc%]Help[%END%]"
aria-hidden="true"></i>
</a>
</h2>
<h3>[%|loc%]Administrative Options[%END%]</h3>
<a class="actionMenuLinks" href="[% 'subindex' | url_rel([list]) %]">[%|loc%]Pending subscriptions[%END%]</a>
<a class="actionMenuLinks" href="[% 'sigindex' | url_rel([list]) %]">[%|loc%]Pending unsubscriptions[%END%]</a>
[% IF conf.use_blacklist != 'none' %]
<a class="actionMenuLinks" href="[% 'blacklist' | url_rel([list]) %]">[%|loc%]Blacklist[%END%]</a>
[% END %]
<a class="actionMenuLinks" href="[% 'reviewbouncing' | url_rel([list]) %]">[%|loc%]Bounces[%END%]</a>
[% IF action == 'search' %]
<a class="actionMenuLinks" href="[% 'export_member' | url_rel([list],{filter=>filter}) %]">[%|loc%]Dump[%END%]</a>
[% ELSE %]
<a class="actionMenuLinks" href="[% 'export_member' | url_rel([list,'light']) %]">[%|loc%]Dump[%END%]</a>
[% END %]
<a class="actionMenuLinks" href="[% 'show_exclude' | url_rel([list]) %]">[%|loc%]Exclude[%END%]</a>
<br />
[% IF may_sync %]
<br />
<form name="synchronize_list_members" action="[% path_cgi %]" method="post">
<input class="MainMenuLinks heavyWork" type="submit" name="action_sync_include" value="[%|loc%]Synchronize members with data sources[%END%]" />
<input type="hidden" name="list" value="[% list %]"/>
</form>
[% END %]
<hr>
<h3>[%|loc%]Subscription reminder message[%END%]</h3>
<form class="noborder" name="synchronize_list_members" action="[% path_cgi %]" method="post">
<input class="MainMenuLinks" type="submit" name="action_remind"
value="[%|loc%]Remind all[%END%]" />
<input type="hidden" name="previous_action" value="[% action %]" />
<input type="hidden" name="list" value="[% list %]" />
</form>
<hr>
[%# If a list is not 'open' and allow_subscribe_if_pending has been set to
'off', add cannot be performed. ~%]
[% IF list_status == 'open' || conf.allow_subscribe_if_pending == 'on' ~%]
<h3>[%|loc%]Add Subscribers[%END%]</h3>
<form action="[% path_cgi %]" method="POST">
<h4>[%|loc%]To add an individual user:[%END%]</h4>
<fieldset>
<input type="hidden" name="previous_action" value="review" />
<input type="hidden" name="list" value="[% list %]" />
<input type="hidden" name="action" value="add" />
<div>
<label for="email_search">[%|loc%]Email address:[%END%]</label>
<input id="email_search" type="text" name="email" size="35" />
</div>
<div>
<input id="quietly" type="checkbox" name="quiet" />
<label for="quietly">
[%|loc%]Quiet (don't send welcome email)[%END%]
</label>
</div>
<div>
<input class="MainMenuLinks" type="submit" name="action_add"
value="[%|loc%]Add[%END%]" />
</div>
</fieldset>
</form>
<h4>[%|loc%]To add multiple users:[%END%]</h4>
<p>[%|loc%]Click the Multiple Add button below to bulk-add users using a form. (Alternatively, consider using a data-source such as SQL or an Active Directory Group).[%END%]</p>
<div>
<p>
<a class="button" href="[% 'import' | url_rel([list]) %]">
[%|loc%]Multiple add[%END%]
</a>
</p>
</div>
<hr>
[%~ END %]
[% END %]
<h3>[%|loc%]Search for a User[%END%]</h3>
<form action="[% path_cgi %]" method="post">
<fieldset>
<input type="hidden" name="previous_action" value="review" />
<input type="hidden" name="list" value="[% list %]" />
<input type="hidden" name="action" value="search" />
<label for="filter">[%|loc%]Search for a user by email address, name or part of them: [%END%]</label>
<input title="[%|loc%]Enter a name, email or part of them[%END%]" type="text" size="18" id="filter" name="filter" value="[% filter %]" />
<input class="MainMenuLinks" type="submit" name="action_search" value="[%|loc%]Search[%END%]" />
[% IF action == 'search' %]
[% IF too_many_select %]
[%|loc%]Selection too wide, unable to display selection[%END%]
[% END %]
[% END %]
</fieldset>
</form>
<hr>
<h3>[%|loc%]Subscriber Table[%END%]</h3>
<form class="toggleContainer" data-toggle-selector="input[name='email']"
name="myform" action="[% path_cgi %]" method="POST">
<fieldset>
<input type="hidden" name="previous_action" value="[% action %]" />
<input type="hidden" name="previous_list" value="[% list %]" />
<input type="hidden" name="list" value="[% list %]" />
[% IF action == 'search' %]
<h2>[%|loc(occurrence)%]%1 occurrence(s) found[%END%]</h2>
[% END %]
[% SET thosesubscribers = members %]
[% PROCESS subscriber_table.tt2 %]
[% IF action == 'search' %]
[% IF similar_subscribers_occurence != 0 %]
<h2> [%|loc(similar_subscribers_occurence)%] Other similar subscriber's email(s) (%1)[%END%]</h2>
[% SET thosesubscribers = similar_subscribers %]
[% PROCESS subscriber_table.tt2 %]
[% END %]
[% END %]
[% IF total != 0 %]
[% IF is_owner %]
<div>
<input class="MainMenuLinks toggleButton" type="button"
value="[%|loc%]Toggle Selection[%END%]" />
</div>
<div>
<input class="MainMenuLinks" type="submit" name="action_del"
value="[%|loc%]Delete selected email addresses[%END%]" />
</div>
<div>
<input type="checkbox" id="quiet" name="quiet" />
<label for="quiet">
[%|loc%]Quiet (don't send deletion email)[%END%]
</label>
</div>
[% END %]
<hr>
[% IF action == 'search' %]
<h4>[%|loc%]Excluded users[%END%]</h4>
<table class="responsive listOfItems">
<caption>[%|loc%]List of exclude[%END%]</caption>
<tr>
<th>[%|loc%]Email[%END%]</th>
<th>[%|loc%]Since[%END%]</th>
</tr>
[% IF user.email %]
[% IF exclude_users %]
[% FOREACH exc = exclude_users %]
<tr class="color0">
<td>&nbsp;[% exc.email %]&nbsp;</td>
<td>&nbsp;[% exc.since %]&nbsp;</td>
</tr>
[% END %]
[% END %]
[% END %]
</table>
[% END %]
</fieldset>
</form>
[% IF action != 'search' %]
<div class="search_form">
<form class="noborder" action="[% path_cgi %]">
<fieldset>
<label for="size">[%|loc%]Page size[%END%]</label>
<input type="hidden" name="sortby" value="[% sortby %]" />
<input type="hidden" name="action" value="review" />
<input type="hidden" name="list" value="[% list %]" />
[% SET mysize = (size || 0) ~%]
<select id="size" name="size" class="submitOnChange">
[% FOREACH s = [25, 50, 100, 500] ~%]
[% IF 0 < mysize && mysize < s ~%]
<option value="[% size %]" selected>[% size %]</option>
<option value="[% s %]">[% s %]</option>
[%~ mysize = 0 ~%]
[%~ ELSIF mysize == s ~%]
<option value="[% size %]" selected>[% size %]</option>
[%~ mysize = 0 ~%]
[%~ ELSIF s < mysize && loop.last() ~%]
<option value="[% s %]">[% s %]</option>
<option value="[% size %]" selected>[% size %]</option>
[%~ ELSE ~%]
<option value="[% s %]">[% s %]</option>
[%~ END %]
[%~ END %]
</select>
<noscript>
<input type="submit" class="MainMenuLinks" name="action_review"
value="[%|loc%]Change[%END%]" />
</noscript>
</fieldset>
</form>
[% IF prev_page ~%]
<a href="[% 'review' | url_rel([list,prev_page,size,sortby]) %]">
<i class="fa fa-caret-left fa-lg" title="[%|loc%]Previous page[%END%]"></i>
</a>
[%~ END %]
[% IF page ~%]
[%|loc(page,total_page)%]page %1 / %2[%END%]
[%~ END %]
[% IF next_page ~%]
<a href="[% 'review' | url_rel([list,next_page,size,sortby]) %]">
<i class="fa fa-caret-right fa-lg" title="[%|loc%]Next page[%END%]"></i>
</a>
[%~ END %]
</div>
[% END %]
[% END %]
[%~ END #ReviewMembers %]
[%~ BLOCK ReviewUsers # (role,users) ~%]
[% PROCESS config_common.tt2 ~%]
[% SET pS = config_schema.0 ~%]
[% SET pV = config_values.${pS.name} ~%]
[% SET pF = {
email => 'small-6 medium-4 columns',
gecos => 'small-6 medium-4 columns',
reception => 'medium-2 columns show-for-medium',
visibility => 'medium-2 columns show-for-medium',
info => 'columns',
} ~%]
[% PROCESS EditListHeading
ppaths = [pS.name]
pitem = pS
helem = 'h2'
~%]
<form action="[% path_cgi %]" method="POST">
<fieldset role="table">
<input type="hidden" name="list" value="[% list %]" />
<input type="hidden" name="action" value="review" />
<input type="hidden" name="page" value="[% pS.name %]" /> [%~# FIXME ~%]
<div class="row" role="row">
<div class="small-10 medium-11 columns">
[% FOREACH kS = pS.format ~%]
[% NEXT UNLESS pF.${kS.name} ~%]
[% NEXT UNLESS kS.privilege == 'read' || kS.privilege == 'write' ~%]
<div class="[% pF.${kS.name} %]" role="columnheader">
<label>
[% IF kS.title ~%]
[% kS.title %]
[%~ ELSE ~%]
[% kS.name %]
[%~ END %]
</label>
</div>
[%~ END %]
<div class="columns" role="separator">
<hr>
</div>
</div>
[% IF pS.privilege == 'write' && is_privileged_owner ~%]
<div class="small-2 medium-1 columns" role="columnheader">
<label title="[%|loc%]Delete[%END%]">
<i class="fa fa-user-times"></i>
</label>
</div>
[%~ END %]
</div>
[% SET oI = 0 ~%]
[% IF pV.size() ~%]
[% FOREACH oV = pV ~%]
<div class="row" role="row">
<div class="small-10 medium-11 columns" id="item.[% pS.name %].[% oI %]">
[% FOREACH kS = pS.format ~%]
[% NEXT UNLESS pF.${kS.name} ~%]
[% NEXT UNLESS kS.privilege == 'read' || kS.privilege == 'write' ~%]
<div class="[% pF.${kS.name} %]" role="cell">
[% IF kS.name == 'email' ~%]
<span class="show-for-medium">
[%~ IF pS.name == 'owner' && oV.profile == 'privileged' ~%]
<i class="fa fa-fw fa-star"
title="[%|loc%]Privileged owner[%END%]"></i>
[%~ ELSIF pS.name == 'owner' ~%]
<i class="fa fa-fw" title="[%|loc%]Owner[%END%]"></i>
[%~ ELSIF pS.name == 'editor' ~%]
<i class="fa fa-fw" title="[%|loc%]Moderator[%END%]"></i>
[%~ END %]
</span>
[% IF pS.privilege == 'write' && is_privileged_owner ~%]
<a href="[% 'ajax/edit' | url_rel([list,role],{email=>oV.email,previous_action=>action}) %]"
data-reveal-id="edit" data-reveal-ajax="true"
class="MainMenuLinks">[% oV.email %]</a>
[%~ ELSE ~%]
[% oV.email %]
[%~ END %]
[%~ ELSIF kS.name == 'reception' || kS.name == 'visibility' ~%]
[% oV.${kS.name} | optdesc %]
[%~ ELSE ~%]
[% oV.${kS.name} || '&nbsp;' %]
[%~ END %]
</div>
[%~ END %]
<div class="columns" role="separator">
<hr>
</div>
</div>
<div class="small-2 medium-1 columns" role="cell">
[% IF is_privileged_owner && oV.subscribed ~%]
[% PROCESS EditListArrayDel
ppaths = [pS.name,oI]
pitem = pS
labelled = 0
val = oV.email
~%]
[%~ ELSE ~%]
&nbsp;
[%~ END %]
</div>
</div>
[%~ SET oI = oI + 1 %]
[%~ END %]
[%~ ELSE ~%]
<p
class="small-12 medium-8 medium-centered columns alert-box info text-center">
[% IF pS.name == 'owner' ~%]
[%|loc%]List has no owners[%END%]
[%~ ELSIF pS.name == 'editor' ~%]
[%|loc%]List has no moderators[%END%]
[%~ END %]
</p>
[%~ END %]
[% FOREACH kS = pS.format;
IF kS.name == 'email' && kS.privilege == 'write';
SET is_writable = 1;
LAST;
END;
END ~%]
[% IF is_writable && is_privileged_owner ~%]
<h3>
[% IF pS.name == 'owner' ~%]
[%|loc%]Add owners[%END%]
[%~ ELSIF pS.name == 'editor' ~%]
[%|loc%]Add moderators[%END%]
[%~ END %]
</h3>
<div class="row" id="item.[% pS.name %].[% oI %]" role="row">
<div class="small-10 medium-11 columns">
[% IF pS.name == 'owner' ~%]
<div class="columns show-for-medium" role="cell">
<input type="checkbox"
name="single_param.[% pS.name %].[% oI %].profile"
id="param.[% pS.name %].[% oI %].profile"
value="privileged" />
<label for="param.[% pS.name %].[% oI %].profile">
[% 'privileged' | optdesc %]
</label>
</div>
[%~ END %]
[% FOREACH kS = pS.format ~%]
[% NEXT UNLESS pF.${kS.name} ~%]
[% NEXT UNLESS kS.privilege == 'read' || kS.privilege == 'write' ~%]
<div class="[% pF.${kS.name} %]" role="cell">
[% UNLESS kS.privilege == 'write' ~%]
&nbsp;
[%~ ELSIF kS.name == 'reception' ~%]
<input type="checkbox"
name="single_param.[% pS.name %].[% oI %].reception"
id="param.[% pS.name %].[% oI %].reception"
value="nomail" />
<label for="param.[% pS.name %].[% oI %].reception">
[% 'nomail' | optdesc %]
</label>
[%~ ELSIF kS.name == 'visibility' ~%]
<input type="checkbox"
name="single_param.[% pS.name %].[% oI %].visibility"
id="param.[% pS.name %].[% oI %].visibility"
value="conceal" />
<label for="param.[% pS.name %].[% oI %].visibility">
[% 'conceal' | optdesc %]
</label>
[%~ ELSE ~%]
<label for="param.[% pS.name %].[% oI %].[kS.name ]">
[% IF kS.title ~%]
[% kS.title %]
[%~ ELSE ~%]
[% kS.name %]
[%~ END %]
</label>
<input type="text"
name="single_param.[% pS.name %].[% oI %].[% kS.name %]"
id="param.[% pS.name %].[% oI %].[% kS.name %]" />
[%~ END %]
</div>
[% END ~%]
</div>
</div>
[%~ END %]
[% IF pS.privilege == 'write' && is_privileged_owner ~%]
<input type="hidden" name="submit" value="submit" />
<input class="MainMenuLInks" type="submit" name="action_review"
value="[%|loc%]Update[%END%]" />
[% END ~%]
</fieldset>
</form>
[%# AJAX modal dialog ~%]
<div id="edit" class="reveal medium" data-reveal
aria-labelledby="[%|loc%]View user[%END%]" aria-hidden="true"
role="dialog">
[%# empty div that will display a content by AJAX. ~%]
</div>
[%~ END#ReviewUsers ~%]
<!-- end review.tt2 -->

View File

@ -0,0 +1,447 @@
<!-- review.tt2 -->
[% IF !page || page.match('^\d*$') ~%]
[% PROCESS ReviewMembers ~%]
[%~ ELSIF page == 'owner' ~%]
[% PROCESS ReviewUsers
role = page
users = owners %]
[%~ ELSIF page == 'editor' ~%]
[% PROCESS ReviewUsers
role = page
users = editors %]
[%~ END %]
[%~ BLOCK ReviewMembers # (members) ~%]
[% IF is_owner %]
<h2>[%|loc%]Manage list members[%END%]
<a class="openInNewWindow"
href="[% 'nomenu/help' | url_rel(['admin-members.html']) %]" target="wws_help">
<i class="fa fa-info-circle" title="[%|loc%]Help[%END%]"
aria-hidden="true"></i>
</a>
</h2>
<h3>[%|loc%]Administrative Options[%END%]</h3>
<a class="actionMenuLinks" href="[% 'subindex' | url_rel([list]) %]">[%|loc%]Pending subscriptions[%END%]</a>
<a class="actionMenuLinks" href="[% 'sigindex' | url_rel([list]) %]">[%|loc%]Pending unsubscriptions[%END%]</a>
[% IF conf.use_blacklist != 'none' %]
<a class="actionMenuLinks" href="[% 'blacklist' | url_rel([list]) %]">[%|loc%]Blacklist[%END%]</a>
<a class="actionMenuLinks" href="[% path_cgi %]/lca/modlist/[% list %]">[%|loc%]Modlist[%END%]</a>
<a class="actionMenuLinks" href="[% path_cgi %]/lca/whitelist/[% list %]">[%|loc%]Whitelist[%END%]</a>
[% END %]
<a class="actionMenuLinks" href="[% 'reviewbouncing' | url_rel([list]) %]">[%|loc%]Bounces[%END%]</a>
[% IF action == 'search' %]
<a class="actionMenuLinks" href="[% 'export_member' | url_rel([list],{filter=>filter}) %]">[%|loc%]Dump[%END%]</a>
[% ELSE %]
<a class="actionMenuLinks" href="[% 'export_member' | url_rel([list,'light']) %]">[%|loc%]Dump[%END%]</a>
[% END %]
<a class="actionMenuLinks" href="[% 'show_exclude' | url_rel([list]) %]">[%|loc%]Exclude[%END%]</a>
<br />
[% IF may_sync %]
<br />
<form name="synchronize_list_members" action="[% path_cgi %]" method="post">
<input class="MainMenuLinks heavyWork" type="submit" name="action_sync_include" value="[%|loc%]Synchronize members with data sources[%END%]" />
<input type="hidden" name="list" value="[% list %]"/>
</form>
[% END %]
<hr>
<h3>[%|loc%]Subscription reminder message[%END%]</h3>
<form class="noborder" name="synchronize_list_members" action="[% path_cgi %]" method="post">
<input class="MainMenuLinks" type="submit" name="action_remind"
value="[%|loc%]Remind all[%END%]" />
<input type="hidden" name="previous_action" value="[% action %]" />
<input type="hidden" name="list" value="[% list %]" />
</form>
<hr>
[%# If a list is not 'open' and allow_subscribe_if_pending has been set to
'off', add cannot be performed. ~%]
[% IF list_status == 'open' || conf.allow_subscribe_if_pending == 'on' ~%]
<h3>[%|loc%]Add Subscribers[%END%]</h3>
<form action="[% path_cgi %]" method="POST">
<h4>[%|loc%]To add an individual user:[%END%]</h4>
<fieldset>
<input type="hidden" name="previous_action" value="review" />
<input type="hidden" name="list" value="[% list %]" />
<input type="hidden" name="action" value="add" />
<div>
<label for="email_search">[%|loc%]Email address:[%END%]</label>
<input id="email_search" type="text" name="email" size="35" />
</div>
<div>
<input id="quietly" type="checkbox" name="quiet" />
<label for="quietly">
[%|loc%]Quiet (don't send welcome email)[%END%]
</label>
</div>
<div>
<input class="MainMenuLinks" type="submit" name="action_add"
value="[%|loc%]Add[%END%]" />
</div>
</fieldset>
</form>
<h4>[%|loc%]To add multiple users:[%END%]</h4>
<p>[%|loc%]Click the Multiple Add button below to bulk-add users using a form. (Alternatively, consider using a data-source such as SQL or an Active Directory Group).[%END%]</p>
<div>
<p>
<a class="button" href="[% 'import' | url_rel([list]) %]">
[%|loc%]Multiple add[%END%]
</a>
</p>
</div>
<hr>
[%~ END %]
[% END %]
<h3>[%|loc%]Search for a User[%END%]</h3>
<form action="[% path_cgi %]" method="post">
<fieldset>
<input type="hidden" name="previous_action" value="review" />
<input type="hidden" name="list" value="[% list %]" />
<input type="hidden" name="action" value="search" />
<label for="filter">[%|loc%]Search for a user by email address, name or part of them: [%END%]</label>
<input title="[%|loc%]Enter a name, email or part of them[%END%]" type="text" size="18" id="filter" name="filter" value="[% filter %]" />
<input class="MainMenuLinks" type="submit" name="action_search" value="[%|loc%]Search[%END%]" />
[% IF action == 'search' %]
[% IF too_many_select %]
[%|loc%]Selection too wide, unable to display selection[%END%]
[% END %]
[% END %]
</fieldset>
</form>
<hr>
<h3>[%|loc%]Subscriber Table[%END%]</h3>
<form class="toggleContainer" data-toggle-selector="input[name='email']"
name="myform" action="[% path_cgi %]" method="POST">
<fieldset>
<input type="hidden" name="previous_action" value="[% action %]" />
<input type="hidden" name="previous_list" value="[% list %]" />
<input type="hidden" name="list" value="[% list %]" />
[% IF action == 'search' %]
<h2>[%|loc(occurrence)%]%1 occurrence(s) found[%END%]</h2>
[% END %]
[% SET thosesubscribers = members %]
[% PROCESS subscriber_table.tt2 %]
[% IF action == 'search' %]
[% IF similar_subscribers_occurence != 0 %]
<h2> [%|loc(similar_subscribers_occurence)%] Other similar subscriber's email(s) (%1)[%END%]</h2>
[% SET thosesubscribers = similar_subscribers %]
[% PROCESS subscriber_table.tt2 %]
[% END %]
[% END %]
[% IF total != 0 %]
[% IF is_owner %]
<div>
<input class="MainMenuLinks toggleButton" type="button"
value="[%|loc%]Toggle Selection[%END%]" />
</div>
<div>
<input class="MainMenuLinks" type="submit" name="action_del"
value="[%|loc%]Delete selected email addresses[%END%]" />
</div>
<div>
<input type="checkbox" id="quiet" name="quiet" />
<label for="quiet">
[%|loc%]Quiet (don't send deletion email)[%END%]
</label>
</div>
[% END %]
<hr>
[% IF action == 'search' %]
<h4>[%|loc%]Excluded users[%END%]</h4>
<table class="responsive listOfItems">
<caption>[%|loc%]List of exclude[%END%]</caption>
<tr>
<th>[%|loc%]Email[%END%]</th>
<th>[%|loc%]Since[%END%]</th>
</tr>
[% IF user.email %]
[% IF exclude_users %]
[% FOREACH exc = exclude_users %]
<tr class="color0">
<td>&nbsp;[% exc.email %]&nbsp;</td>
<td>&nbsp;[% exc.since %]&nbsp;</td>
</tr>
[% END %]
[% END %]
[% END %]
</table>
[% END %]
</fieldset>
</form>
[% IF action != 'search' %]
<div class="search_form">
<form class="noborder" action="[% path_cgi %]">
<fieldset>
<label for="size">[%|loc%]Page size[%END%]</label>
<input type="hidden" name="sortby" value="[% sortby %]" />
<input type="hidden" name="action" value="review" />
<input type="hidden" name="list" value="[% list %]" />
[% SET mysize = (size || 0) ~%]
<select id="size" name="size" class="submitOnChange">
[% FOREACH s = [25, 50, 100, 500] ~%]
[% IF 0 < mysize && mysize < s ~%]
<option value="[% size %]" selected>[% size %]</option>
<option value="[% s %]">[% s %]</option>
[%~ mysize = 0 ~%]
[%~ ELSIF mysize == s ~%]
<option value="[% size %]" selected>[% size %]</option>
[%~ mysize = 0 ~%]
[%~ ELSIF s < mysize && loop.last() ~%]
<option value="[% s %]">[% s %]</option>
<option value="[% size %]" selected>[% size %]</option>
[%~ ELSE ~%]
<option value="[% s %]">[% s %]</option>
[%~ END %]
[%~ END %]
</select>
<noscript>
<input type="submit" class="MainMenuLinks" name="action_review"
value="[%|loc%]Change[%END%]" />
</noscript>
</fieldset>
</form>
[% IF prev_page ~%]
<a href="[% 'review' | url_rel([list,prev_page,size,sortby]) %]">
<i class="fa fa-caret-left fa-lg" title="[%|loc%]Previous page[%END%]"></i>
</a>
[%~ END %]
[% IF page ~%]
[%|loc(page,total_page)%]page %1 / %2[%END%]
[%~ END %]
[% IF next_page ~%]
<a href="[% 'review' | url_rel([list,next_page,size,sortby]) %]">
<i class="fa fa-caret-right fa-lg" title="[%|loc%]Next page[%END%]"></i>
</a>
[%~ END %]
</div>
[% END %]
[% END %]
[%~ END #ReviewMembers %]
[%~ BLOCK ReviewUsers # (role,users) ~%]
[% PROCESS config_common.tt2 ~%]
[% SET pS = config_schema.0 ~%]
[% SET pV = config_values.${pS.name} ~%]
[% SET pF = {
email => 'small-6 medium-4 columns',
gecos => 'small-6 medium-4 columns',
reception => 'medium-2 columns show-for-medium',
visibility => 'medium-2 columns show-for-medium',
info => 'columns',
} ~%]
[% PROCESS EditListHeading
ppaths = [pS.name]
pitem = pS
helem = 'h2'
~%]
<form action="[% path_cgi %]" method="POST">
<fieldset role="table">
<input type="hidden" name="list" value="[% list %]" />
<input type="hidden" name="action" value="review" />
<input type="hidden" name="page" value="[% pS.name %]" /> [%~# FIXME ~%]
<div class="row" role="row">
<div class="small-10 medium-11 columns">
[% FOREACH kS = pS.format ~%]
[% NEXT UNLESS pF.${kS.name} ~%]
[% NEXT UNLESS kS.privilege == 'read' || kS.privilege == 'write' ~%]
<div class="[% pF.${kS.name} %]" role="columnheader">
<label>
[% IF kS.title ~%]
[% kS.title %]
[%~ ELSE ~%]
[% kS.name %]
[%~ END %]
</label>
</div>
[%~ END %]
<div class="columns" role="separator">
<hr>
</div>
</div>
[% IF pS.privilege == 'write' && is_privileged_owner ~%]
<div class="small-2 medium-1 columns" role="columnheader">
<label title="[%|loc%]Delete[%END%]">
<i class="fa fa-user-times"></i>
</label>
</div>
[%~ END %]
</div>
[% SET oI = 0 ~%]
[% IF pV.size() ~%]
[% FOREACH oV = pV ~%]
<div class="row" role="row">
<div class="small-10 medium-11 columns" id="item.[% pS.name %].[% oI %]">
[% FOREACH kS = pS.format ~%]
[% NEXT UNLESS pF.${kS.name} ~%]
[% NEXT UNLESS kS.privilege == 'read' || kS.privilege == 'write' ~%]
<div class="[% pF.${kS.name} %]" role="cell">
[% IF kS.name == 'email' ~%]
<span class="show-for-medium">
[%~ IF pS.name == 'owner' && oV.profile == 'privileged' ~%]
<i class="fa fa-fw fa-star"
title="[%|loc%]Privileged owner[%END%]"></i>
[%~ ELSIF pS.name == 'owner' ~%]
<i class="fa fa-fw" title="[%|loc%]Owner[%END%]"></i>
[%~ ELSIF pS.name == 'editor' ~%]
<i class="fa fa-fw" title="[%|loc%]Moderator[%END%]"></i>
[%~ END %]
</span>
[% IF pS.privilege == 'write' && is_privileged_owner ~%]
<a href="[% 'ajax/edit' | url_rel([list,role],{email=>oV.email,previous_action=>action}) %]"
data-reveal-id="edit" data-reveal-ajax="true"
class="MainMenuLinks">[% oV.email %]</a>
[%~ ELSE ~%]
[% oV.email %]
[%~ END %]
[%~ ELSIF kS.name == 'reception' || kS.name == 'visibility' ~%]
[% oV.${kS.name} | optdesc %]
[%~ ELSE ~%]
[% oV.${kS.name} || '&nbsp;' %]
[%~ END %]
</div>
[%~ END %]
<div class="columns" role="separator">
<hr>
</div>
</div>
<div class="small-2 medium-1 columns" role="cell">
[% IF is_privileged_owner && oV.subscribed ~%]
[% PROCESS EditListArrayDel
ppaths = [pS.name,oI]
pitem = pS
labelled = 0
val = oV.email
~%]
[%~ ELSE ~%]
&nbsp;
[%~ END %]
</div>
</div>
[%~ SET oI = oI + 1 %]
[%~ END %]
[%~ ELSE ~%]
<p
class="small-12 medium-8 medium-centered columns alert-box info text-center">
[% IF pS.name == 'owner' ~%]
[%|loc%]List has no owners[%END%]
[%~ ELSIF pS.name == 'editor' ~%]
[%|loc%]List has no moderators[%END%]
[%~ END %]
</p>
[%~ END %]
[% FOREACH kS = pS.format;
IF kS.name == 'email' && kS.privilege == 'write';
SET is_writable = 1;
LAST;
END;
END ~%]
[% IF is_writable && is_privileged_owner ~%]
<h3>
[% IF pS.name == 'owner' ~%]
[%|loc%]Add owners[%END%]
[%~ ELSIF pS.name == 'editor' ~%]
[%|loc%]Add moderators[%END%]
[%~ END %]
</h3>
<div class="row" id="item.[% pS.name %].[% oI %]" role="row">
<div class="small-10 medium-11 columns">
[% IF pS.name == 'owner' ~%]
<div class="columns show-for-medium" role="cell">
<input type="checkbox"
name="single_param.[% pS.name %].[% oI %].profile"
id="param.[% pS.name %].[% oI %].profile"
value="privileged" />
<label for="param.[% pS.name %].[% oI %].profile">
[% 'privileged' | optdesc %]
</label>
</div>
[%~ END %]
[% FOREACH kS = pS.format ~%]
[% NEXT UNLESS pF.${kS.name} ~%]
[% NEXT UNLESS kS.privilege == 'read' || kS.privilege == 'write' ~%]
<div class="[% pF.${kS.name} %]" role="cell">
[% UNLESS kS.privilege == 'write' ~%]
&nbsp;
[%~ ELSIF kS.name == 'reception' ~%]
<input type="checkbox"
name="single_param.[% pS.name %].[% oI %].reception"
id="param.[% pS.name %].[% oI %].reception"
value="nomail" />
<label for="param.[% pS.name %].[% oI %].reception">
[% 'nomail' | optdesc %]
</label>
[%~ ELSIF kS.name == 'visibility' ~%]
<input type="checkbox"
name="single_param.[% pS.name %].[% oI %].visibility"
id="param.[% pS.name %].[% oI %].visibility"
value="conceal" />
<label for="param.[% pS.name %].[% oI %].visibility">
[% 'conceal' | optdesc %]
</label>
[%~ ELSE ~%]
<label for="param.[% pS.name %].[% oI %].[kS.name ]">
[% IF kS.title ~%]
[% kS.title %]
[%~ ELSE ~%]
[% kS.name %]
[%~ END %]
</label>
<input type="text"
name="single_param.[% pS.name %].[% oI %].[% kS.name %]"
id="param.[% pS.name %].[% oI %].[% kS.name %]" />
[%~ END %]
</div>
[% END ~%]
</div>
</div>
[%~ END %]
[% IF pS.privilege == 'write' && is_privileged_owner ~%]
<input type="hidden" name="submit" value="submit" />
<input class="MainMenuLInks" type="submit" name="action_review"
value="[%|loc%]Update[%END%]" />
[% END ~%]
</fieldset>
</form>
[%# AJAX modal dialog ~%]
<div id="edit" class="reveal medium" data-reveal
aria-labelledby="[%|loc%]View user[%END%]" aria-hidden="true"
role="dialog">
[%# empty div that will display a content by AJAX. ~%]
</div>
[%~ END#ReviewUsers ~%]
<!-- end review.tt2 -->

View File

@ -0,0 +1,73 @@
<!-- $Id: whitelist.tt2 $ -->
<div class="block">
<h2>[%|loc%]Gestion de la [% x_name %][%END%]</h2><br />
[% IF is_owner || is_listmaster || may_add %]
<div id="blacklist">
[% IF x_name == "whitelist" %]
Il s'agit de la liste blanche pour la liste [% list %]@[% robot %].
<br /><br />
[%|loc%]Tous les messages en provenance d'utilisateurs dont l'adresse e-mail est reconnue par l'un des filtres de la liste blanche sera immédiatement accepté.[%END%]
[% ELSE %]
Il s'agit de la liste modérée pour la liste [% list %]@[% robot %].
<br /><br />
[%|loc%]Tous les messages en provenance d'utilisateurs dont l'adresse e-mail est reconnue par l'un des filtres de la liste modérées sera immédiatement envoyé en modération.[%END%]
[% END %]
La liste noire a la priorité la plus forte, suivie par la liste modérée et enfin la liste blanche, qui ont tous une priorité supérieure à celle définie dans le scénario de la liste de diffusion.
<br /><br />
[%|loc%]Syntaxe :[%END%]
<ul>
<li>[%|loc%]Seulement une adresse e-mail ou une expression par ligne[%END%]</li>
<li>[%|loc%]Le caractère # introduit un commentaire[%END%]</li>
<li>[%|loc%]Le caractère * reconnaît tous les chaînes de caractères. Par exemple : "*@exemple.com" reconnaît tous les expéditeurs depuis le domain "exemple.com"[%END%]</li>
<li>[%|loc%]Un seul caractère * n'est accepté par ligne[%END%]</li>
<li>[%|loc%]Ne pas utiliser de barre verticale, de crochets ou d'accolades dans l'expression[%END%]</li>
</ul>
<p>
[% IF x_rows < 1 %]
[%|loc%]La liste est actuellement vide[%END%]
[% ELSE %]
[%|loc(x_rows)%]La liste contient actuellement %1 ligne·s[%END%]
[% END %]
</p>
[% IF x_rows < 10 %] [% x_rows = 10 %] [% END %]
[% IF x_rows > 20 %] [% x_rows = 20 %] [% END %]
[% x_rows = x_rows+2 %]
<form class="noborder" action="[% path_cgi %]/lca/[% x_name %]/[% list %]" method="post">
<fieldset>
<!-- note -
The params action, custom_action, list override the URL items.
The cap param overrides the PATH_INO
If you are POSTing, you MUST specify all...
plugin.* be passed to a custom extension TT2 only! -->
<input type="hidden" name="action" value="lca" />
<input type="hidden" name="custom_action" value="[% x_name %]" />
[% IF list %]
<input type="hidden" name="list" value="[% list %]" />
[% END %]
<!-- trailing / is important as it ends the parameter before the NULL -->
<input type="hidden" name="cap" value="save/" />
<textarea name="cap" cols="80" rows="[% x_rows %]">[% x_data %]</textarea><br />
<br /><input type="submit" class="MainMenuLinks" name="x_action" value="save" />
[% IF x_saveerror %]
Impossible de sauvegarder les données de la [% x_name %] ! <B>ERREUR :</B> [% x_saveerror %]
[% ELSE %]
[% IF x_saved && x_saved > 0 %]
[%|loc(x_ucfname) %] %1 data ont bien été enregistrées ![%END%] ([% time %])
[% END %]
[% END %]
</fieldset>
</form>
</div>
[% ELSE %]
Vous n'avez pas le droit de modifier cette liste.
[% END %]
</div>
<!-- end whitelist.tt2 -->