]> WPIA git - gigi.git/blobdiff - src/org/cacert/gigi/util/Notary.java
Move the "dbObject"s to their own package.
[gigi.git] / src / org / cacert / gigi / util / Notary.java
index 89fb5bc0837e90f4274272bfb621371f033461c9..46a2c3ade06881a8d8acf32e663f7b15d774dd9f 100644 (file)
@@ -4,8 +4,8 @@ import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 
-import org.cacert.gigi.User;
 import org.cacert.gigi.database.DatabaseConnection;
+import org.cacert.gigi.dbObjects.User;
 
 public class Notary {
 
@@ -35,7 +35,7 @@ public class Notary {
             }
             rs.close();
             if ( !assurer.canAssure()) {
-                return AssuranceResult.CANNOT_ASSURE;
+                return AssuranceResult.NO_ASSURER;
             }
         } catch (SQLException e) {
             e.printStackTrace();
@@ -44,7 +44,7 @@ public class Notary {
     }
 
     public enum AssuranceResult {
-        CANNOT_ASSURE("You cannot assure."), ALREADY_ASSUREED("You already assured this person."), CANNOT_ASSURE_SELF("Cannot assure myself."), ASSURANCE_SUCCEDED(""), ASSUREE_CHANGED("Person details changed. Please start over again."), POINTS_OUT_OF_RANGE("Points out of range.");
+        NO_ASSURER("You are not an assurer."), ALREADY_ASSUREED("You already assured this person."), CANNOT_ASSURE_SELF("Cannot assure myself."), ASSURANCE_SUCCEDED(""), ASSUREE_CHANGED("Person details changed. Please start over again."), POINTS_OUT_OF_RANGE("Points out of range.");
 
         private final String message;
 
@@ -77,6 +77,8 @@ public class Notary {
         ps.setString(4, location);
         ps.setString(5, date);
         ps.execute();
+        assurer.invalidateMadeAssurances();
+        target.invalidateReceivedAssurances();
         return AssuranceResult.ASSURANCE_SUCCEDED;
     }
 }