This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository bow. See https://gitlab.nuiton.org/chorem/bow.git commit 2396abf8c63d76b621e0bd72e566e79c56a98313 Author: Eric Chatellier <chatellier@codelutin.com> Date: Tue Jul 31 15:04:58 2018 +0200 fixes #132: Add honey pot --- .../org/chorem/bow/action/login/RegisterAction.java | 20 +++++++++++++++++++- bow-ui/src/main/webapp/WEB-INF/jsp/register.jsp | 3 ++- bow-ui/src/main/webapp/css/connexion.css | 6 +++++- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/bow-ui/src/main/java/org/chorem/bow/action/login/RegisterAction.java b/bow-ui/src/main/java/org/chorem/bow/action/login/RegisterAction.java index 7706a6d..c58e1be 100644 --- a/bow-ui/src/main/java/org/chorem/bow/action/login/RegisterAction.java +++ b/bow-ui/src/main/java/org/chorem/bow/action/login/RegisterAction.java @@ -2,7 +2,7 @@ * #%L * BOW UI * %% - * Copyright (C) 2010 - 2011 CodeLutin + * Copyright (C) 2010 - 2018 CodeLutin * %% * 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 @@ -50,6 +50,9 @@ public class RegisterAction extends BowBaseAction { protected String email; + // honey pot field + protected String name; + protected String password; protected String repeatPassword; @@ -64,6 +67,14 @@ public class RegisterAction extends BowBaseAction { this.email = email; } + public void setName(String name) { + this.name = name; + } + + public String getName() { + return name; + } + /** @return the password */ public String getPassword() { return password; @@ -112,7 +123,14 @@ public class RegisterAction extends BowBaseAction { public String execute() { String result = INPUT; + // honey pot + if (StringUtils.isNotEmpty(name)) { + addActionError(t("bow.error.internal")); + return INPUT; + } + try { + if (StringUtils.isNotBlank(email)) { email = email.trim(); if (StringUtils.isNotBlank(password)) { diff --git a/bow-ui/src/main/webapp/WEB-INF/jsp/register.jsp b/bow-ui/src/main/webapp/WEB-INF/jsp/register.jsp index 0eee145..65f479b 100644 --- a/bow-ui/src/main/webapp/WEB-INF/jsp/register.jsp +++ b/bow-ui/src/main/webapp/WEB-INF/jsp/register.jsp @@ -2,7 +2,7 @@ #%L BOW UI %% - Copyright (C) 2010 CodeLutin + Copyright (C) 2010 - 2018 CodeLutin %% 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 @@ -38,6 +38,7 @@ <s:actionerror /> <p> <s:textfield key="bow.login.email" name="email" labelposition="top" labelSeparator=" :" /> + <s:textfield name="name" labelposition="top" labelSeparator=" :" cssClass="registerSpecialField" /> <s:password key="bow.login.password" name="password" labelposition="top" labelSeparator=" :" /> <s:password key="bow.login.repeatPassword" name="repeatPassword" labelposition="top" labelSeparator=" :" /> <s:submit key="bow.register.submit" name="submit" /> diff --git a/bow-ui/src/main/webapp/css/connexion.css b/bow-ui/src/main/webapp/css/connexion.css index 75c64ee..8bb294a 100644 --- a/bow-ui/src/main/webapp/css/connexion.css +++ b/bow-ui/src/main/webapp/css/connexion.css @@ -3,7 +3,7 @@ * #%L * BOW UI * %% - * Copyright (C) 2010 CodeLutin + * Copyright (C) 2010 - 2018 CodeLutin * %% * 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 @@ -142,3 +142,7 @@ input[type="submit"]{ #register{ margin-top:20px; } + +#register .registerSpecialField { + display:none; +} \ No newline at end of file -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.