]> WPIA git - gigi.git/blobdiff - src/org/cacert/gigi/pages/wot/AssuranceForm.java
Fix visuals, output maxpoints
[gigi.git] / src / org / cacert / gigi / pages / wot / AssuranceForm.java
index 056a28ab6963714cc5ce0ee5a2222ea10e31991f..b3546fb9a54f330dce38c771688e7db2388cf4d2 100644 (file)
@@ -36,6 +36,11 @@ public class AssuranceForm extends Form {
                HashMap<String, Object> res = new HashMap<String, Object>();
                res.putAll(vars);
                res.put("name", assuree.getName());
+               try {
+                       res.put("maxpoints", assuree.getMaxAssurePoints());
+               } catch (SQLException e) {
+                       e.printStackTrace();
+               }
                res.put("dob", sdf.format(assuree.getDob()));
                templ.output(out, l, res);
        }
@@ -90,19 +95,25 @@ public class AssuranceForm extends Form {
                        // TODO message
                        failed = true;
                }
-               out.println("</div>");
                if (failed) {
+                       out.println("</div>");
                        return false;
                }
                try {
                        boolean success = Notary.assure(LoginPage.getUser(req), assuree,
                                        Integer.parseInt(req.getParameter("points")),
                                        req.getParameter("location"), req.getParameter("date"));
+                       if (!success) {
+                               outputError(out, req,
+                                               "Assurance failed. Maybe user data changed.");
+                       }
+                       out.println("</div>");
                        return success;
                } catch (SQLException e) {
                        e.printStackTrace();
                }
 
+               out.println("</div>");
                return false;
        }
 }