Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WWSympa: Improving subscribe, signoff and auth functions #26

Merged
merged 9 commits into from
Jul 15, 2017
5 changes: 2 additions & 3 deletions default/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ nobase_default_DATA = \
web_tt2/arcsearch.tt2 \
web_tt2/arc.tt2 \
web_tt2/aside_menu.tt2 \
web_tt2/auto_signoff.tt2 \
web_tt2/automatic_lists_management_request.tt2 \
web_tt2/automatic_lists_request.tt2 \
web_tt2/automatic_lists.tt2 \
Expand Down Expand Up @@ -298,13 +297,13 @@ nobase_default_DATA = \
web_tt2/show_exclude.tt2 \
web_tt2/show_sessions.tt2 \
web_tt2/sigindex.tt2 \
web_tt2/sigrequest.tt2 \
web_tt2/signoff.tt2 \
web_tt2/skinsedit.tt2 \
web_tt2/sso_login.tt2 \
web_tt2/stats.tt2 \
web_tt2/subindex.tt2 \
web_tt2/suboptions.tt2 \
web_tt2/subrequest.tt2 \
web_tt2/subscribe.tt2 \
web_tt2/subscriber_table.tt2 \
web_tt2/suspend_request.tt2 \
web_tt2/sympa_menu.tt2 \
Expand Down
3 changes: 3 additions & 0 deletions default/mail_tt2/command_report.tt2
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ X-Loop: [% conf.email %]@[% conf.host %]
[% ELSIF notice.entry == 'sent_to_owner' -%]
[%|loc%]Your request to subscribe/unsubscribe has been forwarded to the list's owners for approval. You will receive a notification when you have been subscribed (or unsubscribed) to the list.[%END-%]

[% ELSIF notice.entry == 'sent_to_user' -%]
[%|loc%]To confirm your identity and prevent anyone from subscribing you to this list against your will, a message containing an validation link was sent to the e-mail address you provided.[%END%]

[% ELSIF notice.entry == 'updated_info' -%]
[%|loc(notice.email,notice.listname)%]Information regarding user %1 has been updated for list %2.[%END%]

