X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;ds=sidebyside;f=src%2Forg%2Fcacert%2Fgigi%2Fpages%2Fwot%2FAssuranceForm.java;h=4b6f9232a3f4f16dfdebae65b3518b823ec74212;hb=10b057b8efd04b26a1c53c0bc0e734d3aa06a6b8;hp=38b4ae0654acc1497ceccccedf5c47ad4a644269;hpb=3e123160ad59a2e1162518923965562ff947b6d1;p=gigi.git diff --git a/src/org/cacert/gigi/pages/wot/AssuranceForm.java b/src/org/cacert/gigi/pages/wot/AssuranceForm.java index 38b4ae06..4b6f9232 100644 --- a/src/org/cacert/gigi/pages/wot/AssuranceForm.java +++ b/src/org/cacert/gigi/pages/wot/AssuranceForm.java @@ -12,7 +12,7 @@ import org.cacert.gigi.GigiApiException; import org.cacert.gigi.dbObjects.Name; import org.cacert.gigi.dbObjects.User; import org.cacert.gigi.localisation.Language; -import org.cacert.gigi.output.Form; +import org.cacert.gigi.output.template.Form; import org.cacert.gigi.output.template.Template; import org.cacert.gigi.pages.Page; import org.cacert.gigi.util.Notary; @@ -25,6 +25,10 @@ public class AssuranceForm extends Form { private Date dob; + private String location = ""; + + private String date = ""; + private static final Template templ; static { templ = new Template(AssuranceForm.class.getResource("AssuranceForm.templ")); @@ -34,7 +38,7 @@ public class AssuranceForm extends Form { super(hsr); this.assuree = assuree; assureeName = this.assuree.getName(); - dob = this.assuree.getDob(); + dob = this.assuree.getDoB(); } SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); @@ -48,13 +52,21 @@ public class AssuranceForm extends Form { res.put("nameExplicit", assuree.getName()); res.put("name", assuree.getName().toString()); res.put("maxpoints", assuree.getMaxAssurePoints()); - res.put("dob", sdf.format(assuree.getDob())); - res.put("dobFmt2", sdf2.format(assuree.getDob())); + res.put("dob", sdf.format(assuree.getDoB())); + res.put("dobFmt2", sdf2.format(assuree.getDoB())); + res.put("location", location); + res.put("date", date); templ.output(out, l, res); } @Override public boolean submit(PrintWriter out, HttpServletRequest req) { + location = req.getParameter("location"); + date = req.getParameter("date"); + if (date == null || location == null) { + outputError(out, req, "You need to enter location and date!"); + } + if ( !"1".equals(req.getParameter("certify")) || !"1".equals(req.getParameter("rules")) || !"1".equals(req.getParameter("CCAAgreed")) || !"1".equals(req.getParameter("assertion"))) { outputError(out, req, "You failed to check all boxes to validate" + " your adherence to the rules and policies of CAcert"); @@ -75,7 +87,7 @@ public class AssuranceForm extends Form { return false; } try { - Notary.assure(Page.getUser(req), assuree, assureeName, dob, pointsI, req.getParameter("location"), req.getParameter("date")); + Notary.assure(Page.getUser(req), assuree, assureeName, dob, pointsI, location, req.getParameter("date")); return true; } catch (GigiApiException e) { e.format(out, Page.getLanguage(req));