diff --git a/src/main/java/org/olat/core/dispatcher/ErrorFeedbackMailer.java b/src/main/java/org/olat/core/dispatcher/ErrorFeedbackMailer.java index eb3b55ea1ddf746fcc2e6fbf0fd87e4cc1d150e4..283f0af80159fa6372abe7470f84d78e143d8b7c 100644 --- a/src/main/java/org/olat/core/dispatcher/ErrorFeedbackMailer.java +++ b/src/main/java/org/olat/core/dispatcher/ErrorFeedbackMailer.java @@ -54,16 +54,6 @@ public class ErrorFeedbackMailer implements Dispatcher { private static final OLog log = Tracing.createLoggerFor(ErrorFeedbackMailer.class); - private static final ErrorFeedbackMailer INSTANCE = new ErrorFeedbackMailer(); - - private ErrorFeedbackMailer() { - // private since singleton - } - - protected static ErrorFeedbackMailer getInstance() { - return INSTANCE; - } - /** * send email to olat support with user submitted error informaition * @@ -71,9 +61,6 @@ public class ErrorFeedbackMailer implements Dispatcher { */ public void sendMail(HttpServletRequest request) { String feedback = request.getParameter("textarea"); - // fxdiff: correctly get the error-number - // was : String errorNr = feedback.substring(0, feedback.indexOf("\n") - - // 1); String errorNr = request.getParameter("fx_errnum"); String username = request.getParameter("username"); try { @@ -84,29 +71,26 @@ public class ErrorFeedbackMailer implements Dispatcher { if (ident == null) ident = im.findIdentityByName("guest"); Collection<String> logFileEntries = LogFileParser.getErrorToday(errorNr, false); - StringBuilder out = new StringBuilder(); + StringBuilder out = new StringBuilder(2048); + out.append(feedback) + .append("\n------------------------------------------\n\n --- from user: ").append(username).append(" ---"); if (logFileEntries != null) { for (Iterator<String> iter = logFileEntries.iterator(); iter.hasNext();) { out.append(iter.next()); } } - String body = feedback + "\n------------------------------------------\n\n --- from user: " + username - + " ---" + out.toString(); - MailBundle bundle = new MailBundle(); bundle.setFromId(ident); bundle.setTo(WebappHelper.getMailConfig("mailError")); - bundle.setContent("Feedback from Error Nr.: " + errorNr, body); + bundle.setContent("Feedback from Error Nr.: " + errorNr, out.toString()); CoreSpringFactory.getImpl(MailManager.class).sendExternMessage(bundle, null); } catch (Exception e) { - // error in recipient email address(es) handleException(request, e); return; } } - private void handleException(HttpServletRequest request, Exception e) { String feedback = request.getParameter("textarea"); String username = request.getParameter("username"); @@ -123,5 +107,4 @@ public class ErrorFeedbackMailer implements Dispatcher { sendMail(request); DispatcherModule.redirectToDefaultDispatcher(response); } - } diff --git a/src/main/java/org/olat/core/gui/exception/_content/exception_page.html b/src/main/java/org/olat/core/gui/exception/_content/exception_page.html index c2c2d6e633fd8c3892e8fb21d29f264431684272..24647e763f84ffe2e651c4b2f0d848af3624a3bb 100644 --- a/src/main/java/org/olat/core/gui/exception/_content/exception_page.html +++ b/src/main/java/org/olat/core/gui/exception/_content/exception_page.html @@ -133,18 +133,12 @@ $r.renderHeaderIncludes() ## BEGIN ERROR AREA <div id="o_main" class="o_exception"> <div class="jumbotron"> - <h1>$r.translate("error.header")</h1> <img src="$r.staticLink("images/transparent.gif")" class="o_visual img-rounded pull-right" alt="$r.translateInAttribute("error.header")" /> - <p> - $r.translate('error.message1') <a href="mailto:${supportaddress}" class="o_link_mailto">${supportaddress}</a> $r.translate('error.message2') - </p> - - <p> - $r.translate('error.report.tell') - </p> + <p>$r.translate('error.message1') <a href="mailto:${supportaddress}" class="o_link_mailto">${supportaddress}</a> $r.translate('error.message2')</p> + <p>$r.translate('error.report.tell')</p> - <form method="get" name="reportform" action="$r.relLink('')error/" id="ofo_366191"> + <form id="ofo_366191" name="reportform" method="post" action="$r.relLink('')error/"> <div class="o_button_group"> #if ($allowBackButton) <a class="btn btn-default" href="javascript:history.back()"> @@ -193,9 +187,7 @@ $r.translate('error.time') ${time} ## END ERROR AREA <a id="o_toplink" href="#o_top" onclick="o_scrollToElement('#o_top');" title="$r.translateInAttribute("top.alt")"> - <i class="o_icon o_icon_top"></i> - $r.translate("top") - </a> + <i class="o_icon o_icon_top"></i> $r.translate("top")</a> </div> ## END #o_main ----- @@ -205,5 +197,4 @@ $r.translate('error.time') ${time} </div> </div> ## ---- END footer --- - -</body> +</body> \ No newline at end of file