]> WPIA git - gigi.git/commitdiff
upd: use a link-redirector for all external links.
authorFelix Dörre <felix@dogcraft.de>
Fri, 17 Feb 2017 20:14:44 +0000 (21:14 +0100)
committerFelix Dörre <felix@dogcraft.de>
Mon, 20 Feb 2017 23:54:45 +0000 (00:54 +0100)
Change-Id: I4403040fb94e7b6779c14c64bc9398c8f81546b6

32 files changed:
doc/TemplateSyntax.txt
links.txt [new file with mode: 0644]
src/club/wpia/gigi/Gigi.java
src/club/wpia/gigi/Gigi.templ
src/club/wpia/gigi/output/template/SprintfCommand.java
src/club/wpia/gigi/pages/LoginPage.java
src/club/wpia/gigi/pages/LoginPage.templ
src/club/wpia/gigi/pages/MainPage.java
src/club/wpia/gigi/pages/MainPage.templ
src/club/wpia/gigi/pages/MainPageNotLogin.templ
src/club/wpia/gigi/pages/ManagedFormPage.java
src/club/wpia/gigi/pages/ManagedMultiFormPage.java
src/club/wpia/gigi/pages/OneFormPage.java
src/club/wpia/gigi/pages/Page.java
src/club/wpia/gigi/pages/PasswordResetForm.templ
src/club/wpia/gigi/pages/PasswordResetPage.java
src/club/wpia/gigi/pages/account/ChangePasswordForm.templ
src/club/wpia/gigi/pages/account/ChangePasswordPage.java
src/club/wpia/gigi/pages/account/certs/CertificateAdd.java
src/club/wpia/gigi/pages/account/certs/CertificateDisplay.templ
src/club/wpia/gigi/pages/account/certs/CertificateIssueForm.templ
src/club/wpia/gigi/pages/account/certs/Certificates.java
src/club/wpia/gigi/pages/main/RegisterPage.java
src/club/wpia/gigi/pages/main/RegisterPage.templ
src/club/wpia/gigi/pages/main/Signup.java
src/club/wpia/gigi/pages/main/Signup.templ
src/club/wpia/gigi/pages/wot/AssuranceForm.java
src/club/wpia/gigi/pages/wot/AssuranceForm.templ
src/club/wpia/gigi/pages/wot/AssurePage.java
src/club/wpia/gigi/pages/wot/RequestTTPPage.java
src/club/wpia/gigi/pages/wot/RequestTTPPage.templ
src/club/wpia/gigi/util/ServerConstants.java

index f747c2257692a0b2c0e03c53918b44c5d2d6e004..b6979469003b55510af92317d1e1d8238bda1c76 100644 (file)
@@ -13,6 +13,8 @@ Syntax:
        Text may not contain "?>".
        If the text contains "$" or "!'" it is interpreted as "advanced replacement".
           - ${variablename} is interpreted as "output this variable at this point"
        Text may not contain "?>".
        If the text contains "$" or "!'" it is interpreted as "advanced replacement".
           - ${variablename} is interpreted as "output this variable at this point"
