X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;f=src%2Forg%2Fcacert%2Fgigi%2Fpages%2Faccount%2FChangePasswordPage.java;h=805c72d923958c0297e28134640d4d5dd1942482;hb=79233cf54bb1cb2193c4b37abdbb8e07fadfec88;hp=fd4c9b2d6382338f952c73b1f443e13c9d213d7f;hpb=e76545ff41616858934e3ed8894bc1de902a039f;p=gigi.git diff --git a/src/org/cacert/gigi/pages/account/ChangePasswordPage.java b/src/org/cacert/gigi/pages/account/ChangePasswordPage.java index fd4c9b2d..805c72d9 100644 --- a/src/org/cacert/gigi/pages/account/ChangePasswordPage.java +++ b/src/org/cacert/gigi/pages/account/ChangePasswordPage.java @@ -6,20 +6,27 @@ import java.util.HashMap; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.cacert.gigi.output.Form; +import org.cacert.gigi.pages.LoginPage; import org.cacert.gigi.pages.Page; public class ChangePasswordPage extends Page { - public static final String PATH = "/account/password"; - - public ChangePasswordPage() { - super("Change Password"); - } - - @Override - public void doGet(HttpServletRequest req, HttpServletResponse resp) - throws IOException { - new ChangeForm().output(resp.getWriter(), getLanguage(req), - new HashMap()); - } + + public static final String PATH = "/account/password"; + + public ChangePasswordPage() { + super("Change Password"); + } + + @Override + public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { + new ChangeForm(req, LoginPage.getUser(req)).output(resp.getWriter(), getLanguage(req), new HashMap()); + } + + @Override + public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException { + ChangeForm f = Form.getForm(req, ChangeForm.class); + f.submit(resp.getWriter(), req); + } }