UPD: show the "verified"-status primitive-like for domains.
authorFelix Dörre <felix@dogcraft.de>
Sun, 24 Aug 2014 07:50:57 +0000 (09:50 +0200)
committerFelix Dörre <felix@dogcraft.de>
Sun, 24 Aug 2014 08:23:11 +0000 (10:23 +0200)
doc/tableStructure.sql
src/org/cacert/gigi/Domain.java
src/org/cacert/gigi/pages/account/DomainManagementForm.java

index 2d5fa6c38421d2f304f8d9dc8ef524ae0ed4b88c..cc47b41af473b959773c1624b0855f87141f499e 100644 (file)
@@ -87,7 +87,7 @@ CREATE TABLE `domainPinglog` (
   `when` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
   `configId` int(13) NOT NULL,
   `state` enum('open', 'success', 'failed') NOT NULL,
-  `challenge` varchar(16) NOT NULL,
+  `challenge` varchar(16),
   `result` varchar(255)
 ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
 
index 3eb628aacb0b8f1d47bd07cc56faa05a9289f219..bcc66beb7ea826d31a7fd1ffb86437cba395b474 100644 (file)
@@ -126,4 +126,16 @@ public class Domain {
             throw new GigiApiException(e);
         }
     }
+
+    public boolean isVerified() {
+        try {
+            PreparedStatement ps = DatabaseConnection.getInstance().prepare("SELECT 1 FROM domainPinglog INNER JOIN pingconfig ON pingconfig.id=domainPinglog.configId WHERE domainid=? AND state='success'");
+            ps.setInt(1, id);
+            ResultSet rs = ps.executeQuery();
+            return rs.next();
+        } catch (SQLException e) {
+            e.printStackTrace();
+        }
+        return false;
+    }
 }
index 1ffa33d35816c6d089334ceb6b18cdc89413480b..5df5711456b413de405280dec5caba493634a70c 100644 (file)
@@ -61,7 +61,7 @@ public class DomainManagementForm extends Form {
                 Domain domain = doms[point];
                 vars.put("id", domain.getId());
                 vars.put("domain", domain.getSuffix());
-                vars.put("status", "??");
+                vars.put("status", l.getTranslation(domain.isVerified() ? "verified" : "not verified"));
                 point++;
                 return true;
             }