From: Benny Baumann Date: Fri, 10 Jun 2016 15:39:46 +0000 (+0200) Subject: Merge "fix: pootle does not like translations in line number 0" X-Git-Url: https://code.wpia.club/?p=gigi.git;a=commitdiff_plain;h=a398544a86bdffe288ded209d9cc6b19df199964;hp=80a10fc035deef98dc2e839ca11b68ab1a6ff80e Merge "fix: pootle does not like translations in line number 0" --- diff --git a/src/org/cacert/gigi/dbObjects/User.java b/src/org/cacert/gigi/dbObjects/User.java index e831dfcc..b72af84f 100644 --- a/src/org/cacert/gigi/dbObjects/User.java +++ b/src/org/cacert/gigi/dbObjects/User.java @@ -45,6 +45,8 @@ public class User extends CertificateOwner { public static final int ADULT_AGE = 18; + public static final boolean POJAM_ENABLED = false; + protected User(GigiResultSet rs) { super(rs.getInt("id")); updateName(rs); @@ -138,8 +140,14 @@ public class User extends CertificateOwner { } public boolean canAssure() { - if ( !CalendarUtil.isOfAge(dob, POJAM_AGE)) { // PoJAM - return false; + if (POJAM_ENABLED) { + if ( !CalendarUtil.isOfAge(dob, POJAM_AGE)) { // PoJAM + return false; + } + } else { + if ( !CalendarUtil.isOfAge(dob, ADULT_AGE)) { + return false; + } } if (getAssurancePoints() < 100) { return false; @@ -200,7 +208,7 @@ public class User extends CertificateOwner { * @return the maximal points @ */ public int getMaxAssurePoints() { - if ( !CalendarUtil.isOfAge(dob, ADULT_AGE)) { + if ( !CalendarUtil.isOfAge(dob, ADULT_AGE) && POJAM_ENABLED) { return 10; // PoJAM } diff --git a/tests/org/cacert/gigi/util/TestNotary.java b/tests/org/cacert/gigi/util/TestNotary.java index d9f190e0..22f75b23 100644 --- a/tests/org/cacert/gigi/util/TestNotary.java +++ b/tests/org/cacert/gigi/util/TestNotary.java @@ -85,7 +85,9 @@ public class TestNotary extends ManagedTest { for (int i = 0; i < users.length; i++) { assuranceFail(assurer, users[i], -1, "test-notary", "2014-01-01"); assuranceFail(assurer, users[i], 11, "test-notary", "2014-01-01"); - Notary.assure(assurer, users[i], users[i].getName(), users[i].getDoB(), 10, "test-notary", "2014-01-01", AssuranceType.FACE_TO_FACE); + if (User.POJAM_ENABLED) { + Notary.assure(assurer, users[i], users[i].getName(), users[i].getDoB(), 10, "test-notary", "2014-01-01", AssuranceType.FACE_TO_FACE); + } assuranceFail(assurer, users[i], 10, "test-notary", "2014-01-01"); } }