X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;ds=inline;f=src%2Forg%2Fcacert%2Fgigi%2Fpages%2Fmain%2FRegisterPage.java;fp=src%2Forg%2Fcacert%2Fgigi%2Fpages%2Fmain%2FRegisterPage.java;h=e2e2a49397b347a6eb54e687e5fde3095ddf1a95;hb=943d8e7ed0ea5a9d56e7e694a3cbd849c52bad16;hp=e243c2875f92e826ac4ed21acb5adbaabed894b7;hpb=05e8bb67c3407cbecbb528db16b1608d8534907e;p=gigi.git diff --git a/src/org/cacert/gigi/pages/main/RegisterPage.java b/src/org/cacert/gigi/pages/main/RegisterPage.java index e243c287..e2e2a493 100644 --- a/src/org/cacert/gigi/pages/main/RegisterPage.java +++ b/src/org/cacert/gigi/pages/main/RegisterPage.java @@ -13,47 +13,44 @@ import org.cacert.gigi.pages.Page; public class RegisterPage extends Page { - private static final String SIGNUP_PROCESS = "signupProcess"; - public static final String PATH = "/register"; - - public RegisterPage() { - super("Register"); - } - - @Override - public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - Signup s = new Signup(req); - outputGet(req, resp, s); - } - - private void outputGet(HttpServletRequest req, HttpServletResponse resp, Signup s) throws IOException { - PrintWriter out = resp.getWriter(); - HashMap vars = new HashMap(); - getDefaultTemplate().output(out, getLanguage(req), vars); - s.output(out, getLanguage(req), vars); - } - - @Override - public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException { - Signup s = Form.getForm(req, Signup.class); - if (s == null) { - resp.getWriter().println(translate(req, "CSRF token check failed.")); - } else if (s.submit(resp.getWriter(), req)) { - HttpSession hs = req.getSession(); - hs.setAttribute(SIGNUP_PROCESS, null); - resp.getWriter().println( - translate(req, "Your information has been submitted" - + " into our system. You will now be sent an email with a web link," - + " you need to open that link in your web browser within 24 hours" - + " or your information will be removed from our system!")); - return; - } - - outputGet(req, resp, s); - } - - @Override - public boolean needsLogin() { - return false; - } + private static final String SIGNUP_PROCESS = "signupProcess"; + + public static final String PATH = "/register"; + + public RegisterPage() { + super("Register"); + } + + @Override + public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { + Signup s = new Signup(req); + outputGet(req, resp, s); + } + + private void outputGet(HttpServletRequest req, HttpServletResponse resp, Signup s) throws IOException { + PrintWriter out = resp.getWriter(); + HashMap vars = new HashMap(); + getDefaultTemplate().output(out, getLanguage(req), vars); + s.output(out, getLanguage(req), vars); + } + + @Override + public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException { + Signup s = Form.getForm(req, Signup.class); + if (s == null) { + resp.getWriter().println(translate(req, "CSRF token check failed.")); + } else if (s.submit(resp.getWriter(), req)) { + HttpSession hs = req.getSession(); + hs.setAttribute(SIGNUP_PROCESS, null); + resp.getWriter().println(translate(req, "Your information has been submitted" + " into our system. You will now be sent an email with a web link," + " you need to open that link in your web browser within 24 hours" + " or your information will be removed from our system!")); + return; + } + + outputGet(req, resp, s); + } + + @Override + public boolean needsLogin() { + return false; + } }