Add a hint what the "Request reping" is used for on the email page
authorINOPIAE <m.maengel@inopiae.de>
Wed, 8 Feb 2017 08:27:58 +0000 (09:27 +0100)
committerINOPIAE <m.maengel@inopiae.de>
Thu, 9 Feb 2017 06:37:54 +0000 (07:37 +0100)
fixes issue #56

Change-Id: I518082eb4c95beed01b846690264d174757790dd

src/org/cacert/gigi/pages/account/mail/MailManagementForm.java
src/org/cacert/gigi/pages/account/mail/MailManagementForm.templ
src/org/cacert/gigi/util/TimeConditions.java
util-testing/org/cacert/gigi/pages/Manager.java
util-testing/org/cacert/gigi/pages/Manager.templ

index 87087b7..5d0ce7e 100644 (file)
@@ -14,6 +14,7 @@ import org.cacert.gigi.output.template.Form;
 import org.cacert.gigi.output.template.IterableDataset;
 import org.cacert.gigi.output.template.Template;
 import org.cacert.gigi.pages.Page;
+import org.cacert.gigi.util.TimeConditions;
 
 public class MailManagementForm extends Form {
 
@@ -86,6 +87,7 @@ public class MailManagementForm extends Form {
 
         };
         vars.put("emails", ds);
+        vars.put("maxMonth", TimeConditions.getInstance().getEmailPingMonths());
         t.output(out, l, vars);
     }
 }
index 10d4432..2449bca 100644 (file)
@@ -8,7 +8,7 @@
   <tr>
     <td><?=_Default?></td>
     <td><?=_Status?></td>
-    <td><?=_Last successful verification?></td>
+    <td><?=_Last successful verification?>*</td>
     <td><?=_Address?></td>
     <td><?=_Delete?></td>
     <td><?=_Request reping?></td>
@@ -23,5 +23,8 @@
                <td><button class="btn btn-primary" type="submit" name="reping" value="<?=$id?>"><?=_Request reping?></button></td>
        </tr>
  <? } ?>
+  <tr>
+    <td colspan=6>* <?=_To issue certificates for an email address listed above, the last successful verification of the email address must not be older than ${maxMonth} months. Use "Request Reping" to start a new email verification.?></td>
+  </tr>
   </tbody>
 </table>
index dce9800..b851dc9 100644 (file)
@@ -16,11 +16,14 @@ public class TimeConditions {
 
     private final int verificationMaxAgeMonths;
 
+    private final int emailPingMonths;
+
     private TimeConditions(Properties ppts) {
         testValidMonths = Integer.parseInt(ppts.getProperty("time.testValidMonths", "12"));
         reverificationDays = Integer.parseInt(ppts.getProperty("time.reverificationDays", "90"));
         verificationFreshMonths = Integer.parseInt(ppts.getProperty("time.verificationFreshMonths", "39"));
         verificationMaxAgeMonths = Integer.parseInt(ppts.getProperty("time.verificationMaxAgeMonths", "24"));
+        emailPingMonths = Integer.parseInt(ppts.getProperty("time.emailPingMonths", "6"));
     }
 
     public static synchronized TimeConditions getInstance() {
@@ -76,4 +79,13 @@ public class TimeConditions {
         return verificationMaxAgeMonths;
     }
 
+    /**
+     * Maximum time in months that an email address can be used for creating
+     * client certificates before a reping is neccessary
+     * 
+     * @return the configured number of months
+     */
+    public int getEmailPingMonths() {
+        return emailPingMonths;
+    }
 }
index 3244bb4..38b45f6 100644 (file)
@@ -501,6 +501,7 @@ public class Manager extends Page {
         vars.put("reverificationDays", TimeConditions.getInstance().getVerificationLimitDays());
         vars.put("verificationFreshMonths", TimeConditions.getInstance().getVerificationMonths());
         vars.put("verificationMaxAgeMonths", TimeConditions.getInstance().getVerificationMaxAgeMonths());
+        vars.put("emailPingMonths", TimeConditions.getInstance().getEmailPingMonths());
 
         form.output(resp.getWriter(), getLanguage(req), vars);
     }
index 8556d68..dcd6883 100644 (file)
@@ -125,4 +125,10 @@ Maximum time that a verification is accepted
 </td><td>
 <?=$verificationMaxAgeMonths?> months
 </td></tr>
+
+<tr><td>
+Maximum time before reping of email address needed
+</td><td>
+<?=$emailPingMonths?> months
+</td></tr>
 </table>