Expand Down
4 changes: 4 additions & 0 deletions default/mail_tt2/invite.tt2
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@ Subject: [% FILTER qencode %][%|loc(list.name)%]Invitation to join list %1[%END%
[%|loc(list.subject)%]This list is about %1, so you are probably concerned.[%END%]

[%|loc%]To subscribe just hit the following link:[%END%]
[% IF user_interfaces.size() == 1 && user_interfaces.0 == 'mail' -%]
[% | mailtourl({subject => "AUTH ${keyauth} ${cmd}"}) ~%]
[% conf.email %]@[% conf.host %]
[%~ END %]

[%|loc(conf.email,conf.host)%]Or send a message to %1@%2 with the following subject:[%END%]
AUTH [% keyauth %] [% cmd %]
[%- ELSE -%]
[% 'auth' | url_abs([keyauth,'subscribe'],{email=>user.email}) %]
[%- END %]

[%|loc%]If you don't want to subscribe just ignore this message.[%END%]
32 changes: 14 additions & 18 deletions default/mail_tt2/listowner_notification.tt2
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,15 @@ Subject: [% FILTER qencode %][%|loc(list.name)%]Subscription request to list %1[

[%|loc(list.name)-%]Dear owner of list %1,

A user asked to be added as a subscriber to your list. In order to list and manage pending subscription requests you should click on the following link:[%END%]
A user asked to be added as a subscriber to your list. If this is OK with you, you should click on the following link:[%END%]
[% IF user_interfaces.size() == 1 && user_interfaces.0 == 'mail' -%]
[% "${conf.email}@${conf.host}" | mailtourl({subject=>"AUTH ${keyauth} ADD ${list.name} ${who} ${gecos}"}) %]

[% 'ticket' | url_abs([one_time_ticket]) %]

[%|loc("${conf.email}@${conf.host}")%]If prefered, you can accept this subscription request sending an email to %1 with the following subject:[%END%]
AUTH [%keyauth%] ADD [%list.name%] [%who%] [%gecos%]

[%|loc%]That can be done using this mailto link:[%END%]
[% | mailtourl({subject => "auth ${keyauth} ADD ${list.name} ${who} ${gecos}"}) ~%]
[% conf.email %]@[% conf.host %]
[%~ END %]
[%|loc(conf.email,conf.host)%]Or send a message to %1@%2 with the following subject:[%END%]
AUTH [%keyauth%] ADD [%list.name%] [%who%] [%gecos%]
[%- ELSE -%]
[% 'auth' | url_abs([keyauth,'add',list.name],{email=>user.email}) %]
[%- END %]

[% IF custom_attribute %]
[%|loc%]The user has provided the following informations:[%END%]
Expand All @@ -74,16 +72,14 @@ Subject: [% FILTER qencode %][%|loc(list.name)%]UNsubscription request from list
[%|loc(list.name)-%]Dear owner of list %1,

A user asked to be deleted from your list. If this is OK with you, you should click on the following link:[% END %]

[% 'ticket' | url_abs([one_time_ticket]) %]
[% IF user_interfaces.size() == 1 && user_interfaces.0 == 'mail' -%]
[% "${conf.email}@${conf.host}" | mailtourl({subject=>"AUTH ${keyauth} DEL ${list.name} ${who}"}) %]

[%|loc(conf.email,conf.host)%]Or send a message to %1@%2 with the following subject:[%END%]
AUTH [%keyauth%] DEL [%list.name%] [%who%]

[%|loc%]That can be done using this mailto link:[%END%]
[% | mailtourl({subject => "auth ${keyauth} DEL ${list.name} ${who}"}) ~%]
[% conf.email %]@[% conf.host %]
[%~ END %]
AUTH [%keyauth%] DEL [%list.name%] [%who%]
[%- ELSE -%]
[% 'auth' | url_abs([keyauth,'del',list.name],{email=>user.email}) %]
[%- END %]

[% ELSIF type == 'automatic_bounce_management' -%]
[% PROCESS 'automatic_bounce_management.tt2' -%]
Expand Down
37 changes: 26 additions & 11 deletions default/mail_tt2/request_auth.tt2
Original file line number Diff line number Diff line change
@@ -1,27 +1,40 @@
[%# request_auth.tt2 ~%]
To: [% to %]
[% IF user_interfaces.size() == 1 and user_interfaces.0 == 'mail' -%]
Subject: [% FILTER qencode %]AUTH [%keyauth%] [%cmd%][%END%]
[%- ELSIF type == 'signoff' -%]
Subject: [% FILTER qencode %][%|loc(conf.title,list.name)%]%1 / unsubscribing from %2[%END%][%END%]
[%- ELSIF type == 'subscribe' -%]
Subject: [% FILTER qencode %][%|loc(conf.title,list.name)%]%1 / subscribing to %2[%END%][%END%]
[%- ELSE -%]
Subject: [% FILTER qencode %]AUTH [%keyauth%] [%cmd%][%END%]
[%- END %]

[% IF type == 'signoff' -%]
[% IF type == 'signoff' -%]
[%|loc(list.name)-%]You asked for your e-mail address to be removed from list '%1'.[%- END -%]

[%- ELSIF type == 'subscribe' -%]
[%- ELSIF type == 'subscribe' -%]
[%|loc(list.name)-%]You asked for your e-mail address to be added to list '%1'.[%- END -%]

[%- ELSIF type == 'add' -%]
[%- ELSIF type == 'add' -%]
[%|loc(list.name)-%]You requested a user subscription in list %1.[%- END -%]

[%- ELSIF type == 'del' -%]
[%- ELSIF type == 'del' -%]
[%|loc(list.name)-%]You requested a user removal from list %1.[%- END -%]

[%- ELSIF type == 'remind' -%]
[%- ELSIF type == 'remind' -%]
[%|loc(list.name)-%]You requested a subscription reminder to be sent to each subscriber of list %1[%- END -%]

[%- ELSIF type == 'global_remind' -%]
[%- ELSIF type == 'global_remind' -%]
[%|loc-%]You requested a subscription reminder to be sent to each subscriber of list '*'[%- END -%]
[%- END -%]

[% sympa = BLOCK %][% conf.email %]@[% conf.host %][%END%]
[%- ELSE -%]
[%|loc(type)%]You requested an action '%1'.[% END -%]

[%- END -%]

[% IF user_interfaces.size() == 1 and user_interfaces.0 == 'mail' -%]
[% sympa = BLOCK %][% conf.email %]@[% conf.host %][%END -%]
[%|loc(sympa,"AUTH ${keyauth} ${cmd}") %]If you want this action to be taken, please

- reply to this mail
Expand All @@ -30,8 +43,10 @@ OR
%2
OR
- hit the following mailto[% END %]
[% | mailtourl({subject => "AUTH ${keyauth} ${cmd}"}) ~%]
[% conf.email %]@[% conf.host %]
[%~ END %]
[% sympa | mailtourl({subject => "AUTH ${keyauth} ${cmd}"}) %]
[%- ELSE -%]
[%|loc%]If you want this action to be taken, please hit the following link:[%END%]
[% 'auth' | url_abs([keyauth,type],{email=>to}) ~%]
[%- END %]

[%|loc-%]If you do not want this action to be taken, you can safely ignore this message.[% END %]
24 changes: 0 additions & 24 deletions default/mail_tt2/sendpasswd.tt2
Original file line number Diff line number Diff line change
@@ -1,34 +1,10 @@
[%# sendpasswd.tt2 ~%]
To: [% newuser.email %]
[% IF action == 'subrequest' -%]
Subject: [% FILTER qencode %][%|loc(conf.title,list)%]%1 / subscribing to %2[%END%][%END%]
[% ELSIF action == 'sigrequest' -%]
Subject: [% FILTER qencode %][%|loc(conf.title,list)%]%1 / unsubscribing from %2[%END%][%END%]
[% ELSE -%]
Subject: [% FILTER qencode %][%|loc(conf.title)%]%1 / your environment[%END%][%END%]
[% END -%]

[% IF action == 'subrequest' -%]

[%# A parameter request_from_host may be used to show remote host.
However, use it carefully. ~%]
[%|loc(list,conf.host)%]Someone, probably you, requested to subscribe to list %1@%2.[%END%]
[%|loc%]You may ignore this subscription request or click on the following link in order to confirm it [%END%]: [% 'ticket' | url_abs([one_time_ticket]) %]

[% ELSIF action == 'sigrequest' -%]
[%|loc(list)%]You asked to be unsubscribed from %1 mailing list.[%END%]

[%|loc%]To unsubscribe from the list, you need to provide the following password[%END%]

[%|loc(newuser.password)%]password: %1[%END%]

[% ELSE -%]

[%# A parameter request_from_host may be used to show remote host.
However, use it carefully. ~%]
[%|loc(conf.host)%]Someone, probably you, requested to allocate or renew your password for your list server account %1.[%END%]
[%|loc%]You may ignore this request or click on the following link in order to choose your password. [%END%]: [% 'ticket' | url_abs([one_time_ticket]) %]

[%END%]

[%|loc(conf.wwsympa_url,'/help')%]Help on Sympa: %1%2[%END%]
11 changes: 0 additions & 11 deletions default/mail_tt2/user_notification.tt2
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,6 @@ Subject: [% FILTER qencode %][%|loc%]Changing your subscriber email address[%END
[%|loc%]You have requested to change your subscriber email address. To confirm your new email address with the SYMPA server, please click the link below:[%END%]
[% 'ticket' | url_abs([one_time_ticket]) %]


[% ELSIF type == 'ticket_to_signoff' -%]
Subject: [% FILTER qencode %][%|loc(list.name)%]Unsubscribing from list %1[%END%][%END%]
[% IF context == 'auto_signoff'%]
[%|loc(list.name,ip)%]Somebody (probably you) requested to unsubscribe you from list %1. This query was issued from the IP number '%2'.
To confirm and get removed from the list, please click the link below: [%END%]
[% ELSE %]
[%|loc(list.name)%]You have requested to be removed from list %1. To confirm and get removed from the list, please click the link below: [%END%]
[% END %]
[% 'ticket' | url_abs([one_time_ticket]) %]

[% ELSIF type == 'ticket_to_family_signoff' -%]
Subject: [% FILTER qencode %][%|loc(family)%]Unsubscribing from family %1[%END%][%END%]
[% IF context == 'family_signoff'%]
Expand Down
3 changes: 0 additions & 3 deletions default/web_tt2/auto_signoff.tt2

This file was deleted.

53 changes: 52 additions & 1 deletion default/web_tt2/confirm_action.tt2
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,25 @@
<p><strong>
[%|loc%]Do you really want to delete Selected Archives?[%END%]
</strong></p>
[%~ ELSIF confirm_action == 'auth' ~%]
<h2><i class="fa fa-check-square"></i>
[% IF heldaction == 'add' ~%]
[%|loc%]Add subscribers[%END%]
[%~ ELSIF heldaction == 'del' ~%]
[%|loc%]Delete selected email addresses[%END%]
[%~ ELSIF heldaction == 'remind' || heldaction == 'global_remind' ~%]
[%|loc%]Remind all subscribers[%END%]
[%~ ELSIF heldaction == 'signoff' ~%]
[%|loc%]Unsubscribe[%END%]
[%~ ELSIF heldaction == 'subscribe' ~%]
[%|loc%]Subscribe[%END%]
[%~ ELSE ~%]
[% heldaction %]
[%~ END %]
</h2>
<p><strong>
[%|loc%]Do you really want this action to be taken?[%END%]
</strong></p>
[%~ ELSIF confirm_action == 'close_list' ~%]
<h2><i class="fa fa-check-circle"></i>
[%|loc%]Remove List[%END%]
Expand Down Expand Up @@ -159,6 +178,11 @@
<input type="checkbox" id="zip" name="zip" value="1" checked="checked" />
<label for="zip">[%|loc%]Download deleted archives[%END%]</label>
</div>
[%~ ELSIF confirm_action == 'auth' ~%]
<input type="hidden" name="id" value="[% id %]" />
<input type="hidden" name="heldaction" value="[% heldaction %]" />
<input type="hidden" name="listname" value="[% listname %]" />
<input type="hidden" name="email" value="[% email %]" />
[%~ ELSIF confirm_action == 'del' ~%]
[% FOREACH e = email ~%]
<input type="hidden" name="email" value="[% e %]" />
Expand Down Expand Up @@ -212,7 +236,12 @@
[%~ ELSIF confirm_action == 'signoff' ~%]
<input type="hidden" name="email" value="[% email %]" />
[%~ ELSIF confirm_action == 'subscribe' ~%]
<input type="hidden" name="email" value="[% user.email %]" />
<input type="hidden" name="email" value="[% email %]" />
<input type="hidden" name="gecos" value="[% gecos %]" />
[% FOREACH i = custom_attribute ~%]
<input type="hidden" name="custom_attribute.[% i.key %]"
value="[% i.value %]" />
[%~ END %]
[%~ END %]
<input type="hidden" name="action" value="[% confirm_action %]" />
<input type="hidden" name="list" value="[% list %]" />
Expand All @@ -223,6 +252,28 @@
value="[%|loc%]I am not a spammer[%END%]" />
</div>
<p>[%|loc%]This button aims at protecting mailing lists archives against Spam Harvester.[%END%]</p>
[%~ ELSIF confirm_action == 'auth' ~%]
<div>
<input class="MainMenuLinks" type="submit"
id="response_action_confirm" name="response_action_confirm"
value="[%|loc%]Confirm[%END%]" />
<input class="MainMenuLinks" type="submit"
id="response_action_cancel" name="response_action_cancel"
value="[%|loc%]Cancel[%END%]" />
</div>
[% IF listname ~%]
<div>
[% IF heldaction == 'add' ~%]
<a href="[% 'subindex' | url_rel([listname]) %]">
[%|loc%]Review subscription requests[%END%]
</a>
[%~ ELSIF heldaction == 'del' ~%]
<a href="[% 'sigindex' | url_rel([listname]) %]">
[%|loc%]Review unsubscription requests[%END%]
</a>
[%~ END %]
</div>
[%~ END %]
[%~ ELSE ~%]
<div>
<input class="MainMenuLinks" type="submit"
Expand Down
4 changes: 2 additions & 2 deletions default/web_tt2/list_menu.tt2
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,13 @@
[% END %]
[% ELSE %]
[% IF may_subscribe %]
[% IF action == 'subrequest' %][% SET class = 'active' %][% ELSE %][% SET class = '' %][% END %]
[% IF action == 'subscribe' %][% SET class = 'active' %][% ELSE %][% SET class = '' %][% END %]
<li class="[% class %]"><a href="[% 'subscribe' | url_rel([list],{previous_action=>action}) %]">[%|loc%]Subscribe[%END%]</a></li>
[% END %]

[% IF ! user.email %]
[% IF action == 'signoff' %][% SET class = 'active' %][% ELSE %][% SET class = '' %][% END %]
<li class="[% class %]"><a href="[% 'sigrequest' | url_rel([list]) %]">[%|loc%]Unsubscribe[%END%]</a></li>
<li class="[% class %]"><a href="[% 'signoff' | url_rel([list]) %]">[%|loc%]Unsubscribe[%END%]</a></li>
[% END %]

[% END %]
Expand Down
14 changes: 14 additions & 0 deletions default/web_tt2/notice.tt2
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,20 @@
<i class="fi-eye"></i>
[%|loc%]Your request has been forwarded to the list owner[%END%]

[% ELSIF notice.msg == 'sent_to_user' %]
<div data-alert class="alert-box info radius">
<p><i class="fi-eye"></i>
[% IF notice.action == 'auto_signoff' ~%]
<p>[%|loc(email,list)%]You clicked a link to unsubscribe the address %1 from list %2.[% END %]</p>
<p>[%|loc(list)%]A confirmation was just sent to this address. By clicking the link it contains, you will be definitively unsubscribed from list %1[% END %]</p>
[%~ ELSIF notice.action == 'subscribe' ~%]
<p>[%|loc(list)%]You requested a subscription to list %1[%END%]</p>
<p>[%|loc%]To confirm your identity and prevent anyone from subscribing you to this list against your will, a message containing an validation link was sent to the e-mail address you provided.[%END%]</p>
<p>[%|loc(list)%]Check your mailbox for new messages and click this link. This will confirm your subscription to list %1.[%END%]</p>
[%~ ELSIF notice.action == 'signoff' ~%]
<p>[%|loc(list)%]We need to check your identity before validating your unsubscription request for list %1. If you have a user account you should login or create an account. <br/>Otherwise we can send you an email with a validation link inside; please provide your email address below to receive this validation link.[%END%]</p>
<p>[%|loc%]We've sent you an email including a validation link. You should check your mailbox to read this email and use this validation link.[%END%]</p>
[%~ END %]
[% ELSIF notice.msg == 'add_performed' %]
<div data-alert class="alert-box success radius">
<i class="fi-check"></i>
Expand Down
34 changes: 34 additions & 0 deletions default/web_tt2/signoff.tt2
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!-- signoff.tt2 -->
[% IF user.email && !is_subscriber ~%]
<p>[%|loc(list,email)%]You are not subscribed to list %1 with e-mail address %2[%END%]</p>
<p>[%|loc%]You might have subscribed with another address. Please contact the list owner to help you unsubscribe:[%END%]</p>
<blockquote>
<p>[% '' | mailto("${list}-request@${conf.host}") %]</p>
</blockquote>
<p><a href="[% (previous_action || 'info') | url_rel([list]) %]">
[%|loc%]Back[%END%]
</a></p>
[%~ ELSE ~%]
<p>[%|loc(list)%]You asked to be unsubscribed from list %1[%END%]</p>
<p>[%|loc%]To confirm your request, please click the button below:[%END%]</p>

<form action="[% path_cgi %]" method="POST">
<fieldset>
<div>
<label for="email">[%|loc%]Your e-mail address:[%END%]</label>
[% IF user.email ~%]
<span id="email">[% user.email %]</span>
<input type="hidden" name="email" value="[% user.email %]" />
[%~ ELSE ~%]
<input id="email" name="email" value="[% email %]" />
[%~ END %]
</div>
<input type="hidden" name="list" value="[% list %]" />
<div>
<input class="MainMenuLinks" type="submit" name="action_signoff"
value="[%|loc(list)%]I unsubscribe from list %1[%END%]" />
</div>
</fieldset>
</form>
[% END %]
<!-- end signoff.tt2 -->
Loading