X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;f=src%2Forg%2Fcacert%2Fgigi%2Fpages%2Forga%2FCreateOrgForm.java;h=7b69822549d16860cd37da089a967933b0d28f07;hb=5207476641f1bf10637937555a70e5c8bd5979b6;hp=086b3059cc591a6ca8bf66278039b379261cfdb2;hpb=17a15662212d973d12ed4cea3f5eaa9c0d1169ed;p=gigi.git diff --git a/src/org/cacert/gigi/pages/orga/CreateOrgForm.java b/src/org/cacert/gigi/pages/orga/CreateOrgForm.java index 086b3059..7b698225 100644 --- a/src/org/cacert/gigi/pages/orga/CreateOrgForm.java +++ b/src/org/cacert/gigi/pages/orga/CreateOrgForm.java @@ -48,7 +48,7 @@ public class CreateOrgForm extends Form { result = t; o = t.getName(); - cs = new CountrySelector("C", false, t.getState()); + cs = new CountrySelector("C", false, t.getCountry()); st = t.getProvince(); l = t.getCity(); @@ -58,10 +58,10 @@ public class CreateOrgForm extends Form { } @Override - public boolean submit(HttpServletRequest req) throws GigiApiException { + public SubmissionResult submit(HttpServletRequest req) throws GigiApiException { String action = req.getParameter("action"); if (action == null) { - return false; + throw new GigiApiException("No action given."); } if (action.equals("new")) { @@ -69,18 +69,16 @@ public class CreateOrgForm extends Form { checkOrganisationData(req); Organisation ne = new Organisation(o, cs.getCountry(), st, l, email, optionalName, postalAddress, LoginPage.getUser(req)); result = ne; - return true; } else if (action.equals("updateOrganisationData")) { checkOrganisationData(req); result.updateOrgData(email, optionalName, postalAddress); - return true; } else if (action.equals("updateCertificateData")) { checkCertData(req); result.updateCertData(o, cs.getCountry(), st, l); - return true; + } else { + throw new GigiApiException("No valid action given."); } - - return false; + return new RedirectResult(ViewOrgPage.DEFAULT_PATH + "/" + result.getId()); } private void checkOrganisationData(HttpServletRequest req) throws GigiApiException { @@ -120,10 +118,6 @@ public class CreateOrgForm extends Form { return parameter.trim(); } - public Organisation getResult() { - return result; - } - @Override protected void outputContent(PrintWriter out, Language l, Map vars) { vars.put("O", o);