]> WPIA git - gigi.git/blobdiff - src/club/wpia/gigi/pages/account/ChangePasswordPage.java
upd: rename package name and all references to it
[gigi.git] / src / club / wpia / gigi / pages / account / ChangePasswordPage.java
diff --git a/src/club/wpia/gigi/pages/account/ChangePasswordPage.java b/src/club/wpia/gigi/pages/account/ChangePasswordPage.java
new file mode 100644 (file)
index 0000000..4382300
--- /dev/null
@@ -0,0 +1,30 @@
+package club.wpia.gigi.pages.account;
+
+import java.io.IOException;
+import java.util.HashMap;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import club.wpia.gigi.dbObjects.User;
+import club.wpia.gigi.pages.ManagedFormPage;
+import club.wpia.gigi.util.AuthorizationContext;
+
+public class ChangePasswordPage extends ManagedFormPage {
+
+    public static final String PATH = "/account/password";
+
+    public ChangePasswordPage() {
+        super("Change Password", ChangeForm.class);
+    }
+
+    @Override
+    public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
+        new ChangeForm(req, getUser(req)).output(resp.getWriter(), getLanguage(req), new HashMap<String, Object>());
+    }
+
+    @Override
+    public boolean isPermitted(AuthorizationContext ac) {
+        return ac != null && ac.getTarget() instanceof User;
+    }
+}