]> WPIA git - gigi.git/blobdiff - src/club/wpia/gigi/pages/wot/VerificationForm.java
add: ensure that for TTPAgent action there is a valid TTPAgent Challenge
[gigi.git] / src / club / wpia / gigi / pages / wot / VerificationForm.java
index 4d92f28ab03b4b66ebf0ad17a5f9a59e6d73cef8..327b6eb530e734615a96f6f1bfbc8b64a3a9a5a7 100644 (file)
@@ -12,6 +12,7 @@ import java.util.Map;
 import javax.servlet.http.HttpServletRequest;
 
 import club.wpia.gigi.GigiApiException;
+import club.wpia.gigi.dbObjects.Group;
 import club.wpia.gigi.dbObjects.Name;
 import club.wpia.gigi.dbObjects.User;
 import club.wpia.gigi.dbObjects.Verification.VerificationType;
@@ -152,6 +153,8 @@ public class VerificationForm extends Form {
                 return true;
             }
         });
+        res.put("ttpinfo", agent.isInGroup(Group.TTP_AGENT) && !agent.hasValidTTPAgentChallenge() && applicant.isInGroup(Group.TTP_APPLICANT));
+
         templ.output(out, l, res);
     }
 
@@ -206,18 +209,19 @@ public class VerificationForm extends Form {
             throw gae;
         }
 
-        LinkedList<Name> toAssure = new LinkedList<Name>();
+        LinkedList<Name> toVerify = new LinkedList<Name>();
         for (int i = 0; i < selected.length; i++) {
             if (selected[i]) {
-                toAssure.add(applicantNames[i]);
+                toVerify.add(applicantNames[i]);
             }
         }
-        if (toAssure.size() == 0) {
+        if (toVerify.size() == 0) {
             throw new GigiApiException("You must confirm at least one name to verify an account.");
         }
 
-        Notary.verifyAll(agent, applicant, dob, pointsI, location, req.getParameter("date"), type, toAssure.toArray(new Name[toAssure.size()]), cs.getCountry());
-        Outputable result = new TranslateCommand("Verification complete.");
+        Notary.verifyAll(agent, applicant, dob, pointsI, location, req.getParameter("date"), type, toVerify.toArray(new Name[toVerify.size()]), cs.getCountry());
+
+        Outputable result = SprintfCommand.createSimple("Verification of user with email address {0} and {1} verification points complete.", applicant.getEmail(), points);
         if (isWithPasswordReset()) {
             Language langApplicant = Language.getInstance(applicant.getPreferredLocale());
             String method = langApplicant.getTranslation("A password reset was triggered. If you did a password reset by verification, please enter your secret password using this form:");