From: <ssk...@vh...> - 2006-01-30 16:24:54
|
Author: sskracic Date: 2006-01-30 17:20:00 +0100 (Mon, 30 Jan 2006) New Revision: 1083 Modified: trunk/ccm-core/application.xml trunk/ccm-core/src/com/arsdigita/formbuilder/actions/SimpleEmailListener.java Log: Set the meaningful From: address, if an unregistered user is submitting a formbuilder form. Modified: trunk/ccm-core/application.xml =================================================================== --- trunk/ccm-core/application.xml 2006-01-17 17:09:52 UTC (rev 1082) +++ trunk/ccm-core/application.xml 2006-01-30 16:20:00 UTC (rev 1083) @@ -3,7 +3,7 @@ name="ccm-core" prettyName="Core" version="6.3.1" - release="1" + release="2" webapp="ROOT" buildHooks="build-hooks.xml"> <ccm:dependencies> Modified: trunk/ccm-core/src/com/arsdigita/formbuilder/actions/SimpleEmailListener.java =================================================================== --- trunk/ccm-core/src/com/arsdigita/formbuilder/actions/SimpleEmailListener.java 2006-01-17 17:09:52 UTC (rev 1082) +++ trunk/ccm-core/src/com/arsdigita/formbuilder/actions/SimpleEmailListener.java 2006-01-30 16:20:00 UTC (rev 1083) @@ -157,9 +157,10 @@ String subject = p.interpolate(m_subject); String from = (String) p.interpolate("::user.email::"); - if (null == from) { + + if (null == from) { User user = (User) Kernel.getContext().getParty(); - if( null == user ) { + if (null == user) { from = Mail.getConfig().getDefaultFrom(); } else { from = user.getPrimaryEmail().getEmailAddress(); @@ -168,7 +169,12 @@ StringBuffer body = new StringBuffer(); - body.append(from); + if (from == null || from.trim().length() == 0) { + body.append("Anonymous visitor"); + from = Kernel.getSecurityConfig().getAdminContactEmail(); + } else { + body.append(from); + } body.append(" submitted the following:\n\n"); String submit = null; |