+          - $!{variablename} is interpreted as "output this variable unescaped at this point"
+          - !(/link) is interpreted as "output an opening <a>-tag to '/link' at this point" (which must be closed, e.g. using !'</a>', see below)
           - !'literal content' output "literal content" here and do not translate or escape. (literal content may not contain any of: {}'$   )
        Then the whole text than also may not contain "{" and "}".
 
           - !'literal content' output "literal content" here and do not translate or escape. (literal content may not contain any of: {}'$   )
        Then the whole text than also may not contain "{" and "}".
 
diff --git a/links.txt b/links.txt
new file mode 100644 (file)
index 0000000..a160920
--- /dev/null
+++ b/links.txt
@@ -0,0 +1,13 @@
+/policy
+/policy/ToS
+/policy/CPS
+/policy/verification
+/wiki/agentQualifyingChallenge
+/wiki/gigi
+/wiki/CSR
+/wiki/names
+/wiki/lostPassword
+/wiki/goodPassword
+/wiki/verificationHandbook
+/ttp/user
+/ttp/country
index f8f931a63f9abd45a1ebfcaf702c673827de60fb..f30b5aed9f77792320f6060794329c744eccce18 100644 (file)
@@ -81,6 +81,8 @@ import club.wpia.gigi.util.TimeConditions;
 
 public final class Gigi extends HttpServlet {
 
 
 public final class Gigi extends HttpServlet {
 
+    public static final String LINK_HOST = "linkHost";
+
     private class MenuBuilder {
 
         private LinkedList<Menu> categories = new LinkedList<Menu>();
     private class MenuBuilder {
 
         private LinkedList<Menu> categories = new LinkedList<Menu>();
@@ -424,6 +426,11 @@ public final class Gigi extends HttpServlet {
             vars.put("static", isSecure ? staticTemplateVarSecure : staticTemplateVar);
             vars.put("year", Calendar.getInstance().get(Calendar.YEAR));
             vars.put("content", content);
             vars.put("static", isSecure ? staticTemplateVarSecure : staticTemplateVar);
             vars.put("year", Calendar.getInstance().get(Calendar.YEAR));
             vars.put("content", content);
+            if (isSecure) {
+                req.setAttribute(LINK_HOST, ServerConstants.getLinkHostNamePortSecure());
+            } else {
+                req.setAttribute(LINK_HOST, ServerConstants.getLinkHostNamePort());
+            }
             if (currentAuthContext != null) {
                 // TODO maybe move this information into the AuthContext object
                 vars.put("loginMethod", req.getSession().getAttribute(LOGIN_METHOD));
             if (currentAuthContext != null) {
                 // TODO maybe move this information into the AuthContext object
                 vars.put("loginMethod", req.getSession().getAttribute(LOGIN_METHOD));
index 3c011941c48e601c111aedb47b721328f99d79ce..7399b192cb9f80f7135404519dab37814d4892b5 100644 (file)
        <hr/>
                <div id="siteInfo">
             Page info
        <hr/>
                <div id="siteInfo">
             Page info
-                       <!-- <a href="//wiki.cacert.org/FAQ/AboutUs"><?=_About Us?></a> |
-                       <a href="/index.php?id=13"><?=_Donations?></a> |
-                       <a href="//wiki.cacert.org/wiki/CAcertIncorporated"><?=_Association Membership?></a> |
-                       <a href="/policy/PrivacyPolicy.html"><?=_Privacy Policy?></a> |
-                       <a href="/index.php?id=51"><?=_Mission Statement?></a> |
-                       <a href="/index.php?id=11"><?=_Contact Us?></a> --> |
                        ©2016-<?=$year?> SomeCA
                </div>
 
                        ©2016-<?=$year?> SomeCA
                </div>
 
index 6b40c8fd0ab49bd88b6f4c6f4dba4aca934b4dfc..015fe6b6eca353c20d548a2af6c46c4d5c85882d 100644 (file)
@@ -10,6 +10,7 @@ import java.util.Map;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
+import club.wpia.gigi.Gigi;
 import club.wpia.gigi.localisation.Language;
 import club.wpia.gigi.util.HTMLEncoder;
 
 import club.wpia.gigi.localisation.Language;
 import club.wpia.gigi.util.HTMLEncoder;
 
@@ -29,7 +30,7 @@ public final class SprintfCommand implements Translatable {
      *            a string with <code>{0},{1},..</code> as placeholders.
      * @param store
      *            the data to put into the placeholders: ${var}, $!{var},
      *            a string with <code>{0},{1},..</code> as placeholders.
      * @param store
      *            the data to put into the placeholders: ${var}, $!{var},
-     *            !'plain'.
+     *            !'plain', !(/link).
      */
     public SprintfCommand(String text, List<String> store) {
         this.text = text;
      */
     public SprintfCommand(String text, List<String> store) {
         this.text = text;
@@ -38,7 +39,7 @@ public final class SprintfCommand implements Translatable {
 
     private static final String VARIABLE = "\\$!?\\{[a-zA-Z0-9_-]+\\}";
 
 
     private static final String VARIABLE = "\\$!?\\{[a-zA-Z0-9_-]+\\}";
 
-    private static final Pattern processingInstruction = Pattern.compile("(" + VARIABLE + ")|(!'[^{}'\\$]*)'");
+    private static final Pattern processingInstruction = Pattern.compile("(" + VARIABLE + ")|(?:(!'[^{}'\\$]*)')|(?:(!\\([^{})\\$]*)\\))");
 
     /**
      * Creates a new SprintfCommand that is parsed as from template source.
 
     /**
      * Creates a new SprintfCommand that is parsed as from template source.
@@ -59,6 +60,8 @@ public final class SprintfCommand implements Translatable {
                 var.add(group);
             } else if ((group = m.group(2)) != null) {
                 var.add(group);
                 var.add(group);
             } else if ((group = m.group(2)) != null) {
                 var.add(group);
+            } else if ((group = m.group(3)) != null) {
+                var.add(group);
             } else {
                 throw new Error("Regex is broken??");
             }
             } else {
                 throw new Error("Regex is broken??");
             }
@@ -84,6 +87,16 @@ public final class SprintfCommand implements Translatable {
                 Template.outputVar(out, l, vars, var.substring(3, var.length() - 1), true);
             } else if (var.startsWith("!'")) {
                 out.print(var.substring(2));
                 Template.outputVar(out, l, vars, var.substring(3, var.length() - 1), true);
             } else if (var.startsWith("!'")) {
                 out.print(var.substring(2));
+            } else if (var.startsWith("!(")) {
+                String host = (String) vars.get(Gigi.LINK_HOST);
+                if (host == null) {
+                    throw new Error("Unconfigured link-host while interpreting link-syntax.");
+                }
+                if (var.charAt(2) != '/') {
+                    throw new Error("Need an absolute link for the link service.");
+                }
+                String link = "//" + host + var.substring(2);
+                out.print("<a href='" + HTMLEncoder.encodeHTML(link) + "'>");
             } else if (var.startsWith("$")) {
                 Template.outputVar(out, l, vars, var.substring(2, var.length() - 1), false);
             } else {
             } else if (var.startsWith("$")) {
                 Template.outputVar(out, l, vars, var.substring(2, var.length() - 1), false);
             } else {
index 2af51cf71b937d31c9ebd1497985a6a74273e4a6..854fa31b419cc38d10ab7be45065389382cc5658 100644 (file)
@@ -5,7 +5,6 @@ import static club.wpia.gigi.Gigi.*;
 import java.io.IOException;
 import java.io.PrintWriter;
 import java.security.cert.X509Certificate;
 import java.io.IOException;
 import java.io.PrintWriter;
 import java.security.cert.X509Certificate;
-import java.util.HashMap;
 import java.util.Map;
 
 import javax.servlet.http.HttpServletRequest;
 import java.util.Map;
 
 import javax.servlet.http.HttpServletRequest;
@@ -25,8 +24,8 @@ import club.wpia.gigi.pages.main.RegisterPage;
 import club.wpia.gigi.util.AuthorizationContext;
 import club.wpia.gigi.util.PasswordHash;
 import club.wpia.gigi.util.RateLimit;
 import club.wpia.gigi.util.AuthorizationContext;
 import club.wpia.gigi.util.PasswordHash;
 import club.wpia.gigi.util.RateLimit;
-import club.wpia.gigi.util.ServerConstants;
 import club.wpia.gigi.util.RateLimit.RateLimitException;
 import club.wpia.gigi.util.RateLimit.RateLimitException;
+import club.wpia.gigi.util.ServerConstants;
 
 public class LoginPage extends Page {
 
 
 public class LoginPage extends Page {
 
@@ -65,14 +64,14 @@ public class LoginPage extends Page {
         if (req.getHeader("Host").equals(ServerConstants.getSecureHostNamePortSecure())) {
             resp.getWriter().println(getLanguage(req).getTranslation("Authentication with certificate failed. Try another certificate or use a password."));
         } else {
         if (req.getHeader("Host").equals(ServerConstants.getSecureHostNamePortSecure())) {
             resp.getWriter().println(getLanguage(req).getTranslation("Authentication with certificate failed. Try another certificate or use a password."));
         } else {
-            new LoginForm(req).output(resp.getWriter(), getLanguage(req), new HashMap<String, Object>());
+            new LoginForm(req).output(resp.getWriter(), getLanguage(req), getDefaultVars(req));
         }
     }
 
     @Override
     public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {
         if (Form.printFormErrors(req, resp.getWriter())) {
         }
     }
 
     @Override
     public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {
         if (Form.printFormErrors(req, resp.getWriter())) {
-            Form.getForm(req, LoginForm.class).output(resp.getWriter(), getLanguage(req), new HashMap<String, Object>());
+            Form.getForm(req, LoginForm.class).output(resp.getWriter(), getLanguage(req), getDefaultVars(req));
         }
     }
 
         }
     }
 
index b4d04be89f425822596dbb653ca97a45526e043d..f34ffb13077ecec53400161af521fe4acfc33d21 100644 (file)
@@ -4,5 +4,5 @@
 <label for="username"><?=_Email Address?>:</label><input class="form-control" type='text' name="username" required/><br />
 <label for="password"><?=_Pass Phrase?>:</label><input class="form-control" type='password' name='password' required/><br />
 <button type='submit' name="process" value="Login" class="btn btn-primary"><?=_Login?></button><br /><br />
 <label for="username"><?=_Email Address?>:</label><input class="form-control" type='text' name="username" required/><br />
 <label for="password"><?=_Pass Phrase?>:</label><input class="form-control" type='password' name='password' required/><br />
 <button type='submit' name="process" value="Login" class="btn btn-primary"><?=_Login?></button><br /><br />
-<p class='smalltext'><?=_If you are having trouble with your username or password, please visit our !'<a href="http://wiki.cacert.org/wiki/FAQ/LostPasswordOrAccount" target="_new">'wiki page!'</a>' for more information?></p>
+<p class='smalltext'><?=_If you are having trouble with your username or password, please visit our !(/wiki/lostPassword)wiki page!'</a>' for more information?></p>
 </div>
 </div>
index f797a1937d04daadcd24131c6eb09efa3b8b35eb..f55e90d309b113b886a1e0ebd58df32a03c0ad9d 100644 (file)
@@ -1,7 +1,7 @@
 package club.wpia.gigi.pages;
 
 import java.io.IOException;
 package club.wpia.gigi.pages;
 
 import java.io.IOException;
-import java.util.HashMap;
+import java.util.Map;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -18,10 +18,11 @@ public class MainPage extends Page {
 
     @Override
     public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
 
     @Override
     public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
+        Map<String, Object> vars = getDefaultVars(req);
         if (LoginPage.getUser(req) != null) {
         if (LoginPage.getUser(req) != null) {
-            getDefaultTemplate().output(resp.getWriter(), getLanguage(req), new HashMap<String, Object>());
+            getDefaultTemplate().output(resp.getWriter(), getLanguage(req), vars);
         } else {
         } else {
-            notLog.output(resp.getWriter(), getLanguage(req), new HashMap<String, Object>());
+            notLog.output(resp.getWriter(), getLanguage(req), vars);
         }
     }
 
         }
     }
 
index fb87cf5b0c591079df70d7acd8a2165f5bb51b7e..8352e0ccd54f04bceed02aa7bfc0d14b049a486f 100644 (file)
@@ -11,4 +11,3 @@
 <p><?=_Once you have verified your company you will see these menu options. They allow you to issue as many certificates as you like without proving individual email accounts as you like, further more you are able to get your company details on the certificate.?></p>
 <h4><?=_ET Web of Trust?></h4>
 <p><?=_The Web of Trust system ET uses is similar to that many involved with GPG/PGP use, they hold face to face meetings to verify each others photo identities match their GPG/PGP key information. ET differs however in that we have modified things to work within the PKI framework, for you to gain trust in the system you must first locate someone already trusted. The trust person depending how many people they've trusted or meet before will determine how many points they can issue to you. Once you've met up you can show your ID and you will need to fill out a verification form which the person verifying your details must retain for verification reasons.?></p>
 <p><?=_Once you have verified your company you will see these menu options. They allow you to issue as many certificates as you like without proving individual email accounts as you like, further more you are able to get your company details on the certificate.?></p>
 <h4><?=_ET Web of Trust?></h4>
 <p><?=_The Web of Trust system ET uses is similar to that many involved with GPG/PGP use, they hold face to face meetings to verify each others photo identities match their GPG/PGP key information. ET differs however in that we have modified things to work within the PKI framework, for you to gain trust in the system you must first locate someone already trusted. The trust person depending how many people they've trusted or meet before will determine how many points they can issue to you. Once you've met up you can show your ID and you will need to fill out a verification form which the person verifying your details must retain for verification reasons.?></p>
-<p><b><?=_For information about the TTP-assisted-verification program please read !'<a href="//wiki.cacert.org/TTP/TTPuser">https://wiki.cacert.org/TTP/TTPuser</a>' and !'<a href="//wiki.cacert.org/TTP/TTPAL">      https://wiki.cacert.org/TTP/TTPAL</a>'.?></b></p>
index 0a5f030c66d665792e22e91247edb0b571e1f8ca..33c58da24b2daac633850f8e61241707d02ff382 100644 (file)
@@ -13,9 +13,9 @@
 
 <h3><?=_For SomeCA Community Members?></h3>
 
 
 <h3><?=_For SomeCA Community Members?></h3>
 
-<p><?=_Have you passed the SomeCA !'<a href="http://wiki.cacert.org/wiki/AssurerChallenge">'Agent Qualifying Challenge!'</a>' yet??></p>
+<p><?=_Have you passed the SomeCA !(/wiki/agentQualifyingChallenge)'Agent Qualifying Challenge!'</a>' yet??></p>
 
 
-<p><?=_Have you read the !'<a href="/policy/TermsofService.html">'Terms of Service!'</a>' yet??></p>
+<p><?=_Have you read the !(/policy/ToS)Terms of Service!'</a>' yet??></p>
 
 
-<p><?=_For general documentation and help, please visit the SomeCA !'<a href="http://wiki.SomeCA.org">'Wiki Documentation site!'</a>'.?>
-<?=_For specific policies, see the SomeCA !'<a href="/policy/">'Approved Policies page!'</a>'.?></p>
+<p><?=_For general documentation and help, please visit the SomeCA !(/wiki/gigi)Wiki Documentation site!'</a>'.?>
+<?=_For specific policies, see the SomeCA !(/policy)Approved Policies page!'</a>'.?></p>
index b1cd6977400ea0e1f87ccc2ddc8e2142a5bcdbca..1f330cef848f56ddcb7807f1a58b2ac2db2be43e 100644 (file)
@@ -1,7 +1,6 @@
 package club.wpia.gigi.pages;
 
 import java.io.IOException;
 package club.wpia.gigi.pages;
 
 import java.io.IOException;
-import java.util.HashMap;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -21,7 +20,7 @@ public abstract class ManagedFormPage extends Page {
     public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {
         if (Form.printFormErrors(req, resp.getWriter())) {
             Form form = Form.getForm(req, c);
     public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {
         if (Form.printFormErrors(req, resp.getWriter())) {
             Form form = Form.getForm(req, c);
-            form.output(resp.getWriter(), getLanguage(req), new HashMap<String, Object>());
+            form.output(resp.getWriter(), getLanguage(req), getDefaultVars(req));
         }
     }
 
         }
     }
 
index eca378fe11bed17c0b6de482e844d75c042a7f80..30e3c82de8ba27ef1886166dc353bd22568a303f 100644 (file)
@@ -1,7 +1,6 @@
 package club.wpia.gigi.pages;
 
 import java.io.IOException;
 package club.wpia.gigi.pages;
 
 import java.io.IOException;
-import java.util.HashMap;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -18,7 +17,7 @@ public abstract class ManagedMultiFormPage extends Page {
     @Override
     public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {
         if (Form.printFormErrors(req, resp.getWriter())) {
     @Override
     public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {
         if (Form.printFormErrors(req, resp.getWriter())) {
-            getForm(req).output(resp.getWriter(), getLanguage(req), new HashMap<String, Object>());
+            getForm(req).output(resp.getWriter(), getLanguage(req), getDefaultVars(req));
         }
     }
 
         }
     }
 
index a36c9eb63c2bd7f9d8ed406936d0b24d99938e56..91c29908f21bbf1bda18d2f8f9f0e6776971c0fc 100644 (file)
@@ -1,7 +1,6 @@
 package club.wpia.gigi.pages;
 
 import java.io.IOException;
 package club.wpia.gigi.pages;
 
 import java.io.IOException;
-import java.util.HashMap;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -27,14 +26,14 @@ public class OneFormPage extends Page {
     public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {
         Form form = Form.getForm(req, c);
         if (Form.printFormErrors(req, resp.getWriter())) {
     public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {
         Form form = Form.getForm(req, c);
         if (Form.printFormErrors(req, resp.getWriter())) {
-            form.output(resp.getWriter(), getLanguage(req), new HashMap<String, Object>());
+            form.output(resp.getWriter(), getLanguage(req), getDefaultVars(req));
         }
     }
 
     @Override
     public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
         try {
         }
     }
 
     @Override
     public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
         try {
-            c.getConstructor(HttpServletRequest.class).newInstance(req).output(resp.getWriter(), getLanguage(req), new HashMap<String, Object>());
+            c.getConstructor(HttpServletRequest.class).newInstance(req).output(resp.getWriter(), getLanguage(req), getDefaultVars(req));
         } catch (ReflectiveOperationException e) {
             new GigiApiException().format(resp.getWriter(), getLanguage(req));
         }
         } catch (ReflectiveOperationException e) {
             new GigiApiException().format(resp.getWriter(), getLanguage(req));
         }
index 97cd83f7bf0d68ec2ef579bee5742be80c64a022..75d072e8ba0af129c9186a1e208ddeaf5a045f2e 100644 (file)
@@ -3,13 +3,16 @@ package club.wpia.gigi.pages;
 import java.io.IOException;
 import java.net.URL;
 import java.util.Enumeration;
 import java.io.IOException;
 import java.net.URL;
 import java.util.Enumeration;
+import java.util.HashMap;
 import java.util.Locale;
 import java.util.Locale;
+import java.util.Map;
 
 import javax.servlet.ServletRequest;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
 
 
 import javax.servlet.ServletRequest;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
 
+import club.wpia.gigi.Gigi;
 import club.wpia.gigi.PermissionCheckable;
 import club.wpia.gigi.dbObjects.User;
 import club.wpia.gigi.localisation.Language;
 import club.wpia.gigi.PermissionCheckable;
 import club.wpia.gigi.dbObjects.User;
 import club.wpia.gigi.localisation.Language;
@@ -165,4 +168,17 @@ public abstract class Page implements PermissionCheckable {
         return !needsLogin() || ac != null;
     }
 
         return !needsLogin() || ac != null;
     }
 
+    /**
+     * Derive a default variable map for template processing.
+     * 
+     * @param req
+     *            the HTTP-request to derive the map from
+     * @return the map
+     */
+    protected Map<String, Object> getDefaultVars(HttpServletRequest req) {
+        HashMap<String, Object> vars = new HashMap<String, Object>();
+        vars.put(Gigi.LINK_HOST, req.getAttribute(Gigi.LINK_HOST));
+        return vars;
+    }
+
 }
 }
index b43e9152040f4d8403f232122b797c1e422b1db1..b4ac1e9207901fa786135d84e941219f6c0f32bb 100644 (file)
@@ -18,7 +18,7 @@
     <td><input type="password" name="pword2" required></td>
   </tr>
   <tr>
     <td><input type="password" name="pword2" required></td>
   </tr>
   <tr>
-    <td colspan="2"><span class="formMandatory">*</span><?=_Your password is one of many factors to protect your account from unauthorised access. A good password is hard to guess, long, and contains a diverse set of characters. Learn more in our !'<a href="http://wiki.cacert.org/wiki/FAQ" target="_new">'FAQ!'</a>'.?></td>
+    <td colspan="2"><span class="formMandatory">*</span><?=_Your password is one of many factors to protect your account from unauthorised access. A good password is hard to guess, long, and contains a diverse set of characters. Learn more in our !(/wiki/goodPassword)FAQ!'</a>'.?></td>
   </tr>
   <tr>
     <td colspan="2"><input type="submit" name="process" value="<?=_Update Pass Phrase?>"></td>
   </tr>
   <tr>
     <td colspan="2"><input type="submit" name="process" value="<?=_Update Pass Phrase?>"></td>
index 7dc950cacd72fe49eafdf36ac3021a8907052402..3608549cf4ba00249a021f8866f7d1a4998a366c 100644 (file)
@@ -94,14 +94,14 @@ public class PasswordResetPage extends Page {
     public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {
         if (Form.printFormErrors(req, resp.getWriter())) {
             PasswordResetForm form = Form.getForm(req, PasswordResetForm.class);
     public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {
         if (Form.printFormErrors(req, resp.getWriter())) {
             PasswordResetForm form = Form.getForm(req, PasswordResetForm.class);
-            form.output(resp.getWriter(), getLanguage(req), new HashMap<String, Object>());
+            form.output(resp.getWriter(), getLanguage(req), getDefaultVars(req));
         }
     }
 
     @Override
     public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
         try {
         }
     }
 
     @Override
     public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
         try {
-            new PasswordResetForm(req).output(resp.getWriter(), getLanguage(req), new HashMap<String, Object>());
+            new PasswordResetForm(req).output(resp.getWriter(), getLanguage(req), getDefaultVars(req));
         } catch (GigiApiException e) {
             e.format(resp.getWriter(), getLanguage(req));
         }
         } catch (GigiApiException e) {
             e.format(resp.getWriter(), getLanguage(req));
         }
index a0fc45290e0e001805df5a3766102abae4688dcc..c77f7434dad1ae05bf6b5f9b95f202fb007e9cff 100644 (file)
@@ -18,7 +18,7 @@
     <td><input class="form-control" type="password" name="pword2" required></td>
   </tr>
   <tr>
     <td><input class="form-control" type="password" name="pword2" required></td>
   </tr>
   <tr>
-    <td colspan="2"><span class="formMandatory">*</span><?=_Your password is one of many factors to protect your account from unauthorised access. A good password is hard to guess, long, and contains a diverse set of characters. Learn more in our !'<a href="http://wiki.cacert.org/wiki/FAQ" target="_new">'FAQ!'</a>'.?></td>
+    <td colspan="2"><span class="formMandatory">*</span><?=_Your password is one of many factors to protect your account from unauthorised access. A good password is hard to guess, long, and contains a diverse set of characters. Learn more in our !(/wiki/goodPassword)FAQ!'</a>'.?></td>
   </tr>
   <tr>
     <td colspan="2"><input type="submit" name="process" value="<?=_Update Pass Phrase?>"></td>
   </tr>
   <tr>
     <td colspan="2"><input type="submit" name="process" value="<?=_Update Pass Phrase?>"></td>
index 43823002b80a2d449e013f74b001917bcfe73816..46748e32b6ce16a84e32737011a66e6391a82a60 100644 (file)
@@ -1,7 +1,6 @@
 package club.wpia.gigi.pages.account;
 
 import java.io.IOException;
 package club.wpia.gigi.pages.account;
 
 import java.io.IOException;
-import java.util.HashMap;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -20,7 +19,7 @@ public class ChangePasswordPage extends ManagedFormPage {
 
     @Override
     public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
 
     @Override
     public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
-        new ChangeForm(req, getUser(req)).output(resp.getWriter(), getLanguage(req), new HashMap<String, Object>());
+        new ChangeForm(req, getUser(req)).output(resp.getWriter(), getLanguage(req), getDefaultVars(req));
     }
 
     @Override
     }
 
     @Override
index 9694531cfc729d0088e3d7c8dfc45fde4e6eef28..d628c588833e75a0c3311859d0d6935e8ec390a4 100644 (file)
@@ -1,7 +1,6 @@
 package club.wpia.gigi.pages.account.certs;
 
 import java.io.IOException;
 package club.wpia.gigi.pages.account.certs;
 
 import java.io.IOException;
-import java.util.HashMap;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -20,7 +19,7 @@ public class CertificateAdd extends ManagedFormPage {
 
     @Override
     public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
 
     @Override
     public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
-        new CertificateIssueForm(req).output(resp.getWriter(), getLanguage(req), new HashMap<String, Object>());
+        new CertificateIssueForm(req).output(resp.getWriter(), getLanguage(req), getDefaultVars(req));
     }
 
     @Override
     }
 
     @Override
index da3bef21a1099a0aa32fa03e2a02870f3c037063..55086650f65ef6286be91261cf600e50539613dc 100644 (file)
@@ -49,7 +49,7 @@
         <a href='<?=$serial?>.cer'><?=_DER encoded Certificate?></a><br/>
         <a href='<?=$serial?>.cer?install&chain'><?=_Install into browser.?></a><br/>
         <a href='<?=$serial?>.cer?install'><?=_Install into browser (Chrome)?></a>. <?=_Please ensure that the intermediate certificates listed above are installed prior to installing the certificate.?>*<br/><br/>
         <a href='<?=$serial?>.cer'><?=_DER encoded Certificate?></a><br/>
         <a href='<?=$serial?>.cer?install&chain'><?=_Install into browser.?></a><br/>
         <a href='<?=$serial?>.cer?install'><?=_Install into browser (Chrome)?></a>. <?=_Please ensure that the intermediate certificates listed above are installed prior to installing the certificate.?>*<br/><br/>
-        * <?=_For information on how to install the root certificates into the truststore of your browser take a look at the !'<a href="https://wiki.cacert.org/FAQ/CSR">'FAQ!'</a>'!?>
+        * <?=_For information on how to install the root certificates into the truststore of your browser take a look at the !(/wiki/CSR)FAQ!'</a>'!?>
         
     </td>
   </tr>
         
     </td>
   </tr>
index 5fe3de07b6388d2f2a2817e1aaa392ef48e30384..acbfe32309ecccfdaeb463202bc53269772d4cb0 100644 (file)
@@ -1,7 +1,7 @@
 <h3><?=_SomeCA Acceptable Use Policy?></h3>
 <p><?=_I hereby represent that I am fully authorized by the owner of the information contained in the CSR sent to SomeCA to apply for an Digital Certificate for secure and authenticated electronic transactions. I understand that a digital certificate serves to identify the Subscriber for the purposes of electronic communication and that the management of the private keys associated with such certificates is the responsibility of the subscriber's technical staff and/or contractors.?></p>
 
 <h3><?=_SomeCA Acceptable Use Policy?></h3>
 <p><?=_I hereby represent that I am fully authorized by the owner of the information contained in the CSR sent to SomeCA to apply for an Digital Certificate for secure and authenticated electronic transactions. I understand that a digital certificate serves to identify the Subscriber for the purposes of electronic communication and that the management of the private keys associated with such certificates is the responsibility of the subscriber's technical staff and/or contractors.?></p>
 
-<p><?=_CAcert Inc.'s public certification services are governed by a CPS as amended from time to time which is incorporated into this Agreement by reference. The Subscriber will use the SSL Server Certificate in accordance with SomeCA Inc.'s CPS and supporting documentation published at?> <a href="http://www.cacert.org/cps.php">http://www.cacert.org/cps.php</a></p>
+<p><?=_CAcert Inc.'s public certification services are governed by a CPS as amended from time to time which is incorporated into this Agreement by reference. The Subscriber will use the SSL Server Certificate in accordance with SomeCA Inc.'s CPS and supporting documentation published !(/policy/CPS)here!'</a>'.?></p>
 
 <p><?=_If the Subscriber's name and/or domain name registration change the subscriber will immediately inform SomeCA Inc. who shall revoke the digital certificate. When the Digital Certificate expires or is revoked the company will permanently remove the certificate from the server on which it is installed and will not use it for any purpose thereafter. The person responsible for key management and security is fully authorized to install and utilize the certificate to represent this organization's electronic presence.?></p>
 <span id="placeholderName" class="js-hint"><?=$placeholderName?></span>
 
 <p><?=_If the Subscriber's name and/or domain name registration change the subscriber will immediately inform SomeCA Inc. who shall revoke the digital certificate. When the Digital Certificate expires or is revoked the company will permanently remove the certificate from the server on which it is installed and will not use it for any purpose thereafter. The person responsible for key management and security is fully authorized to install and utilize the certificate to represent this organization's electronic presence.?></p>
 <span id="placeholderName" class="js-hint"><?=$placeholderName?></span>
index e2244e99b5a823a75c43a3a12bf8668810371264..07028f6ff217a48bc4b5c0ed081928c1bd5e6756 100644 (file)
@@ -14,12 +14,12 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 import club.wpia.gigi.dbObjects.Certificate;
 import javax.servlet.http.HttpServletResponse;
 
 import club.wpia.gigi.dbObjects.Certificate;
+import club.wpia.gigi.dbObjects.Certificate.CertificateStatus;
+import club.wpia.gigi.dbObjects.Certificate.SubjectAlternateName;
 import club.wpia.gigi.dbObjects.CertificateOwner;
 import club.wpia.gigi.dbObjects.Organisation;
 import club.wpia.gigi.dbObjects.SupportedUser;
 import club.wpia.gigi.dbObjects.User;
 import club.wpia.gigi.dbObjects.CertificateOwner;
 import club.wpia.gigi.dbObjects.Organisation;
 import club.wpia.gigi.dbObjects.SupportedUser;
 import club.wpia.gigi.dbObjects.User;
-import club.wpia.gigi.dbObjects.Certificate.CertificateStatus;
-import club.wpia.gigi.dbObjects.Certificate.SubjectAlternateName;
 import club.wpia.gigi.localisation.Language;
 import club.wpia.gigi.output.TrustchainIterable;
 import club.wpia.gigi.output.template.Form;
 import club.wpia.gigi.localisation.Language;
 import club.wpia.gigi.output.TrustchainIterable;
 import club.wpia.gigi.output.template.Form;
@@ -147,7 +147,7 @@ public class Certificates extends Page implements HandlesMixedRequest {
                 resp.sendError(404);
                 return;
             }
                 resp.sendError(404);
                 return;
             }
-            HashMap<String, Object> vars = new HashMap<>();
+            Map<String, Object> vars = getDefaultVars(req);
             vars.put("serial", URLEncoder.encode(serial, "UTF-8"));
 
             CertificateStatus st = c.getStatus();
             vars.put("serial", URLEncoder.encode(serial, "UTF-8"));
 
             CertificateStatus st = c.getStatus();
index 74f91074a8d6e986c6acae81df797f0691a33180..3a7e5ab6cdf0eefdaf131a3f96fc0102493bd21a 100644 (file)
@@ -1,7 +1,7 @@
 package club.wpia.gigi.pages.main;
 
 import java.io.IOException;
 package club.wpia.gigi.pages.main;
 
 import java.io.IOException;
-import java.util.HashMap;
+import java.util.Map;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -29,8 +29,9 @@ public class RegisterPage extends Page {
     }
 
     private void outputGet(HttpServletRequest req, HttpServletResponse resp, Signup s) throws IOException {
     }
 
     private void outputGet(HttpServletRequest req, HttpServletResponse resp, Signup s) throws IOException {
-        getDefaultTemplate().output(resp.getWriter(), getLanguage(req), new HashMap<String, Object>());
-        s.output(resp.getWriter(), getLanguage(req), new HashMap<String, Object>());
+        Map<String, Object> vars = getDefaultVars(req);
+        getDefaultTemplate().output(resp.getWriter(), getLanguage(req), vars);
+        s.output(resp.getWriter(), getLanguage(req), vars);
     }
 
     @Override
     }
 
     @Override
index fbf084d13321c08d5076bb4faa2bab6c23086288..8bc16fabe1ac5529bdc16689e33332ed8312dcc0 100644 (file)
@@ -6,5 +6,5 @@
 <?=_Your private information will be used for internal procedures only and will not be shared with third parties.?>
 </p>
 <p style="border:dotted 1px #900;padding:0.3em;background-color:#ffe;">
 <?=_Your private information will be used for internal procedures only and will not be shared with third parties.?>
 </p>
 <p style="border:dotted 1px #900;padding:0.3em;background-color:#ffe;">
-<?=_Your password is one of many factors to protect your account from unauthorised access. A good password is hard to guess, long, and contains a diverse set of characters. Learn more in our !'<a href="http://wiki.cacert.org/wiki/FAQ" target="_new">'FAQ!'</a>'.?>
+<?=_Your password is one of many factors to protect your account from unauthorised access. A good password is hard to guess, long, and contains a diverse set of characters. Learn more in our !(/wiki/goodPassword)FAQ!'</a>'.?>
 </p>
 </p>
index 134df159bc13d9db8b479b89dadea7cba17c8a4b..8c070782278a9dafcaca76fd0d1dcdf9d0919454 100644 (file)
@@ -2,6 +2,7 @@ package club.wpia.gigi.pages.main;
 
 import java.io.IOException;
 import java.io.PrintWriter;
 
 import java.io.IOException;
 import java.io.PrintWriter;
+import java.util.Arrays;
 import java.util.HashMap;
 import java.util.Map;
 
 import java.util.HashMap;
 import java.util.Map;
 
@@ -50,7 +51,7 @@ public class Signup extends Form {
 
     @Override
     public void outputContent(PrintWriter out, Language l, Map<String, Object> outerVars) {
 
     @Override
     public void outputContent(PrintWriter out, Language l, Map<String, Object> outerVars) {
-        HashMap<String, Object> vars = new HashMap<String, Object>();
+        HashMap<String, Object> vars = new HashMap<String, Object>(outerVars);
         vars.put("name", ni);
         vars.put("dob", myDoB);
         vars.put("email", HTMLEncoder.encodeHTML(email));
         vars.put("name", ni);
         vars.put("dob", myDoB);
         vars.put("email", HTMLEncoder.encodeHTML(email));
@@ -58,7 +59,7 @@ public class Signup extends Form {
         vars.put("country", country ? " checked=\"checked\"" : "");
         vars.put("regional", regional ? " checked=\"checked\"" : "");
         vars.put("radius", radius ? " checked=\"checked\"" : "");
         vars.put("country", country ? " checked=\"checked\"" : "");
         vars.put("regional", regional ? " checked=\"checked\"" : "");
         vars.put("radius", radius ? " checked=\"checked\"" : "");
-        vars.put("helpOnNames", String.format(l.getTranslation("Help on Names %sin the wiki%s"), "<a href=\"#\" target=\"_blank\">", "</a>"));
+        vars.put("helpOnNames", new SprintfCommand("Help on Names {0}in the wiki{1}", Arrays.asList("!(/wiki/names", "!'</a>")));
         vars.put("csrf", getCSRFToken());
         vars.put("dobmin", User.MINIMUM_AGE + "");
         vars.put("countryCode", cs);
         vars.put("csrf", getCSRFToken());
         vars.put("dobmin", User.MINIMUM_AGE + "");
         vars.put("countryCode", cs);
index f997cc5ccb48211e3f444a47fee5c922ac696b7d..a6ae2b1bbda16ae3ae073adb7be7b36f5faf94b4 100644 (file)
@@ -43,7 +43,7 @@
   </tr>
 
   <tr>
   </tr>
 
   <tr>
-    <td colspan="3"><font color="red">*</font><?=_Your password is one of many factors to protect your account from unauthorised access. A good password is hard to guess, long, and contains a diverse set of characters. Learn more in our !'<a href="http://wiki.cacert.org/wiki/FAQ" target="_new">'FAQ!'</a>'.?></td>
+    <td colspan="3"><font color="red">*</font><?=_Your password is one of many factors to protect your account from unauthorised access. A good password is hard to guess, long, and contains a diverse set of characters. Learn more in our !(/wiki/goodPassword)FAQ!'</a>'.?></td>
   </tr>
   <tr>
     <td colspan="3"><?=_It's possible to get notifications of up and coming events and even just general announcements, untick any notifications you don't wish to receive. For country, regional and radius notifications to work you must choose your location once you've verified your account and logged in.?></td>
   </tr>
   <tr>
     <td colspan="3"><?=_It's possible to get notifications of up and coming events and even just general announcements, untick any notifications you don't wish to receive. For country, regional and radius notifications to work you must choose your location once you've verified your account and logged in.?></td>
@@ -63,7 +63,7 @@
     <td colspan="3"><?=_When you click on next, we will send a confirmation email to the email address you have entered above.?></td>
   </tr>
   <tr>
     <td colspan="3"><?=_When you click on next, we will send a confirmation email to the email address you have entered above.?></td>
   </tr>
   <tr>
-    <td colspan="3"><input type="checkbox" name="tos_agree" value="1"><?=_I agree to the Terms of Service (!'<a href="/policy/TermsOfService.html">'ToS!'</a>').?></td>
+    <td colspan="3"><input type="checkbox" name="tos_agree" value="1"><?=_I agree to the Terms of Service (!(/policy/ToS)ToS!'</a>').?></td>
   </tr>
 
   <tr>
   </tr>
 
   <tr>
index f4bda1ee50eaf39af11c66cfbbeab3cc88661947..7df71a782899a7d877e72b06d813fb2a881d60dd 100644 (file)
@@ -12,9 +12,9 @@ import java.util.Map;
 import javax.servlet.http.HttpServletRequest;
 
 import club.wpia.gigi.GigiApiException;
 import javax.servlet.http.HttpServletRequest;
 
 import club.wpia.gigi.GigiApiException;
+import club.wpia.gigi.dbObjects.Assurance.AssuranceType;
 import club.wpia.gigi.dbObjects.Name;
 import club.wpia.gigi.dbObjects.User;
 import club.wpia.gigi.dbObjects.Name;
 import club.wpia.gigi.dbObjects.User;
-import club.wpia.gigi.dbObjects.Assurance.AssuranceType;
 import club.wpia.gigi.localisation.Language;
 import club.wpia.gigi.output.ArrayIterable;
 import club.wpia.gigi.output.CountrySelector;
 import club.wpia.gigi.localisation.Language;
 import club.wpia.gigi.output.ArrayIterable;
 import club.wpia.gigi.output.CountrySelector;
@@ -106,7 +106,7 @@ public class AssuranceForm extends Form {
 
     @Override
     public void outputContent(PrintWriter out, Language l, Map<String, Object> vars) {
 
     @Override
     public void outputContent(PrintWriter out, Language l, Map<String, Object> vars) {
-        HashMap<String, Object> res = new HashMap<String, Object>();
+        HashMap<String, Object> res = new HashMap<String, Object>(vars);
         res.putAll(vars);
         res.put("names", new ArrayIterable<Name>(assureeNames) {
 
         res.putAll(vars);
         res.put("names", new ArrayIterable<Name>(assureeNames) {
 
index 98479f76a376e5965fe4e1aecc1640f610e08392..a4580c6eeac3e60ee52acf976aca4d9b44da5470 100644 (file)
@@ -1,4 +1,4 @@
-       <table class="table">
+<table class="table">
 <thead>
 <tr><th colspan="2"><?=_Verification Confirmation?></th></tr>
 </thead>
 <thead>
 <tr><th colspan="2"><?=_Verification Confirmation?></th></tr>
 </thead>
        </tr>
        <tr>
                <td><input type="checkbox" name="rules" value="1" required></td>
        </tr>
        <tr>
                <td><input type="checkbox" name="rules" value="1" required></td>
-               <td><?=_I have read and understood the Terms of Service (!'<a href="/policy/TermsOfService.html">'ToS!'</a>'), Verification Policy and the Verification Handbook. I am making this verification subject to and in compliance with the ToS, Verification Policy and Handbook.?></td>
+               <td><?=_I have read and understood the Terms of Service (!(/policy/ToS)ToS!'</a>'), Verification Policy and the Verification Handbook. I am making this verification subject to and in compliance with the ToS, Verification Policy and Handbook.?></td>
        </tr>
        <tr>
                <td><?=_Policy?>: </td>
                <td>
        </tr>
        <tr>
                <td><?=_Policy?>: </td>
                <td>
-                       <a href="/policy/TermsOfService.html" target="_blank"><?=_Terms of Service?></a>
-                        - <a href="/policy/AssurancePolicy.php" target="_blank"><?=_Verification Policy?></a>
-                        - <a href="http://wiki.cacert.org/AssuranceHandbook2" target="_blank"><?=_Verification Handbook?></a>
+                       <?=_!(/policy/ToS)Terms of Service!'</a>'?>
+                        - <?=_!(/policy/verification)Verification Policy!'</a>'?></a>
+                        - <?=_!(/wiki/verificationHandbook)Verification Handbook!'</a>'?></a>
                </td>
        </tr>
        <tr>
                </td>
        </tr>
        <tr>
index cc0c5a07e912bfde7f1d2a12ee3bec4ac0f8842f..f17aad647471563031c81aa6ac18edc557695d73 100644 (file)
@@ -2,7 +2,7 @@ package club.wpia.gigi.pages.wot;
 
 import java.io.IOException;
 import java.io.PrintWriter;
 
 import java.io.IOException;
 import java.io.PrintWriter;
-import java.util.HashMap;
+import java.util.Map;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -34,7 +34,7 @@ public class AssurePage extends Page {
     public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
 
         PrintWriter out = resp.getWriter();
     public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
 
         PrintWriter out = resp.getWriter();
-        HashMap<String, Object> vars = new HashMap<String, Object>();
+        Map<String, Object> vars = getDefaultVars(req);
         vars.put("DoB", ds);
         t.output(out, getLanguage(req), vars);
     }
         vars.put("DoB", ds);
         t.output(out, getLanguage(req), vars);
     }
@@ -59,7 +59,7 @@ public class AssurePage extends Page {
         if (req.getParameter("search") == null) {
             if (Form.printFormErrors(req, out)) {
                 AssuranceForm form = Form.getForm(req, AssuranceForm.class);
         if (req.getParameter("search") == null) {
             if (Form.printFormErrors(req, out)) {
                 AssuranceForm form = Form.getForm(req, AssuranceForm.class);
-                form.output(out, getLanguage(req), new HashMap<String, Object>());
+                form.output(out, getLanguage(req), getDefaultVars(req));
             }
             return;
         }
             }
             return;
         }
@@ -84,7 +84,7 @@ public class AssurePage extends Page {
                     } else {
                         User assuree = User.getById(id);
                         try {
                     } else {
                         User assuree = User.getById(id);
                         try {
-                            new AssuranceForm(req, assuree).output(out, getLanguage(req), new HashMap<String, Object>());
+                            new AssuranceForm(req, assuree).output(out, getLanguage(req), getDefaultVars(req));
                         } catch (GigiApiException e) {
                             e.format(out, Page.getLanguage(req));
                         }
                         } catch (GigiApiException e) {
                             e.format(out, Page.getLanguage(req));
                         }
index a83de6c54dd571f7f71c1ab27c3af17c7003e525..cdabde5ef9ded79e393ed274b9cc42bfc2f6f438 100644 (file)
@@ -1,7 +1,7 @@
 package club.wpia.gigi.pages.wot;
 
 import java.io.IOException;
 package club.wpia.gigi.pages.wot;
 
 import java.io.IOException;
-import java.util.HashMap;
+import java.util.Map;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -29,14 +29,14 @@ public class RequestTTPPage extends Page {
     @Override
     public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {
         if (Form.printFormErrors(req, resp.getWriter())) {
     @Override
     public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {
         if (Form.printFormErrors(req, resp.getWriter())) {
-            Form.getForm(req, RequestTTPForm.class).output(resp.getWriter(), getLanguage(req), new HashMap<String, Object>());
+            Form.getForm(req, RequestTTPForm.class).output(resp.getWriter(), getLanguage(req), getDefaultVars(req));
         }
     }
 
     @Override
     public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
         User u = LoginPage.getUser(req);
         }
     }
 
     @Override
     public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
         User u = LoginPage.getUser(req);
-        HashMap<String, Object> map = new HashMap<String, Object>();
+        Map<String, Object> map = getDefaultVars(req);
         if (u.isInGroup(RequestTTPForm.TTP_APPLICANT)) {
             map.put("inProgress", true);
         } else {
         if (u.isInGroup(RequestTTPForm.TTP_APPLICANT)) {
             map.put("inProgress", true);
         } else {
index c187f0692936f16cacb02fd046b26f13c3b45c01..3fd308640a9ebe94a7db09496f7394c065dbfe52 100644 (file)
 
 <p><?=_In the meanwhile you would need to close this gap with face to face verifications with SomeCA RA Agents. Think not only travelling to populated countries, but also remember that RA Agents may occasionally visit your country or area.?></p>
 
 
 <p><?=_In the meanwhile you would need to close this gap with face to face verifications with SomeCA RA Agents. Think not only travelling to populated countries, but also remember that RA Agents may occasionally visit your country or area.?></p>
 
-<p><?=_If you are interested in the TTP programme, read the pages !'<a href="//wiki.cacert.org/TTP/TTPuser">https://wiki.cacert.org/TTP/TTPuser</a>' for the basic way how the TTP programme works for you, and !'<a href="//wiki.cacert.org/TTP/TTPAL">https://wiki.cacert.org/TTP/TTPAL</a>' whether the TTP programme affects the country where you are located.?> </p>
+<p><?=_If you are interested in the TTP programme, read !(/ttp/user)the pages!'</a>' for the basic way how the TTP programme works for you, and !(/ttp/country)here!'</a>' whether the TTP programme affects the country where you are located.?> </p>
 
 <? if($ttp) { ?>
 
 <? if($ttp) { ?>
-<p><?=_If you want to ask for TTP verifications fill out the missing data and send the request to support@cacert.org to start the process. SomeCA will then inform you about the next steps.?></p>
+<p><?=_If you want to ask for TTP verifications fill out the missing data to start the process. SomeCA will then inform you about the next steps.?></p>
 <?=$form?>
 <? } ?>
 
 <? if($topup) { ?>
 <?=$form?>
 <? } ?>
 
 <? if($topup) { ?>
-<p><?=_As you have already got 2 TTP verifications you can only take part in the TTP TOPUP programme. If you want to ask for the TTP TOPUP programme use the submit button to send the request to support@cacert.org to start the process. SomeCA will then inform you about the next steps.?></p>
+<p><?=_As you have already got 2 TTP verifications you can only take part in the TTP TOPUP programme. If you want to ask for the TTP TOPUP programme use the submit button to start the process. SomeCA will then inform you about the next steps.?></p>
 <form method="post" action="ttp">
        <input type="submit" name="ttptopup" value="<?=_I need a TTP TOPUP?>">
 </form>
 <form method="post" action="ttp">
        <input type="submit" name="ttptopup" value="<?=_I need a TTP TOPUP?>">
 </form>
index d3901e8d898563cd45afa6a87c1f5dd7238859d1..8e985fa9455acfb83212421712a994c3bf8c4740 100644 (file)
@@ -74,6 +74,14 @@ public class ServerConstants {
         return apiHostName + securePort;
     }
 
         return apiHostName + securePort;
     }
 
+    public static String getLinkHostNamePort() {
+        return "link." + getSuffix() + port;
+    }
+
+    public static String getLinkHostNamePortSecure() {
+        return "link." + getSuffix() + securePort;
+    }
+
     public static int getSecurePort() {
         if (secureBindPort != null && !secureBindPort.isEmpty()) {
             if (secureBindPort.equals("stdin")) {
     public static int getSecurePort() {
         if (secureBindPort != null && !secureBindPort.isEmpty()) {
             if (secureBindPort.equals("stdin")) {
@@ -107,19 +115,19 @@ public class ServerConstants {
     }
 
     public static String getSupportMailAddress() {
     }
 
     public static String getSupportMailAddress() {
-        return "support@" + ServerConstants.getWwwHostName().replaceFirst("^www\\.", "");
+        return "support@" + getSuffix();
     }
 
     public static String getBoardMailAddress() {
     }
 
     public static String getBoardMailAddress() {
-        return "board@" + ServerConstants.getWwwHostName().replaceFirst("^www\\.", "");
+        return "board@" + getSuffix();
     }
 
     public static String getQuizMailAddress() {
     }
 
     public static String getQuizMailAddress() {
-        return "quiz@" + ServerConstants.getWwwHostName().replaceFirst("^www\\.", "");
+        return "quiz@" + getSuffix();
     }
 
     public static String getQuizAdminMailAddress() {
     }
 
     public static String getQuizAdminMailAddress() {
-        return "quiz-admin@" + ServerConstants.getWwwHostName().replaceFirst("^www\\.", "");
+        return "quiz-admin@" + getSuffix();
     }
 
 }
     }
 
 }