]> WPIA git - gigi.git/blobdiff - src/org/cacert/gigi/dbObjects/User.java
fix: sorts verification entry output by date entered
[gigi.git] / src / org / cacert / gigi / dbObjects / User.java
index 9f5d8e17cf1455a38c3cc7b874300b7f61c55893..e5175694ed1b8ac1083ad728de76740a283d4cc9 100644 (file)
@@ -21,6 +21,7 @@ import org.cacert.gigi.util.DayDate;
 import org.cacert.gigi.util.Notary;
 import org.cacert.gigi.util.PasswordHash;
 import org.cacert.gigi.util.PasswordStrengthChecker;
+import org.cacert.gigi.util.TimeConditions;
 
 /**
  * Represents an acting, assurable, user. Synchronizing on user means: no
@@ -53,7 +54,7 @@ public class User extends CertificateOwner {
     /**
      * Time in months a verification is considered "recent".
      */
-    public static final int VERIFICATION_MONTHS = 39;
+    public static final int VERIFICATION_MONTHS = TimeConditions.getInstance().getVerificationMonths();
 
     private Name preferredName;
 
@@ -322,7 +323,7 @@ public class User extends CertificateOwner {
 
     public synchronized Assurance[] getReceivedAssurances() {
         if (receivedAssurances == null) {
-            try (GigiPreparedStatement query = new GigiPreparedStatement("SELECT * FROM `notary` INNER JOIN `names` ON `names`.`id` = `notary`.`to` WHERE `names`.`uid`=? AND `notary`.`deleted` IS NULL")) {
+            try (GigiPreparedStatement query = new GigiPreparedStatement("SELECT * FROM `notary` INNER JOIN `names` ON `names`.`id` = `notary`.`to` WHERE `names`.`uid`=? AND `notary`.`deleted` IS NULL ORDER BY `when` DESC")) {
                 query.setInt(1, getId());
 
                 GigiResultSet res = query.executeQuery();
@@ -341,7 +342,7 @@ public class User extends CertificateOwner {
 
     public synchronized Assurance[] getMadeAssurances() {
         if (madeAssurances == null) {
-            try (GigiPreparedStatement query = new GigiPreparedStatement("SELECT * FROM notary WHERE `from`=? AND deleted is NULL")) {
+            try (GigiPreparedStatement query = new GigiPreparedStatement("SELECT * FROM notary WHERE `from`=? AND deleted is NULL ORDER BY `when` DESC")) {
                 query.setInt(1, getId());
 
                 try (GigiResultSet res = query.executeQuery()) {