diff --git a/app/classes/Framadate/CollectMail.php b/app/classes/Framadate/CollectMail.php new file mode 100644 index 0000000000000000000000000000000000000000..155bee404e593372df88c4c2b5884415f48078b8 --- /dev/null +++ b/app/classes/Framadate/CollectMail.php @@ -0,0 +1,35 @@ +<?php +/** + * This software is governed by the CeCILL-B license. If a copy of this license + * is not distributed with this file, you can obtain one at + * http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt + * + * Authors of STUdS (initial project): Guilhem BORGHESI (borghesi@unistra.fr) and Raphaël DROZ + * Authors of Framadate/OpenSondage: Framasoft (https://github.com/framasoft) + * + * ============================= + * + * Ce logiciel est régi par la licence CeCILL-B. Si une copie de cette licence + * ne se trouve pas avec ce fichier vous pouvez l'obtenir sur + * http://www.cecill.info/licences/Licence_CeCILL-B_V1-fr.txt + * + * Auteurs de STUdS (projet initial) : Guilhem BORGHESI (borghesi@unistra.fr) et Raphaël DROZ + * Auteurs de Framadate/OpenSondage : Framasoft (https://github.com/framasoft) + */ + +namespace Framadate; + +/** + * Class CollectMail + * + * Is used to specify the poll's edition permissions. + * @TODO : wait to use the SplEnum + * + * @package Framadate + */ +class CollectMail { // extends SplEnum + const NO_COLLECT = 0; + const COLLECT = 1; + const COLLECT_REQUIRED = 2; + const COLLECT_REQUIRED_VERIFIED = 3; +} diff --git a/app/classes/Framadate/Form.php b/app/classes/Framadate/Form.php index b6a5270ce9f7234f3ddfcbc90b63f768573216fe..2f62012b0357f450c2463506d3da7ae34855ba5b 100644 --- a/app/classes/Framadate/Form.php +++ b/app/classes/Framadate/Form.php @@ -83,8 +83,8 @@ class Form public $results_publicly_visible; /** - * If true, the users can leave an email address while voting in the poll - * @var boolean + * Tells if voters email addresses are collected or not. + * @var \Framadate\CollectMail */ public $collect_users_mail; @@ -93,8 +93,10 @@ class Form */ private $choices; - public function __construct(){ + public function __construct() + { $this->editable = Editable::EDITABLE_BY_ALL; + $this->collect_users_mail = CollectMail::NO_COLLECT; $this->clearChoices(); } diff --git a/app/classes/Framadate/Repositories/PollRepository.php b/app/classes/Framadate/Repositories/PollRepository.php index 2e3f68a37a8f54bfe381cf28d0ad12aa53af5f61..f44a928132ebdda92a6f978ab59c3809fccbc34f 100644 --- a/app/classes/Framadate/Repositories/PollRepository.php +++ b/app/classes/Framadate/Repositories/PollRepository.php @@ -28,7 +28,7 @@ class PollRepository extends AbstractRepository { 'password_hash' => $form->password_hash, 'results_publicly_visible' => $form->results_publicly_visible ? 1 : 0, 'ValueMax' => $form->ValueMax, - 'collect_users_mail' => $form->collect_users_mail? 1 : 0, + 'collect_users_mail' => ($form->collect_users_mail >= 0 && $form->collect_users_mail <= 3) ? $form->collect_users_mail : 0, ]); } diff --git a/app/classes/Framadate/Services/InputService.php b/app/classes/Framadate/Services/InputService.php index 904fe95eaaa1edc1e7fd8a22e452c2ce4126fc9c..81dfe25c3ca1ae4a8f3da1eb344baba089a1be06 100644 --- a/app/classes/Framadate/Services/InputService.php +++ b/app/classes/Framadate/Services/InputService.php @@ -69,23 +69,23 @@ class InputService { public function filterMail($mail) { /////////////////////////////////////////////////////////////////////////////////////// // formatting - + $mail = trim($mail); - + /////////////////////////////////////////////////////////////////////////////////////// // e-mail validation - + $resultat = FALSE; - + $validator = new EmailValidator(); - + if ($validator->isValid($mail, new RFCValidation())) { $resultat = $mail; } - + /////////////////////////////////////////////////////////////////////////////////////// // return - + return $resultat; } @@ -115,6 +115,10 @@ class InputService { return filter_var($editable, FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => EDITABLE_CHOICE_REGEX]]); } + public function filterCollectMail($collectMail) { + return filter_var($collectMail, FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => COLLECT_MAIL_CHOICE_REGEX]]); + } + public function filterComment($comment) { $comment = str_replace("\r\n", "\n", $comment); return $this->returnIfNotBlank($comment); diff --git a/app/inc/constants.php b/app/inc/constants.php index 065fbf21c28b3127f8abe591e5f309f279559c2f..92f2b5e7cd2272cff7915347a668bd04390323bd 100644 --- a/app/inc/constants.php +++ b/app/inc/constants.php @@ -33,6 +33,7 @@ const CHOICE_REGEX = '/^[ 012]$/'; const BOOLEAN_REGEX = '/^(on|off|true|false|1|0)$/i'; const BOOLEAN_TRUE_REGEX = '/^(on|true|1)$/i'; const EDITABLE_CHOICE_REGEX = '/^[0-2]$/'; +const COLLECT_MAIL_CHOICE_REGEX = '/^[0-3]$/'; const BASE64_REGEX = '/^[A-Za-z0-9]+$/'; const MD5_REGEX = '/^[A-Fa-f0-9]{32}$/'; diff --git a/create_poll.php b/create_poll.php index de51c3be30a29eaf2681f9cc6f520be168189d43..7b1c0a938b10fa04f948f3eca013ef2c10f30a9c 100644 --- a/create_poll.php +++ b/create_poll.php @@ -58,8 +58,6 @@ if ($goToStep2) { $use_ValueMax = isset($_POST['use_ValueMax']) ? $inputService->filterBoolean($_POST['use_ValueMax']) : false; $ValueMax = $use_ValueMax === true ? $inputService->filterValueMax($_POST['ValueMax']) : null; - $collect_users_mail = isset($_POST['collect_users_mail']) ? $inputService->filterBoolean($_POST['collect_users_mail']) : false; - $use_customized_url = isset($_POST['use_customized_url']) ? $inputService->filterBoolean($_POST['use_customized_url']) : false; $customized_url = $use_customized_url === true ? $inputService->filterId($_POST['customized_url']) : null; $name = $inputService->filterName($_POST['name']); @@ -70,7 +68,7 @@ if ($goToStep2) { $receiveNewComments = isset($_POST['receiveNewComments']) ? $inputService->filterBoolean($_POST['receiveNewComments']) : false; $hidden = isset($_POST['hidden']) ? $inputService->filterBoolean($_POST['hidden']) : false; $use_password = filter_input(INPUT_POST, 'use_password', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => BOOLEAN_REGEX]]); - $collect_users_mail = isset($_POST['collect_users_mail']) ? $inputService->filterBoolean($_POST['collect_users_mail']) : false; + $collect_users_mail = $inputService->filterCollectMail($_POST['collect_users_mail']); $use_password = filter_input(INPUT_POST, 'use_password', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => BOOLEAN_REGEX]]); $password = isset($_POST['password']) ? $_POST['password'] : null; $password_repeat = isset($_POST['password_repeat']) ? $_POST['password_repeat'] : null; diff --git a/js/app/create_poll.js b/js/app/create_poll.js index 2793e9887049bf0ed39480056a331b7fd6501cfc..295ab47639169c16eecc65c3620b1d7f3be00a4d 100644 --- a/js/app/create_poll.js +++ b/js/app/create_poll.js @@ -81,8 +81,8 @@ $(document).ready(function () { /** * Hide/Show Warning collect_users_mail + editable by all */ - $("#collect_users_mail").change(function(){ - if ($(this).prop("checked") && $("input[name='editable']:checked").val() == 1) { + $("input[name='collect_users_mail']").change(function(){ + if (($("input[name='collect_users_mail']:checked").val() != 0) && ($("input[name='editable']:checked").val() == 1)) { $("#collect_warning").removeClass("hidden"); } else { $("#collect_warning").addClass("hidden"); @@ -90,7 +90,7 @@ $(document).ready(function () { }); $("input[name='editable']").change(function(){ - if ($("#collect_users_mail").prop("checked") && $("input[name='editable']:checked").val() == 1) { + if ($("input[name='collect_users_mail']:checked").val() != 0 && $("input[name='editable']:checked").val() == 1) { $("#collect_warning").removeClass("hidden"); } else { $("#collect_warning").addClass("hidden"); diff --git a/locale/en.json b/locale/en.json index ea52d83aa0b2349c389f1a7ac713cc2d52cc8840..1cdefed03e14a74386bdd504ea245e2add35b491 100644 --- a/locale/en.json +++ b/locale/en.json @@ -309,6 +309,7 @@ "Vote no for": "Vote \"no\" for", "Vote yes for": "Vote \"yes\" for", "Votes of the poll": "Votes", + "Warning : anyone can access to your email address after voting": "Warning : anyone can access to your email address after voting", "polled user": "polled user", "polled users": "polled users" }, @@ -320,6 +321,7 @@ "Cancel the name edit": "Cancel the name edit", "Cancel the rules edit": "Cancel the rules edit", "Cancel the title edit": "Cancel the title edit", + "Collect of the polled users email addresses": "Collect of the polled users email addresses", "Collecting the polled users emails": "Collecting the polled users email addresses", "Edit the description": "Edit the description", "Edit the email adress": "Edit the email address", @@ -331,6 +333,7 @@ "Expiration date": "Expiry date", "Export to CSV": "Export to CSV", "Initiator of the poll": "Creator of the poll", + "No collect of the polled users email addresses": "No collect of the polled users email addresses", "No password": "No password", "Only votes are protected": "Only votes are protected", "Password protected": "Password protected", @@ -352,14 +355,23 @@ "Save the new title": "Save the new title", "Simple editor": "Simple editor", "Title": "Title of the poll", + "Voters email adresses are not collected": "Voters email adresses are not collected", + "Voters email adresses are collected": "Voters email adresses are collected", + "Voters email adresses are collected and required": "Voters email adresses are collected and required", + "Voters email adresses are collected, required and verified": "Voters email adresses are collected, required and verified", "Votes and comments are locked": "Votes and comments are locked", - "Votes protected by password": "Votes protected by password" + "Votes protected by password": "Votes protected by password", }, "Step 1": { "All voters can modify any vote": "All voters can modify any vote", "Collect the polled users email addresses": "Collecting the polled users' email addresses", - "Collect users email": "Collect users' email addresses", + "Collect users email": "Collect users email", + "Collect voters email": "Collect voters email", "Customize the URL": "Customize the URL", + "Email addresses are collected but not required": "Email addresses are collected but not required", + "Email addresses are not collected": "Email addresses are not collected", + "Email addresses are required": "Email addresses are required", + "Email addresses are required and verified": "Email addresses are required and verified", "Go to step 2": "Go to step 2", "Limit the amount of voters per option": "Limit the amount of voters per option", "More informations here:": "More informations here:", @@ -384,6 +396,7 @@ "ValueMax instructions": "votes per option", "Voters can modify their vote themselves": "Voters can modify their vote themselves", "Votes cannot be modified": "Votes cannot be modified", + "Warning : anyone can access to the polled users's email addresses.": "Warning : anyone can access to the polled users's email addresses.", "Warning: anyone can access the polled users email addresses since all voters can modify any vote. You should restrict permission rules.": "Warning: Anyone can see the polled users' email addresses since all voters can modify any vote. You should restrict permission rules.", "You are in the poll creation section.": "You are in the poll creation section.", "You can enable or disable the editor at will.": "You can enable or disable the editor at will." @@ -442,6 +455,7 @@ "Back to the poll": "Back to the poll", "Choice added": "Choice added", "Collect the emails of the polled users for the choice": "Collect the emails of the polled users for the choice", + "Collect the emails of the polled users for this column": "Collect the emails of the polled users for this column", "Column removed": "Column deleted", "Column's adding": "Adding a column", "Comment deleted": "Comment deleted", @@ -473,12 +487,12 @@ "remove a column or a line with": "remove a column or a line with" }, "display_mails": { - "No one voted 'If need be' to this option.": "No one voted \"If need be\" for this option.", - "No one voted 'No' to this option.": "No one voted \"No\" for this option.", - "No one voted 'Yes' to this option.": "No one voted \"Yes\" for this option.", - "People who have answered 'If need be' to this option have left these email addresses:": "Email addresses of all users who voted \"If need be\" for this option:", - "People who have answered 'No' to this option have left these email addresses:": "Email addresses of all users who voted \"No\" for this option:", - "People who have answered 'Yes' to this option have left these email addresses:": "Email addresses of all users who voted \"Yes\" for this option:" + "People who have answered 'If need be' to this option have left those email addresses :": "People who have answered 'If need be' to this option have left those email addresses :", + "People who have answered 'If need be' to this option have not left any email addresses.": "People who have answered 'If need be' to this option have not left any email addresses.", + "People who have answered 'No' to this option have left those email addresses :": "People who have answered 'No' to this option have left those email addresses :", + "People who have answered 'No' to this option have not left any email addresses.": "People who have answered 'No' to this option have not left any email addresses.", + "People who have answered 'Yes' to this option have left those email addresses :": "People who have answered 'Yes' to this option have left those email addresses :", + "People who have answered 'Yes' to this option have not left any email addresses.": "People who have answered 'Yes' to this option have not left any email addresses." }, "studs": { "Adding the vote succeeded": "Vote added", diff --git a/tpl/create_poll.tpl b/tpl/create_poll.tpl index 696024f9ffc63137dbc6d0b33d957a934a81fe5f..05efe44d0f527a44f25f8f691ced838355bf6c9e 100644 --- a/tpl/create_poll.tpl +++ b/tpl/create_poll.tpl @@ -325,23 +325,34 @@ </div> </div> </div> - + {* Collect users email *} - <div class="form-group"> - <label for="collect_mail" class="col-sm-4 control-label"> - {__('Step 1', 'Collect users email')} + <div class="form-group"> + <label for="poll_id" class="col-sm-4 control-label"> + {__('Step 1', 'Collect voters email')} </label> - <div class="col-sm-8"> - <div class="checkbox"> + <div class="radio"> + <label> + <input type="radio" name="collect_users_mail" id="no_collect" {if $collect_users_mail==constant("Framadate\CollectMail::NO_COLLECT")}checked{/if} value="{constant("Framadate\CollectMail::NO_COLLECT")}"> + {__('Step 1', 'Email addresses are not collected')} + </label> <label> - <input type="checkbox" name="collect_users_mail" - id="collect_users_mail"> - {__('Step 1', "Collect the polled users email addresses")} + <input type="radio" name="collect_users_mail" {if $collect_users_mail==constant("Framadate\CollectMail::COLLECT")}checked{/if} value="{constant("Framadate\CollectMail::COLLECT")}"> + {__('Step 1', 'Email addresses are collected but not required')} + </label> + <label> + <input type="radio" name="collect_users_mail" {if $collect_users_mail==constant("Framadate\CollectMail::COLLECT_REQUIRED")}checked{/if} value="{constant("Framadate\CollectMail::COLLECT_REQUIRED")}"> + {__('Step 1', 'Email addresses are required')} + </label> + <label> + <input type="radio" disabled name="collect_users_mail" {if $collect_users_mail==constant("Framadate\CollectMail::COLLECT_REQUIRED_VERIFIED")}checked{/if} value="{constant("Framadate\CollectMail::COLLECT_REQUIRED_VERIFIED")}"> + {__('Step 1', 'Email addresses are required and verified')} </label> </div> </div> + </div> <div id="collect_warning" class="hidden"> <div class="col-sm-offset-4 col-sm-8"> @@ -349,12 +360,12 @@ </div> </div> </div> - + </div> {* END div.form-group *} - + </div> {* END div.collapse *} - - + + <p class="text-right"> <button name="{$goToStep2}" value="{$poll_type}" type="submit" class="btn btn-success">{__('Step 1', 'Go to step 2')}</button> diff --git a/tpl/part/poll_info.tpl b/tpl/part/poll_info.tpl index 20eb57a5e942bb1791b960fec4706a737068a2ab..3de7245cdbc7af37dcf4b8d0ba603f287513bfb3 100644 --- a/tpl/part/poll_info.tpl +++ b/tpl/part/poll_info.tpl @@ -233,9 +233,19 @@ </div> </div> <div id="collect_users_mail"> - {if $poll->collect_users_mail} - <p><span class="glyphicon glyphicon-envelope"> </span> {__('PollInfo', 'Collecting the polled users emails')}</p> - {/if} + {if $poll->collect_users_mail == constant("Framadate\CollectMail::NO_COLLECT")} + {$txt=__('PollInfo', 'Voters email adresses are not collected')} + {else if $poll->collect_users_mail == constant("Framadate\CollectMail::COLLECT")} + {$txt=__('PollInfo', 'Voters email adresses are collected')} + {else if $poll->collect_users_mail == constant("Framadate\CollectMail::COLLECT_REQUIRED")} + {$txt=__('PollInfo', 'Voters email adresses are collected and required')} + {else if $poll->collect_users_mail == constant("Framadate\CollectMail::COLLECT_REQUIRED_VERIFIED")} + {$txt=__('PollInfo', 'Voters email adresses are collected, required and verified')} + {else} + {$txt='Error'} + {/if} + <p><span class="glyphicon glyphicon-envelope"> </span> {$txt|html}</p> + </div> {/if} </div> diff --git a/tpl/part/vote_table_classic.tpl b/tpl/part/vote_table_classic.tpl index aeda5fc0f6396141320c063d9cc29fe76708bbf1..6ce6b38ef970a26cda8d53a112bf3d466b5676ed 100644 --- a/tpl/part/vote_table_classic.tpl +++ b/tpl/part/vote_table_classic.tpl @@ -30,7 +30,7 @@ class="btn btn-link btn-sm remove-column" title="{__('adminstuds', 'Remove the column')} {$slot->title|html}"> <i class="glyphicon glyphicon-remove text-danger"></i><span class="sr-only">{__('Generic', 'Remove')}</span> </a> - {if $poll->collect_users_mail} + {if $poll->collect_users_mail != constant("Framadate\CollectMail::NO_COLLECT")} <a href="{poll_url id=$admin_poll_id admin=true action='collect_mail' action_value=($headersDCount)}" class="btn btn-link btn-sm collect-mail" title="{__('adminstuds', 'Collect the emails of the polled users for the choice')} {$slot->title|html}"> @@ -68,8 +68,8 @@ <span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span> <input type="hidden" name="edited_vote" value="{$vote->uniqId}"/> <input type="text" id="name" name="name" value="{$vote->name|html}" class="form-control" title="{__('Generic', 'Your name')}" placeholder="{__('Generic', 'Your name')}" /> - {if $poll->collect_users_mail} - <input type="email" required id="mail" name="mail" value="{$vote->mail|html}" class="form-control" title="{__('Generic', 'Your email address')}" placeholder="{__('Generic', 'Your email address')}" /> + {if $poll->collect_users_mail != constant("Framadate\CollectMail::NO_COLLECT")} + <input type="email" {if $poll->collect_users_mail != constant("Framadate\CollectMail::COLLECT")} required {/if} id="mail" name="mail" value="{$vote->mail|html}" class="form-control" title="{__('Generic', 'Your email address')}" placeholder="{__('Generic', 'Your email address')}" /> {/if} </div> </td> @@ -112,13 +112,13 @@ {elseif !$hidden} {* Voted line *} <tr> - <th class="bg-info">{$vote->name|html} + <th class="bg-info" {if $accessGranted && $admin && $vote->mail}title="{$vote->mail|html}"{/if}>{$vote->name|html} {if $active && !$expired && $accessGranted && ( $poll->editable == constant('Framadate\Editable::EDITABLE_BY_ALL') or $admin or ($poll->editable == constant('Framadate\Editable::EDITABLE_BY_OWN') && $editedVoteUniqueId == $vote->uniqId) - ) && $slots gt 4 + ) && $slots|count gt 4 } <span class="edit-username-left"> <a href="{if $admin}{poll_url id=$poll->admin_id vote_id=$vote->uniqId admin=true}{else}{poll_url id=$poll->id vote_id=$vote->uniqId}{/if}" class="btn btn-default btn-sm" title="{__f('Poll results', 'Edit the line: %s', $vote->name)|html}"> @@ -184,11 +184,11 @@ <div class="input-group input-group-sm"> <span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span> <input type="text" id="name" name="name" class="form-control" title="{__('Generic', 'Your name')}" placeholder="{__('Generic', 'Your name')}" /> - {if $poll->collect_users_mail} + {if $poll->collect_users_mail != constant("Framadate\CollectMail::NO_COLLECT")} <input type="email" required id="mail" name="mail" class="form-control" title="{__('Generic', 'Your email address')}" placeholder="{__('Generic', 'Your email address')}" /> {/if} </div> - {if $poll->collect_users_mail && $poll->editable == constant('Framadate\Editable::EDITABLE_BY_ALL')} + {if $poll->collect_users_mail != constant("Framadate\CollectMail::NO_COLLECT") && $poll->editable == constant('Framadate\Editable::EDITABLE_BY_ALL')} <div class="bg-danger"> <i class="glyphicon glyphicon-alert"> </i> <label> {__('Poll results', 'Anyone will be able to access your email address after your vote')} </label> diff --git a/tpl/part/vote_table_date.tpl b/tpl/part/vote_table_date.tpl index ae06a39ac707fb8c88e4f094156360e042621281..0259c464943039b26d04acdd3df57f7b050db8ab 100644 --- a/tpl/part/vote_table_date.tpl +++ b/tpl/part/vote_table_date.tpl @@ -32,7 +32,7 @@ title="{__('adminstuds', 'Remove the column')} {$slot->day|date_format:$date_format.txt_short|html} - {$moment|html}"> <i class="glyphicon glyphicon-remove text-danger"></i><span class="sr-only">{__('Generic', 'Remove')}</span> </a> - {if $poll->collect_users_mail} + {if $poll->collect_users_mail != constant("Framadate\CollectMail::NO_COLLECT")} <a href="{poll_url id=$admin_poll_id admin=true action='collect_mail' action_value=($headersDCount)}" class="btn btn-link btn-sm collect-mail" title="{__('adminstuds', 'Collect the emails of the polled users for the choice')} {$slot->day|date_format:$date_format.txt_short|html} - {$moment|html}"> @@ -112,9 +112,9 @@ <span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span> <input type="hidden" name="edited_vote" value="{$vote->uniqId}"/> <input type="text" id="name" name="name" value="{$vote->name|html}" class="form-control" title="{__('Generic', 'Your name')}" placeholder="{__('Generic', 'Your name')}" /> - {if $poll->collect_users_mail} - <input type="email" required id="mail" name="mail" value="{$vote->mail|html}" class="form-control" title="{__('Generic', 'Your email address')}" placeholder="{__('Generic', 'Your email address')}" /> - {/if} + {if $poll->collect_users_mail != constant("Framadate\CollectMail::NO_COLLECT")} + <input type="email" {if $poll->collect_users_mail != constant("Framadate\CollectMail::COLLECT")} required {/if} id="mail" name="mail" value="{$vote->mail|html}" class="form-control" title="{__('Generic', 'Your email address')}" placeholder="{__('Generic', 'Your email address')}" /> + {/if} </div> </td> @@ -162,7 +162,7 @@ <tr> {* Voted line *} - <th class="bg-info">{$vote->name|html} + <th class="bg-info" {if $accessGranted && $admin}title="{$vote->mail|html}"{/if}>{$vote->name|html} {if $active && !$expired && $accessGranted && ( $poll->editable == constant('Framadate\Editable::EDITABLE_BY_ALL') @@ -239,11 +239,11 @@ <div class="input-group input-group-sm"> <span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span> <input type="text" id="name" name="name" class="form-control" title="{__('Generic', 'Your name')}" placeholder="{__('Generic', 'Your name')}" /> - {if $poll->collect_users_mail} - <input type="email" required id="mail" name="mail" class="form-control" title="{__('Generic', 'Your email address')}" placeholder="{__('Generic', 'Your email address')}" /> + {if $poll->collect_users_mail != constant("Framadate\CollectMail::NO_COLLECT")} + <input type="email" {if $poll->collect_users_mail != constant("Framadate\CollectMail::COLLECT")} required {/if} id="mail" name="mail" class="form-control" title="{__('Generic', 'Your email address')}" placeholder="{__('Generic', 'Your email address')}" /> {/if} </div> - {if $poll->collect_users_mail && $poll->editable == constant('Framadate\Editable::EDITABLE_BY_ALL')} + {if $poll->collect_users_mail != constant("Framadate\CollectMail::NO_COLLECT") && $poll->editable == constant('Framadate\Editable::EDITABLE_BY_ALL')} <div class="bg-danger"> <i class="glyphicon glyphicon-alert"> </i> <label> {__('Poll results', 'Anyone will be able to access your email address after your vote')} </label>