X-Git-Url: https://code.wpia.club/?p=gigi.git;a=blobdiff_plain;f=src%2Forg%2Fcacert%2Fgigi%2Fpages%2Fadmin%2Fsupport%2FFindUserByEmailPage.java;h=9d731712cb9df146018f48ba14c293ba0b8d23a3;hp=15e6933e69a2d9a602f374bde77c2d1598f1402d;hb=abff88a2bf173198fe55c35ead97c9c7cdb5924c;hpb=17a15662212d973d12ed4cea3f5eaa9c0d1169ed diff --git a/src/org/cacert/gigi/pages/admin/support/FindUserByEmailPage.java b/src/org/cacert/gigi/pages/admin/support/FindUserByEmailPage.java index 15e6933e..9d731712 100644 --- a/src/org/cacert/gigi/pages/admin/support/FindUserByEmailPage.java +++ b/src/org/cacert/gigi/pages/admin/support/FindUserByEmailPage.java @@ -30,11 +30,17 @@ public class FindUserByEmailPage extends Page { new FindUserByEmailForm(req).output(resp.getWriter(), Page.getLanguage(req), new HashMap()); } + @Override + public boolean beforePost(HttpServletRequest req, HttpServletResponse resp) throws IOException { + return Form.getForm(req, FindUserByEmailForm.class).submitExceptionProtected(req, resp); + } + @Override public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException { - FindUserByEmailForm form = Form.getForm(req, FindUserByEmailForm.class); - if (form.submitProtected(resp.getWriter(), req)) { - final EmailAddress[] emails = form.getEmails(); + if (Form.printFormErrors(req, resp.getWriter())) { + Form.getForm(req, FindUserByEmailForm.class).output(resp.getWriter(), getLanguage(req), new HashMap()); + } else { + final EmailAddress[] emails = ((FindUserByEmailForm.FindEmailResult) req.getAttribute(Form.SUBMIT_RESULT)).getEmails(); if (emails.length == 1) { resp.sendRedirect(SupportUserDetailsPage.PATH + emails[0].getOwner().getId() + "/"); } else {