Commit c868d6de authored by Dave Cridland's avatar Dave Cridland Committed by GitHub

Merge pull request #645 from guusdk/OF-777_EmailService-fix

OF-777: email service fixes
parents 25a1741c d50e6cd4
...@@ -2614,7 +2614,7 @@ system.email.info=Use the form below to set the host and port of your email serv ...@@ -2614,7 +2614,7 @@ system.email.info=Use the form below to set the host and port of your email serv
on your mail server. Note, if you choose to enable mail debugging the debug output will be written \ on your mail server. Note, if you choose to enable mail debugging the debug output will be written \
to your appserver's standard out log. to your appserver's standard out log.
system.email.update_success=SMTP settings updated successfully. system.email.update_success=SMTP settings updated successfully.
system.email.update_failure=An error occured. Please verify that you have filled out all required fields \ system.email.update_failure=An error occurred. Please verify that you have filled out all required fields \
correctly and try again. correctly and try again.
system.email.name=SMTP Settings system.email.name=SMTP Settings
system.email.mail_host=Mail Host system.email.mail_host=Mail Host
......
...@@ -39,8 +39,11 @@ ...@@ -39,8 +39,11 @@
Cookie csrfCookie = CookieUtils.getCookie(request, "csrf"); Cookie csrfCookie = CookieUtils.getCookie(request, "csrf");
String csrfParam = ParamUtils.getParameter(request, "csrf"); String csrfParam = ParamUtils.getParameter(request, "csrf");
Map<String,String> errors = new HashMap<String,String>();
if (save) { if (save) {
if (csrfCookie == null || csrfParam == null || !csrfCookie.getValue().equals(csrfParam)) { if (csrfCookie == null || csrfParam == null || !csrfCookie.getValue().equals(csrfParam)) {
errors.put("csrf", "CSRF Failure!");
save = false; save = false;
} }
} }
...@@ -55,7 +58,6 @@ ...@@ -55,7 +58,6 @@
EmailService service = EmailService.getInstance(); EmailService service = EmailService.getInstance();
// Save the email settings if requested // Save the email settings if requested
Map<String,String> errors = new HashMap<String,String>();
if (save) { if (save) {
if (host != null) { if (host != null) {
service.setHost(host); service.setHost(host);
...@@ -234,7 +236,7 @@ ...@@ -234,7 +236,7 @@
</tr> </tr>
</table> </table>
</div> </div>
<input type="hidden" name="csrf" value="${csrf}"/>
<input type="submit" name="save" value="<fmt:message key="system.email.save" />"> <input type="submit" name="save" value="<fmt:message key="system.email.save" />">
<input type="submit" name="test" value="<fmt:message key="system.email.send_test" />"> <input type="submit" name="test" value="<fmt:message key="system.email.send_test" />">
</form> </form>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment