]> WPIA git - gigi.git/blobdiff - src/org/cacert/gigi/util/Notary.java
add: factor out country selection and type-restrict internal api.
[gigi.git] / src / org / cacert / gigi / util / Notary.java
index cba93aba8ee78f92a6b40b00252d8bc7c55eaf6b..ed1ce238c93d144cd04da9ca42230df36600a25b 100644 (file)
@@ -87,7 +87,7 @@ public class Notary {
             throw gae;
         }
         if (date == null || date.equals("")) {
-            gae.mergeInto(new GigiApiException("You must enter the date when you met the assuree."));
+            gae.mergeInto(new GigiApiException("You must enter the date when you met the applicant."));
         } else {
             try {
                 Date d = DateSelector.getDateFormat().parse(date);
@@ -128,7 +128,7 @@ public class Notary {
             }
 
             if ( !assuree.getDoB().equals(dob)) {
-                gae.mergeInto(new GigiApiException("The person you are assuring changed his personal details."));
+                gae.mergeInto(new GigiApiException("The person you are verifying changed his personal details."));
             }
 
             if (awarded < 0) {
@@ -156,7 +156,7 @@ public class Notary {
             } else if (type == AssuranceType.TTP_ASSISTED) {
                 assureTTP(assurer, assuree, assureeName, awarded, location, date);
             } else {
-                throw new GigiApiException(SprintfCommand.createSimple("Unknown Assurance type: {0}", type.toString()));
+                throw new GigiApiException(SprintfCommand.createSimple("Unknown Verification type: {0}", type.toString()));
             }
             assurer.invalidateMadeAssurances();
             assuree.invalidateReceivedAssurances();
@@ -239,6 +239,9 @@ public class Notary {
     }
 
     public synchronized static void assureAll(User assurer, User assuree, DayDate dob, int awarded, String location, String date, AssuranceType type, Name[] toAssure) throws GigiApiException {
+        if (toAssure.length == 0) {
+            throw new GigiApiException("You must confirm at least one name to verify an account.");
+        }
         boolean[] hadLessThan50Points = new boolean[toAssure.length];
         boolean hadTotalLessThan100 = assuree.getAssurancePoints() < 100;
         for (int i = 0; i < toAssure.length; i++) {