]> WPIA git - gigi.git/blobdiff - src/org/cacert/gigi/pages/account/domain/EditDomain.java
upd: rename package name and all references to it
[gigi.git] / src / org / cacert / gigi / pages / account / domain / EditDomain.java
diff --git a/src/org/cacert/gigi/pages/account/domain/EditDomain.java b/src/org/cacert/gigi/pages/account/domain/EditDomain.java
deleted file mode 100644 (file)
index f7df490..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-package org.cacert.gigi.pages.account.domain;
-
-import java.io.IOException;
-import java.util.HashMap;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.cacert.gigi.GigiApiException;
-import org.cacert.gigi.dbObjects.CertificateOwner;
-import org.cacert.gigi.dbObjects.Domain;
-import org.cacert.gigi.output.template.Form;
-import org.cacert.gigi.output.template.Form.CSRFException;
-import org.cacert.gigi.pages.LoginPage;
-import org.cacert.gigi.pages.ManagedMultiFormPage;
-
-public class EditDomain extends ManagedMultiFormPage {
-
-    public static final String PATH = "/account/domains/";
-
-    public EditDomain() {
-        super("Domain");
-    }
-
-    @Override
-    public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
-        CertificateOwner u = LoginPage.getAuthorizationContext(req).getTarget();
-        String pi = req.getPathInfo();
-        if (pi.length() - PATH.length() <= 0) {
-            return;
-        }
-        Form.printFormErrors(req, resp.getWriter());
-        int i = Integer.parseInt(pi.substring(PATH.length()));
-        Domain d;
-        try {
-            d = Domain.getById(i);
-        } catch (IllegalArgumentException e) {
-            resp.getWriter().println(getLanguage(req).getTranslation("Access denied"));
-            return;
-        }
-        if (d == null || u.getId() != d.getOwner().getId()) {
-            resp.getWriter().println(getLanguage(req).getTranslation("Access denied"));
-            return;
-        }
-        new DomainPinglogForm(req, d).output(resp.getWriter(), getLanguage(req), new HashMap<String, Object>());
-        try {
-            new PingConfigForm(req, d).output(resp.getWriter(), getLanguage(req), new HashMap<String, Object>());
-        } catch (GigiApiException e) {
-            e.format(resp.getWriter(), getLanguage(req));
-        }
-
-    }
-
-    @Override
-    public Form getForm(HttpServletRequest req) throws CSRFException {
-        String pi = req.getPathInfo();
-        if (pi.length() - PATH.length() <= 0) {
-            return null;
-        }
-        if (req.getParameter("configId") != null) {
-            return Form.getForm(req, DomainPinglogForm.class);
-        } else {
-            return Form.getForm(req, PingConfigForm.class);
-        }
-    }
-
-}