- AssuranceResult success = Notary.assure(Page.getUser(req), assuree, Integer.parseInt(req.getParameter("points")), req.getParameter("location"), req.getParameter("date"));
- if (success != AssuranceResult.ASSURANCE_SUCCEDED) {
- outputError(out, req, success.getMessage());
+ Notary.assure(assurer, assuree, assureeName, dob, pointsI, location, req.getParameter("date"), type);
+ if (aword != null && !aword.equals("")) {
+ String systemToken = RandomToken.generateToken(32);
+ int id = assuree.generatePasswordResetTicket(Page.getUser(req), systemToken, aword);
+ try {
+ Language l = Language.getInstance(assuree.getPreferredLocale());
+ StringBuffer body = new StringBuffer();
+ body.append(l.getTranslation("Hi,") + "\n\n");
+ body.append(l.getTranslation("A password reset was triggered. If you did a password reset by assurance, please enter your secret password using this form: \nhttps://"));
+ body.append(ServerConstants.getWwwHostNamePortSecure() + PasswordResetPage.PATH);
+ body.append("?id=");
+ body.append(id);
+ body.append("&token=");
+ body.append(URLEncoder.encode(systemToken, "UTF-8"));
+ body.append("\n");
+ body.append("\n");
+ body.append(l.getTranslation("Best regards"));
+ body.append("\n");
+ body.append(l.getTranslation("SomeCA.org Support!"));
+ Sendmail.getInstance().sendmail(assuree.getEmail(), "[SomeCA.org] " + l.getTranslation("Password reset by assurance"), body.toString(), "support@cacert.org", null, null, null, null, false);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }