fix: create config variables for email addresses
authorINOPIAE <m.maengel@inopiae.de>
Tue, 14 Nov 2017 20:18:36 +0000 (21:18 +0100)
committerFelix Dörre <felix@dogcraft.de>
Sun, 19 Nov 2017 12:44:08 +0000 (13:44 +0100)
fixes issue #74

Change-Id: I9761e4c27fd92365cb647b9be8f954c4c02ffba2

config/gigi.properties.template
src/club/wpia/gigi/util/ServerConstants.java

index b90f534..5e939e2 100644 (file)
@@ -21,3 +21,8 @@ time.verificationMaxAgeMonths=24
 
 appName=SomeCA
 appIdentifier=someca
+
+#mail.support=support@wpia.local
+#mail.board=board@wpia.local
+#mail.quiz=quiz@wpia.local
+#mail.quizAdmin=quiz-admin@wpia.local
index 4e2d9c9..e2d459b 100644 (file)
@@ -68,6 +68,14 @@ public class ServerConstants {
 
     private static String appIdentifier = null;
 
+    private static String mailSupport;
+
+    private static String mailBoard;
+
+    private static String mailQuiz;
+
+    private static String mailQuizAdmin;
+
     public static void init(Properties conf) {
         securePort = port = "";
         if ( !conf.getProperty("https.port").equals("443")) {
@@ -93,6 +101,10 @@ public class ServerConstants {
         if (appIdentifier == null) {
             throw new Error("App identifier missing");
         }
+        mailSupport = conf.getProperty("mail.support", "support@" + suffix);
+        mailBoard = conf.getProperty("mail.board", "board@" + suffix);
+        mailQuiz = conf.getProperty("mail.quiz", "quiz@" + suffix);
+        mailQuizAdmin = conf.getProperty("mail.quizAdmin", "quiz-admin@" + suffix);
     }
 
     public static String getHostName(Host h) {
@@ -140,19 +152,19 @@ public class ServerConstants {
     }
 
     public static String getSupportMailAddress() {
-        return "support@" + getSuffix();
+        return mailSupport;
     }
 
     public static String getBoardMailAddress() {
-        return "board@" + getSuffix();
+        return mailBoard;
     }
 
     public static String getQuizMailAddress() {
-        return "quiz@" + getSuffix();
+        return mailQuiz;
     }
 
     public static String getQuizAdminMailAddress() {
-        return "quiz-admin@" + getSuffix();
+        return mailQuizAdmin;
     }
 
     public static String getAppName() {