X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;f=src%2Forg%2Fcacert%2Fgigi%2Fpages%2Fadmin%2Fsupport%2FFindDomainPage.java;h=ac3d9f73e61fbc3bd2962e5473d5f228063afd80;hb=7a9b55470434239a3dd260005932e9e6096a9921;hp=8f0830bb09eac8c9694b4323a8308faad5588092;hpb=db3ef5c43aa600a5bba60e57efd92932d2323d8c;p=gigi.git diff --git a/src/org/cacert/gigi/pages/admin/support/FindDomainPage.java b/src/org/cacert/gigi/pages/admin/support/FindDomainPage.java index 8f0830bb..ac3d9f73 100644 --- a/src/org/cacert/gigi/pages/admin/support/FindDomainPage.java +++ b/src/org/cacert/gigi/pages/admin/support/FindDomainPage.java @@ -1,5 +1,8 @@ package org.cacert.gigi.pages.admin.support; +import org.cacert.gigi.dbObjects.CertificateOwner; +import org.cacert.gigi.dbObjects.Organisation; +import org.cacert.gigi.dbObjects.User; import org.cacert.gigi.output.template.Form; import org.cacert.gigi.pages.OneFormPage; import org.cacert.gigi.util.AuthorizationContext; @@ -14,7 +17,14 @@ public class FindDomainPage extends OneFormPage { @Override public String getSuccessPath(Form f) { - return SupportUserDetailsPage.PATH + ((FindDomainForm) f).getUserId(); + CertificateOwner res = ((FindDomainForm) f).getRes(); + if (res instanceof User) { + return SupportUserDetailsPage.PATH + res.getId(); + } else if (res instanceof Organisation) { + return "/support/domain/" + res.getId(); + } else { + throw new Error("Unknown owner type."); + } } @Override