branch develop updated (78341f5 -> 3dee9e3)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository pollen_1.x. See https://gitlab.nuiton.org/None/pollen_1.x.git from 78341f5 fixes #1300 [Vote] End vote time is not diplayed on vote page new 3fc0d79 fixes #1301: [Comment] Add anti spam filter vote vote and comments new 3dee9e3 fixes #1301 [Comment] Add anti spam filter vote vote and comments The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit 3dee9e30f0cc645623859913af6e5b0c02d41f02 Author: Kevin Morin <morin@codelutin.com> Date: Mon Feb 27 10:33:23 2017 +0100 fixes #1301 [Comment] Add anti spam filter vote vote and comments commit 3fc0d79aab1c9cd988d694e010d48c7a07c3e3ec Author: Eric Chatellier <eric.chatellier@gmail.com> Date: Wed Nov 18 22:22:19 2015 +0100 fixes #1301: [Comment] Add anti spam filter vote vote and comments Summary of changes: .../chorem/pollen/ui/actions/poll/vote/AddComment.java | 17 +++++++++++++++++ .../resources/i18n/pollen-ui-struts2_en_GB.properties | 1 + .../resources/i18n/pollen-ui-struts2_fr_FR.properties | 1 + .../src/main/webapp/WEB-INF/jsp/poll/vote.jsp | 5 ++++- 4 files changed, 23 insertions(+), 1 deletion(-) -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository pollen_1.x. See https://gitlab.nuiton.org/None/pollen_1.x.git commit 3fc0d79aab1c9cd988d694e010d48c7a07c3e3ec Author: Eric Chatellier <eric.chatellier@gmail.com> Date: Wed Nov 18 22:22:19 2015 +0100 fixes #1301: [Comment] Add anti spam filter vote vote and comments --- .../chorem/pollen/ui/actions/poll/vote/AddComment.java | 17 +++++++++++++++++ .../src/main/webapp/WEB-INF/jsp/poll/vote.jsp | 5 ++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/AddComment.java b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/AddComment.java index c823a69..b2eebfc 100644 --- a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/AddComment.java +++ b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/AddComment.java @@ -44,6 +44,8 @@ public class AddComment extends AbstractVoteAction implements Preparable { */ private String commentText; + protected String commentUrl; + public void setCommentText(String commentText) { this.commentText = commentText; } @@ -51,6 +53,14 @@ public class AddComment extends AbstractVoteAction implements Preparable { public String getCommentText() { return commentText; } + + public String getCommentUrl() { + return commentUrl; + } + + public void setCommentUrl(String commentUrl) { + this.commentUrl = commentUrl; + } @Override public boolean isModerate() { @@ -74,6 +84,13 @@ public class AddComment extends AbstractVoteAction implements Preparable { if (StringUtils.isBlank(getCommentText())) { addFieldError("commentText", _("pollen.error.comment.text.empty")); } + + // comment url field is present in form but NOT displayed to user + // if a value is filled, this should a spam robot that try to fill all field + // reject actin in this case + if (StringUtils.isNotBlank(commentUrl)) { + addActionError(t("pollen.error.comment.spam")); + } } @InputConfig(methodName = PREPARE_VOTE_PAGE) diff --git a/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/vote.jsp b/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/vote.jsp index 0d55c93..40a5bd8 100644 --- a/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/vote.jsp +++ b/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/vote.jsp @@ -4,7 +4,7 @@ $Id$ $HeadURL$ %% - Copyright (C) 2009 - 2012 CodeLutin, Tony Chemit + Copyright (C) 2009 - 2015 CodeLutin, Tony Chemit, Chatellier Eric %% This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by @@ -396,6 +396,9 @@ <s:textfield key="commentAuthor" requiredLabel="true" size="78" label="%{getText('pollen.common.commentAuthor')}"/> + <%-- anti spam field --%> + <input type="text" name="commentUrl" class="hidden" /> + <s:url var="configUrl" value='/js/ckeditor.config.js'/> <sjr:ckeditor key="commentText" requiredLabel="true" value="" rows="3" cols="54" width="500" -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository pollen_1.x. See https://gitlab.nuiton.org/None/pollen_1.x.git commit 3dee9e30f0cc645623859913af6e5b0c02d41f02 Author: Kevin Morin <morin@codelutin.com> Date: Mon Feb 27 10:33:23 2017 +0100 fixes #1301 [Comment] Add anti spam filter vote vote and comments --- .../main/java/org/chorem/pollen/ui/actions/poll/vote/AddComment.java | 2 +- .../src/main/resources/i18n/pollen-ui-struts2_en_GB.properties | 1 + .../src/main/resources/i18n/pollen-ui-struts2_fr_FR.properties | 1 + pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/vote.jsp | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/AddComment.java b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/AddComment.java index b2eebfc..2f08bb5 100644 --- a/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/AddComment.java +++ b/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/AddComment.java @@ -89,7 +89,7 @@ public class AddComment extends AbstractVoteAction implements Preparable { // if a value is filled, this should a spam robot that try to fill all field // reject actin in this case if (StringUtils.isNotBlank(commentUrl)) { - addActionError(t("pollen.error.comment.spam")); + addActionError(_("pollen.error.comment.spam")); } } diff --git a/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_en_GB.properties b/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_en_GB.properties index d8ad540..6b67b4a 100644 --- a/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_en_GB.properties +++ b/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_en_GB.properties @@ -174,6 +174,7 @@ pollen.common.votingList=Group pollen.common.weight=Weight pollen.error.choice.empty=%s mandatory pollen.error.comment.name.empty=Comment name mandatory +pollen.error.comment.spam=An error occured pollen.error.comment.text.empty=Comment text mandatory pollen.error.date.format=Date does not match pattern MM/dd/yyyy [hh\:mm] (example 12/31/2000 12\:59) pollen.error.email.invalid=The email doesn't have the good format diff --git a/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_fr_FR.properties b/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_fr_FR.properties index 9a96c2c..0cc2b7c 100644 --- a/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_fr_FR.properties +++ b/pollen-ui-struts2/src/main/resources/i18n/pollen-ui-struts2_fr_FR.properties @@ -176,6 +176,7 @@ pollen.common.votingList=Groupe pollen.common.weight=Poids pollen.error.choice.empty=%s obligatoire pollen.error.comment.name.empty=Nom du commentaire obligatoire +pollen.error.comment.spam=Une erreur s'est produite pollen.error.comment.text.empty=Texte du commentaire obligatoire pollen.error.date.format=La date doit ĂȘtre au format jj/MM/aaaa [hh\:mm] (exemple 31/12/2000 23\:59) pollen.error.email.invalid=Email non valide diff --git a/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/vote.jsp b/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/vote.jsp index 40a5bd8..2533634 100644 --- a/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/vote.jsp +++ b/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/vote.jsp @@ -397,7 +397,7 @@ label="%{getText('pollen.common.commentAuthor')}"/> <%-- anti spam field --%> - <input type="text" name="commentUrl" class="hidden" /> + <input type="text" name="commentUrl" class="hidden" value="" /> <s:url var="configUrl" value='/js/ckeditor.config.js'/> <sjr:ckeditor key="commentText" requiredLabel="true" -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
chorem.org scm