]> WPIA git - gigi.git/blobdiff - src/org/cacert/gigi/dbObjects/User.java
Merge "fix: pootle does not like translations in line number 0"
[gigi.git] / src / org / cacert / gigi / dbObjects / User.java
index 99d44a7c3674a1b6fcc329e76be731bc5de90025..b72af84fbc03eb840e82ae69f95e96bd5d503f58 100644 (file)
@@ -39,6 +39,14 @@ public class User extends CertificateOwner {
 
     private final Set<Group> groups = new HashSet<>();
 
+    public static final int MINIMUM_AGE = 16;
+
+    public static final int POJAM_AGE = 14;
+
+    public static final int ADULT_AGE = 18;
+
+    public static final boolean POJAM_ENABLED = false;
+
     protected User(GigiResultSet rs) {
         super(rs.getInt("id"));
         updateName(rs);
@@ -132,8 +140,14 @@ public class User extends CertificateOwner {
     }
 
     public boolean canAssure() {
-        if ( !CalendarUtil.isOfAge(dob, 14)) { // 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;
@@ -194,7 +208,7 @@ public class User extends CertificateOwner {
      * @return the maximal points @
      */
     public int getMaxAssurePoints() {
-        if ( !CalendarUtil.isOfAge(dob, 18)) {
+        if ( !CalendarUtil.isOfAge(dob, ADULT_AGE) && POJAM_ENABLED) {
             return 10; // PoJAM
         }