]> WPIA git - gigi.git/blobdiff - src/org/cacert/gigi/pages/wot/AssuranceForm.java
UPD: tighten Up the constructors of "User" and "Domain"
[gigi.git] / src / org / cacert / gigi / pages / wot / AssuranceForm.java
index bb378dfb8e3b41bc70e180ea94fac404ffab733e..81743c90214bc306fc8e501dc7eac5d3eac765bd 100644 (file)
@@ -3,12 +3,14 @@ package org.cacert.gigi.pages.wot;
 import java.io.PrintWriter;
 import java.sql.SQLException;
 import java.text.SimpleDateFormat;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.Map;
 
 import javax.servlet.http.HttpServletRequest;
 
 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;
@@ -20,14 +22,20 @@ public class AssuranceForm extends Form {
 
     private User assuree;
 
+    private Name assureeName;
+
+    private Date dob;
+
     private static final Template templ;
     static {
         templ = new Template(AssuranceForm.class.getResource("AssuranceForm.templ"));
     }
 
-    public AssuranceForm(HttpServletRequest hsr, int assuree) {
+    public AssuranceForm(HttpServletRequest hsr, User assuree) {
         super(hsr);
-        this.assuree = new User(assuree);
+        this.assuree = assuree;
+        assureeName = this.assuree.getName();
+        dob = this.assuree.getDob();
     }
 
     SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
@@ -72,7 +80,7 @@ public class AssuranceForm extends Form {
             return false;
         }
         try {
-            Notary.assure(Page.getUser(req), assuree, pointsI, req.getParameter("location"), req.getParameter("date"));
+            Notary.assure(Page.getUser(req), assuree, assureeName, dob, pointsI, req.getParameter("location"), req.getParameter("date"));
             return true;
         } catch (SQLException e) {
             e.printStackTrace();