X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;f=src%2Forg%2Fcacert%2Fgigi%2Fpages%2Faccount%2FChangePasswordPage.java;h=60cfaa0b33ceacd7735685ebad8aca9d690fa6d1;hb=d7ca3ea303443dbe54163c06c2b097c8d14b6e6f;hp=805c72d923958c0297e28134640d4d5dd1942482;hpb=943d8e7ed0ea5a9d56e7e694a3cbd849c52bad16;p=gigi.git diff --git a/src/org/cacert/gigi/pages/account/ChangePasswordPage.java b/src/org/cacert/gigi/pages/account/ChangePasswordPage.java index 805c72d9..60cfaa0b 100644 --- a/src/org/cacert/gigi/pages/account/ChangePasswordPage.java +++ b/src/org/cacert/gigi/pages/account/ChangePasswordPage.java @@ -6,27 +6,25 @@ 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; +import org.cacert.gigi.dbObjects.User; +import org.cacert.gigi.pages.ManagedFormPage; +import org.cacert.gigi.util.AuthorizationContext; -public class ChangePasswordPage extends Page { +public class ChangePasswordPage extends ManagedFormPage { public static final String PATH = "/account/password"; public ChangePasswordPage() { - super("Change Password"); + super("Change Password", ChangeForm.class); } @Override public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - new ChangeForm(req, LoginPage.getUser(req)).output(resp.getWriter(), getLanguage(req), new HashMap()); + new ChangeForm(req, 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); + public boolean isPermitted(AuthorizationContext ac) { + return ac != null && ac.getTarget() instanceof User; } - }