]> WPIA git - gigi.git/commitdiff
upd: replace SomeCA by variable
authorINOPIAE <m.maengel@inopiae.de>
Tue, 21 Feb 2017 19:45:18 +0000 (20:45 +0100)
committerFelix Dörre <felix@dogcraft.de>
Sat, 25 Feb 2017 18:43:04 +0000 (19:43 +0100)
fixes issue #105

Change-Id: I979c5cb7f5b998694fa13b56420e4504bfd4020f

27 files changed:
config/gigi.properties.template
links.txt
src/club/wpia/gigi/Gigi.java
src/club/wpia/gigi/Gigi.templ
src/club/wpia/gigi/Launcher.java
src/club/wpia/gigi/email/MailProbe.java
src/club/wpia/gigi/email/MailProbe.templ
src/club/wpia/gigi/email/SendMail.java
src/club/wpia/gigi/output/template/MailFooter.templ
src/club/wpia/gigi/output/template/MailTemplate.java
src/club/wpia/gigi/pages/MainPageNotLogin.templ
src/club/wpia/gigi/pages/Page.java
src/club/wpia/gigi/pages/account/certs/CertificateIssueForm.java
src/club/wpia/gigi/pages/account/certs/CertificateIssueForm.templ
src/club/wpia/gigi/pages/account/certs/CertificateRequest.java
src/club/wpia/gigi/pages/account/certs/RequestCertificate.templ
src/club/wpia/gigi/pages/account/domain/DomainOverview.java
src/club/wpia/gigi/pages/account/domain/EditDomain.java
src/club/wpia/gigi/pages/account/domain/PingConfigForm.templ
src/club/wpia/gigi/pages/main/RegisterPage.templ
src/club/wpia/gigi/pages/wot/RequestTTPPage.java
src/club/wpia/gigi/pages/wot/RequestTTPPage.templ
src/club/wpia/gigi/pages/wot/Rules.templ
src/club/wpia/gigi/pages/wot/VerificationForm.java
src/club/wpia/gigi/pages/wot/VerificationForm.templ
src/club/wpia/gigi/util/ServerConstants.java
tests/club/wpia/gigi/testUtils/ConfiguredTest.java

index 2f511ec1f81e8b57eef3d3091d79ef81062f8e96..f4a9671981ebb8bfd40dff268a6b628ebe84f19c 100644 (file)
@@ -18,3 +18,5 @@ time.testValidMonths=12
 time.reverificationDays=90
 time.verificationFreshMonths=39
 time.verificationMaxAgeMonths=24
+
+appName=SomeCA
\ No newline at end of file
index 3cac21d68bcd5a92f6620fc7a6d4ebfe7d1173a7..e4120757502dae5feaac86e96f4c87738d73cb62 100644 (file)
--- a/links.txt
+++ b/links.txt
@@ -12,3 +12,4 @@
 /ttp/user
 /ttp/country
 /acceptableDocuments
+/blog
index 863122c7f117b45169f6262c42adff7e7afee486..b02a1a8991d96d4ec39cf56151713bf80d128cfd 100644 (file)
@@ -34,6 +34,7 @@ import club.wpia.gigi.output.SimpleMenuItem;
 import club.wpia.gigi.output.SimpleUntranslatedMenuItem;
 import club.wpia.gigi.output.template.Form.CSRFException;
 import club.wpia.gigi.output.template.Outputable;
+import club.wpia.gigi.output.template.PlainOutputable;
 import club.wpia.gigi.output.template.Template;
 import club.wpia.gigi.output.template.TranslateCommand;
 import club.wpia.gigi.pages.AboutPage;
@@ -110,11 +111,17 @@ public final class Gigi extends HttpServlet {
             return m;
         }
 
+        private Menu createMenu(Outputable name) {
+            Menu m = new Menu(name);
+            categories.add(m);
+            return m;
+        }
+
         public MenuCollector generateMenu() throws ServletException {
             putPage("/denied", new AccessDenied(), null);
             putPage("/error", new PageNotFound(), null);
             putPage("/login", new LoginPage(), null);
-            Menu mainMenu = createMenu("SomeCA.org");
+            Menu mainMenu = createMenu(new PlainOutputable(ServerConstants.getAppName()));
             mainMenu.addItem(new SimpleMenuItem("https://" + ServerConstants.getHostNamePort(Host.WWW) + "/login", "Password Login") {
 
                 @Override
@@ -436,6 +443,7 @@ public final class Gigi extends HttpServlet {
                 vars.put("authContext", currentAuthContext);
 
             }
+            vars.put("appName", ServerConstants.getAppName());
             resp.setContentType("text/html; charset=utf-8");
             baseTemplate.output(resp.getWriter(), lang, vars);
         } else {
index 7399b192cb9f80f7135404519dab37814d4892b5..693514d0e87fb06abaa3a08cf096f7d244467c12 100644 (file)
@@ -2,9 +2,9 @@
 <html lang="en">
     <head>
         <meta charset="utf-8">
-        <!-- <link rel="alternate" type="application/rss+xml" title="Newsfeed" href="//blog.SomeCA.org/feed"> -->
+        <!-- <link rel="alternate" type="application/rss+xml" title="Newsfeed" href="<?=$linkHost?>/blog"> -->
         <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
-        <title><?=_SomeCA?> - <?=$title?></title>
+        <title><?=_${appName}?> - <?=$title?></title>
         <meta name="description" content="">
         <link rel="stylesheet" href="<?=$static?>/css/jquery-ui-timepicker-addon.css">
         <meta name="viewport" content="width=device-width, initial-scale=1">
@@ -28,7 +28,7 @@
         <span class="icon-bar"></span>
         <span class="icon-bar"></span>
       </button>
-      <a class="navbar-brand" href="/"><?=_SomeCA Frontend?></a>
+      <a class="navbar-brand" href="/"><?=_${appName} Frontend?></a>
     </div>
 
     <!-- Collect the nav links, forms, and other content for toggling -->
@@ -51,7 +51,7 @@
        <hr/>
                <div id="siteInfo">
             Page info
-                       ©2016-<?=$year?> SomeCA
+                       ©2016-<?=$year?> <?=_${appName}?> 
                </div>
 
 </body>
index 25c91c8647c59be9f56e56242dedad46c4f3e5d2..b4ae8e2ae007168cdea9affa4c3fd5e4e0a538a4 100644 (file)
@@ -342,7 +342,7 @@ public class Launcher {
             hw.setHandler(rh);
 
             ServletContextHandler servlet = new ServletContextHandler(ServletContextHandler.SESSIONS);
-            servlet.setInitParameter(SessionManager.__SessionCookieProperty, "SomeCA-Session");
+            servlet.setInitParameter(SessionManager.__SessionCookieProperty, ServerConstants.getAppName() + "-Session");
             servlet.addServlet(webAppServlet, "/*");
             ErrorPageErrorHandler epeh = new ErrorPageErrorHandler();
             epeh.addErrorPage(404, "/error");
index b02add821f59cf675c6f67a5a807cc260bd16117..4e454f0a47ef5cb452d3b7f0f5a024ed45b54e15 100644 (file)
@@ -15,6 +15,7 @@ public class MailProbe {
     public static void sendMailProbe(Language l, String type, int id, String hash, String address) throws IOException {
         HashMap<String, Object> vars = new HashMap<>();
         vars.put("link", "https://" + ServerConstants.getHostNamePortSecure(Host.WWW) + "/verify?type=" + type + "&id=" + id + "&hash=" + hash);
+        vars.put("appName", ServerConstants.getAppName());
         mailProbe.sendMail(l, vars, address);
     }
 
index 5398c6d882564977d02183f4cc9cb1dc29bbff2a..a7293d5f7769287cf2eac0b0b76f231d0c634bf3 100644 (file)
@@ -1,5 +1,5 @@
 Subject: <?=_Mail Probe?>
 
-<?=_Thanks for signing up with SomeCA.org, below is the link you need to open to verify your account. Once your account is verified you will be able to start issuing certificates to your heart's content!?>
+<?=_Thanks for signing up with ${appName}, below is the link you need to open to verify your account. Once your account is verified you will be able to start issuing certificates to your heart's content!?>
 
 <?=$link?>
index cef6381c6311ab25b0ff5ebab8eaf5e13161f2f5..4c4b8072586adc3e5894da138b0c252b23e31ecb 100644 (file)
@@ -51,7 +51,7 @@ public class SendMail extends EmailProvider {
             out.print("DATA\r\n");
             out.flush();
             readSMTPResponse(in, 250);
-            out.print("X-Mailer: SomeCA.org Website\r\n");
+            out.print("X-Mailer: " + ServerConstants.getAppName() + " Website\r\n");
             // if (array_key_exists("REMOTE_ADDR", $_SERVER)) {
             // out.print("X-OriginatingIP: ".$_SERVER["REMOTE_ADDR"]."\r\n");
             // }
index 9e2f11ddae8437349b0fa964d1b351cad9c0de16..fb2c0e1c3488acb8ad48c83c980822a0b6953e82 100644 (file)
@@ -1,6 +1,6 @@
 
 <?=_Kind regards?>,
-<?=_SomeCA.org?>
+<?=_${appName}?>
 
 -- 
 <?=_This message has automatically been sent by the system.?>
index 48034601f452013719e841243bed7ade0b6b1d82..c6f271b16e54bbc139633fe22c0c8773709dbe50 100644 (file)
@@ -11,12 +11,13 @@ import java.util.Map;
 
 import club.wpia.gigi.email.SendMail;
 import club.wpia.gigi.localisation.Language;
+import club.wpia.gigi.util.ServerConstants;
 
 public class MailTemplate extends Template {
 
     private static final Template FOOTER = new Template(MailTemplate.class.getResource("MailFooter.templ"));
 
-    public static final String SUBJECT_TAG = "[SomeCA] ";
+    public static final String SUBJECT_TAG = "[" + ServerConstants.getAppName() + "] ";
 
     private TemplateBlock subjectBlock;
 
@@ -63,6 +64,7 @@ public class MailTemplate extends Template {
     public void sendMail(Language l, Map<String, Object> vars, String to) throws IOException {
         tryReload();
         vars.put(Outputable.OUT_KEY_PLAIN, true);
+        vars.put("appName", ServerConstants.getAppName());
 
         String body = runTemplate(this, l, vars);
         body += runTemplate(FOOTER, l, vars);
index 339c5ca0372a03bb0971324828880613db59fdfc..2bca0b0536d447625581fc33b34b5fcda4e12e25 100644 (file)
@@ -1,16 +1,16 @@
-<h3><?=_What is SomeCA??></h3>
+<h3><?=_What is ${appName}??></h3>
 
-<p><?=_SomeCA is a public Certificate Authority (CA) that issues affordable certificates. The service is provided by !'<a href="//wpia.club" target="_blank">'WPIA (World Privacy and Identity Association)!'</a>'.?></p>
+<p><?=_${appName} is a public Certificate Authority (CA) that issues affordable certificates. The service is provided by !'<a href="//wpia.club" target="_blank">'WPIA (World Privacy and Identity Association)!'</a>'.?></p>
 
 <p><?=_One goal of WPIA is to promote awareness and education on computer security through the use of encryption technologies, in particular by providing cryptographic certificates.?></p>
 <p><?=_Client certificates can be used to digitally sign and encrypt both emails and documents. Furthermore client certificates can authenticate and authorize users connecting to websites and applications without the need of a password.
 On the other hand, server certificates can be used to establish secure internet connections with the Transport Layer Security protocol (TLS).?></p>
 
-<p><?=_In addition to signing certificates, SomeCA provides a service to verify your digital identity to assure that data signed with your certificate is related to your person.?></p>
+<p><?=_In addition to signing certificates, ${appName} provides a service to verify your digital identity to assure that data signed with your certificate is related to your person.?></p>
 
-<p><?=_If you are interested - !'<a href="/register">'join SomeCA!'</a>' as fellow for free and get your own certificates.?></p>
+<p><?=_If you are interested - !'<a href="/register">'join ${appName}!'</a>' as fellow for free and get your own certificates.?></p>
 
 <hr/>
 
-<p><?=_For general documentation and help, please visit the SomeCA !(/wiki/gigi)Wiki Documentation site!'</a>'.?>
-<?=_For specific policies, see the SomeCA !(/policy)Policies page!'</a>'.?></p>
\ No newline at end of file
+<p><?=_For general documentation and help, please visit the ${appName} !(/wiki/gigi)Wiki Documentation site!'</a>'.?>
+<?=_For specific policies, see the ${appName} !(/policy)Policies page!'</a>'.?></p>
\ No newline at end of file
index 75d072e8ba0af129c9186a1e208ddeaf5a045f2e..8bca3afa83aa829e3442264933a336f356d19a97 100644 (file)
@@ -18,6 +18,7 @@ import club.wpia.gigi.dbObjects.User;
 import club.wpia.gigi.localisation.Language;
 import club.wpia.gigi.output.template.Template;
 import club.wpia.gigi.util.AuthorizationContext;
+import club.wpia.gigi.util.ServerConstants;
 
 /**
  * This class encapsulates a sub page of Gigi. A template residing nearby this
@@ -178,6 +179,7 @@ public abstract class Page implements PermissionCheckable {
     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));
+        vars.put("appName", ServerConstants.getAppName());
         return vars;
     }
 
index b162a26f0d04961ea8b4bcc232669678de111021..86056df47a81182f0f877ce335587274af9b8fc9 100644 (file)
@@ -142,7 +142,6 @@ public class CertificateIssueForm extends Form {
     @Override
     protected void outputContent(PrintWriter out, Language l, Map<String, Object> vars) {
         HashMap<String, Object> vars2 = new HashMap<String, Object>(vars);
-
         StringBuffer content = new StringBuffer();
         for (SubjectAlternateName SAN : cr.getSANs()) {
             content.append(SAN.getType().toString().toLowerCase());
index c24b90f132aa1c688ea1d60b1d30f333c024694a..f3d72a54c74217c2615cbd51ee7de2df809f2eed 100644 (file)
@@ -1,9 +1,9 @@
-<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><?=_${appName} 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 ${appName} 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><?=_SomeCA'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><?=_${appName}'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>
+<p><?=_If the Subscriber's name and/or domain name registration change the subscriber will immediately inform ${appName} 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>
 <? if($defaultName) { ?>
 <span id="defaultName" class="js-hint"><?=$defaultName?></span>
@@ -39,7 +39,7 @@
     </td>
     <td>
       <input class="form-control" type='text' id='CN' name='CN' value='<?=$CN?>'/>
-      <?=_For a client certificate you need to enter a name with at least 50 VP or 'SomeCA user' will be used.?><br />
+      <?=_For a client certificate you need to enter a name with at least 50 VP or '${appName} User' will be used.?><br />
       <?=_For a server certificate leave this field blank.?>
     </td>
   </tr>
index 912f316e5c0ed1c054fd00c66e35b533726ad0db..4158e9ba751bce4f06d9f65f9f02045c8d80e31f 100644 (file)
@@ -17,22 +17,23 @@ import java.util.TreeSet;
 import club.wpia.gigi.GigiApiException;
 import club.wpia.gigi.crypto.SPKAC;
 import club.wpia.gigi.dbObjects.Certificate;
+import club.wpia.gigi.dbObjects.Certificate.CSRType;
+import club.wpia.gigi.dbObjects.Certificate.SANType;
+import club.wpia.gigi.dbObjects.Certificate.SubjectAlternateName;
 import club.wpia.gigi.dbObjects.CertificateOwner;
 import club.wpia.gigi.dbObjects.CertificateProfile;
+import club.wpia.gigi.dbObjects.CertificateProfile.PropertyTemplate;
 import club.wpia.gigi.dbObjects.Digest;
 import club.wpia.gigi.dbObjects.Group;
 import club.wpia.gigi.dbObjects.Organisation;
 import club.wpia.gigi.dbObjects.User;
-import club.wpia.gigi.dbObjects.Certificate.CSRType;
-import club.wpia.gigi.dbObjects.Certificate.SANType;
-import club.wpia.gigi.dbObjects.Certificate.SubjectAlternateName;
-import club.wpia.gigi.dbObjects.CertificateProfile.PropertyTemplate;
 import club.wpia.gigi.output.template.SprintfCommand;
 import club.wpia.gigi.util.AuthorizationContext;
 import club.wpia.gigi.util.CAA;
 import club.wpia.gigi.util.DomainAssessment;
 import club.wpia.gigi.util.PEM;
 import club.wpia.gigi.util.RateLimit;
+import club.wpia.gigi.util.ServerConstants;
 import sun.security.pkcs.PKCS9Attribute;
 import sun.security.pkcs10.PKCS10;
 import sun.security.pkcs10.PKCS10Attribute;
@@ -57,7 +58,7 @@ import sun.security.x509.X500Name;
 
 public class CertificateRequest {
 
-    public static final String DEFAULT_CN = "SomeCA User";
+    public static final String DEFAULT_CN = ServerConstants.getAppName() + " User";
 
     public static final ObjectIdentifier OID_KEY_USAGE_SSL_SERVER = ObjectIdentifier.newInternal(new int[] {
             1, 3, 6, 1, 5, 5, 7, 3, 1
index 8cd1daa0f2fae8a2863386b821b9bed84b992eb0..8c3b05f76e1224757fd176811e34fc49be3adaac 100644 (file)
@@ -1,5 +1,5 @@
-<p><?=_SomeCA offers two ways to create a certificate.?> 
-<?=_One is to paste a certificate signing request (CSR) created from an existing or newly created private key.?> <?=_ If you do not know what a CSR is or how to create one take a look at the !'<a href="https://someca.de/FAQ/CSR">'FAQ!'</a>'.?> 
+<p><?=_${appName} offers two ways to create a certificate.?> 
+<?=_One is to paste a certificate signing request (CSR) created from an existing or newly created private key.?> <?=_ If you do not know what a CSR is or how to create one take a look at the !(/wiki/CSR)FAQ!'</a>'.?> 
 <?=_As an alternative you can generate the private key inside your browser and export it once the certificate has been issued.?></p>
 <form method="post">
 <table class="table">
index 4db4865c882db62425708eaf70d1873152bf701c..bbed095bc790cd9e9fc864c06f1ddcd57a66a2dd 100644 (file)
@@ -1,7 +1,7 @@
 package club.wpia.gigi.pages.account.domain;
 
 import java.io.IOException;
-import java.util.HashMap;
+import java.util.Map;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -27,7 +27,7 @@ public class DomainOverview extends ManagedMultiFormPage {
         CertificateOwner u = LoginPage.getAuthorizationContext(req).getTarget();
         try {
             DomainManagementForm domMan = new DomainManagementForm(req, u, false);
-            HashMap<String, Object> vars = new HashMap<>();
+            Map<String, Object> vars = getDefaultVars(req);
             vars.put("domainman", domMan);
             if (u instanceof User) {
                 DomainAddForm domAdd = new DomainAddForm(req, (User) u);
index 0f63676b45c0b5861c7b7783f87d531a8f943bea..b6672ae7a26bcf71adff5047e44502477cd95769 100644 (file)
@@ -1,7 +1,6 @@
 package club.wpia.gigi.pages.account.domain;
 
 import java.io.IOException;
-import java.util.HashMap;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -42,9 +41,9 @@ public class EditDomain extends ManagedMultiFormPage {
             resp.getWriter().println(getLanguage(req).getTranslation("Access denied"));
             return;
         }
-        new DomainPinglogForm(req, d).output(resp.getWriter(), getLanguage(req), new HashMap<String, Object>());
+        new DomainPinglogForm(req, d).output(resp.getWriter(), getLanguage(req), getDefaultVars(req));
         try {
-            new PingConfigForm(req, d).output(resp.getWriter(), getLanguage(req), new HashMap<String, Object>());
+            new PingConfigForm(req, d).output(resp.getWriter(), getLanguage(req), getDefaultVars(req));
         } catch (GigiApiException e) {
             e.format(resp.getWriter(), getLanguage(req));
         }
index f8f700f369b427041888d03802be5b9671e4e935..8280c8d2ab33b6d16fa204bd47d84b8da8ba2607 100644 (file)
@@ -27,7 +27,7 @@
 <div class="panel panel-info panel-activatable">
   <div class="panel-heading"><input type="checkbox" name="SSLType" value="y"<?=$!ssl?>> <?=_Verify by searching for installed certificate.?></div>
   <div class="panel-body">
-    <?=_Please list up to four services using your certificate. You need to have one of them up and using a valid SomeCA certificate or a specific self-signed certificate in order to pass this test?>:
+    <?=_Please list up to four services using your certificate. You need to have one of them up and using a valid ${appName} certificate or a specific self-signed certificate in order to pass this test?>:
     <?=_The self-signed certificate needs to contain your domain as CN and ${tokenValue} as organization unit.?> <?=_You can use these commands to create such a certificate:?>
     <code>
 openssl req -newkey rsa:4096 -subj "/CN=<span class='exampleDomain'>example.org</span>/OU=<?=$tokenValue?>" -nodes -out myCSR -keyout myKey<br>
index 8bc16fabe1ac5529bdc16689e33332ed8312dcc0..2cfc332965bd4fa2859723f9d2f05c2621a00186 100644 (file)
@@ -1,8 +1,8 @@
-<p><?=_By joining SomeCA and becoming a member, you agree to the Terms of Service. Please take a moment now to read that and agree to it; this will be required to complete the process of joining.?></p>
+<p><?=_By joining ${appName} and becoming a member, you agree to the Terms of Service. Please take a moment now to read that and agree to it; this will be required to complete the process of joining.?></p>
 <p><?=_Warning! This site requires cookies to be enabled to ensure your privacy and security. This site uses session cookies to store temporary values to prevent people from copying and pasting the session ID to someone else exposing their account, personal details and identity theft as a result.?></p>
 <p style="border:dotted 1px #900;padding:0.3em;background-color:#ffe;">
 <b><?=_Note: Please enter your date of birth and names as they are written in your official documents.?></b><br /><br />
-<?=_Because SomeCA is a certificate authority (CA) people rely on us knowing about the identity of the users of our certificates. So even as we value privacy very much, we need to collect at least some basic information about our members. This is especially the case for everybody who wants to take part in our web of trust.?>
+<?=_Because ${appName} is a certificate authority (CA) people rely on us knowing about the identity of the users of our certificates. So even as we value privacy very much, we need to collect at least some basic information about our members. This is especially the case for everybody who wants to take part in our web of trust.?>
 <?=_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;">
index 558ba3a5e805833555ce8f06a7b471a99c42e322..7d1302349f29911ce1a07957a283dd689da6e48a 100644 (file)
@@ -6,8 +6,8 @@ import java.util.Map;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import club.wpia.gigi.dbObjects.Verification;
 import club.wpia.gigi.dbObjects.User;
+import club.wpia.gigi.dbObjects.Verification;
 import club.wpia.gigi.output.template.Form;
 import club.wpia.gigi.pages.LoginPage;
 import club.wpia.gigi.pages.Page;
index 3fd308640a9ebe94a7db09496f7394c065dbfe52..b61e4017fc2ef800f08fee271cdaa814c3519b9d 100644 (file)
@@ -1,30 +1,30 @@
 <h3><?=_Trusted Third Parties?></h3>
 
-<p><?=_The Trusted Third Party (TTP) programme is intended to be used in areas without many SomeCA RA Agents.?></p>
+<p><?=_The Trusted Third Party (TTP) programme is intended to be used in areas without many ${appName} RA Agents.?></p>
 
 <p><?=_A Trusted Third Party (TTP) is simply someone in your country that is responsible for witnessing signatures and ID documents. This role is covered by many different titles such as public notary, justice of the peace and so on.?></p>
 
 <p><?=_With the TTP programme you can potentially gain verification up to a maximum of 100 verification points.?></p>
 
-<p><?=_Currently SomeCA has only developed the TTP programme to the level that you can gain 70 verification points by TTP verification.?></p>
+<p><?=_Currently ${appName} has only developed the TTP programme to the level that you can gain 70 verification points by TTP verification.?></p>
 
 <p><?=_We are working to develop a process that will fill the gap of the missing 30 verification points to allow you to get the maximum 100 verification points.?> </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><?=_In the meanwhile you would need to close this gap with face to face verifications with ${appName} 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 !(/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) { ?>
-<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>
+<p><?=_If you want to ask for TTP verifications fill out the missing data to start the process. ${appName} will then inform you about the next steps.?></p>
 <?=$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 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. ${appName} 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>
-<p><?=_We are working to develop the TTP TOPUP process to be able to fill the gap of the missing 30 verification points to 100 verification points. Meanwhile you have to close this gap with face to face verification from SomeCA RA Agent. Think not only traveling to populated countries, but as well to RA Agent visiting your country or area.?></p>  
+<p><?=_We are working to develop the TTP TOPUP process to be able to fill the gap of the missing 30 verification points to 100 verification points. Meanwhile you have to close this gap with face to face verification from ${appName} RA Agent. Think not only traveling to populated countries, but as well to RA Agent visiting your country or area.?></p>  
 <? } ?>
 
 <? if($nothing) { ?>
index 0da8c82e9660cabf9f9a01217a85937091362ac8..6b874b87e992776f87a6ba0b05d62bd491733af4 100644 (file)
@@ -26,7 +26,7 @@
 <p><?=_You may charge a fee for your expenses if the Applicant has been informed of such costs beforehand.?></p>
 
 <p><?=_Liability?></h4>
-<?=_A SomeCA RA Agent who knowingly, or reasonably ought to have known, verifies the identity of an Applicant contrary to the underlying policy may be held liable.?></p>
+<?=_A ${appName} RA Agent who knowingly, or reasonably ought to have known, verifies the identity of an Applicant contrary to the underlying policy may be held liable.?></p>
 
 <h4><?=_Verification Points?></h4>
-<p><?=_SomeCA may, from time to time, alter the amount of Verification Points that a group of RA Agents may assign as is necessary to effect a policy or rule change. We may also alter the amount of Verification Points available to an individual, or new group of RA Agents, should another policy of SomeCA require this.?></p>
+<p><?=_${appName} may, from time to time, alter the amount of Verification Points that a group of RA Agents may assign as is necessary to effect a policy or rule change. We may also alter the amount of Verification Points available to an individual, or new group of RA Agents, should another policy of ${appName} require this.?></p>
index 7a8a558cdf114f36261d284f0727bf7cdfeae534..4d92f28ab03b4b66ebf0ad17a5f9a59e6d73cef8 100644 (file)
@@ -28,6 +28,7 @@ import club.wpia.gigi.pages.Page;
 import club.wpia.gigi.pages.PasswordResetPage;
 import club.wpia.gigi.util.DayDate;
 import club.wpia.gigi.util.Notary;
+import club.wpia.gigi.util.ServerConstants;
 
 public class VerificationForm extends Form {
 
@@ -165,7 +166,7 @@ public class VerificationForm extends Form {
         }
 
         if ( !"1".equals(req.getParameter("certify")) || !"1".equals(req.getParameter("rules")) || !"1".equals(req.getParameter("assertion"))) {
-            gae.mergeInto(new GigiApiException("You failed to check all boxes to validate" + " your adherence to the rules and policies of SomeCA"));
+            gae.mergeInto(new GigiApiException(SprintfCommand.createSimple("You failed to check all boxes to validate your adherence to the rules and policies of {0}.", ServerConstants.getAppName())));
         }
         if ("1".equals(req.getParameter("passwordReset"))) {
             aword = req.getParameter("passwordResetValue");
index 540faaae045aca984f7bf511bb6ac55c10294dd2..be834f2ad4c986b4ed2effe512f80d56650c6c39 100644 (file)
@@ -3,7 +3,7 @@
 <tr><th colspan="2"><?=_Verification Confirmation?></th></tr>
 </thead>
 <tbody>
-<tr><td colspan="2"><?=_Please check the following details match against what you witnessed when you met ${name} in person. You MUST NOT proceed unless you are sure the details are correct. You may be held responsible by the SomeCA Arbitrator for any issues with this Verification.?>
+<tr><td colspan="2"><?=_Please check the following details match against what you witnessed when you met ${name} in person. You MUST NOT proceed unless you are sure the details are correct. You may be held responsible by the ${appName} Arbitrator for any issues with this Verification.?>
 </td></tr>
 <? foreach($names) { ?>
        <tr>
@@ -35,7 +35,7 @@
        </tr>
        <tr>
                <td><input type="checkbox" name="assertion" value="1" required></td>
-               <td><?=_I believe that the assertion of identity I am making is correct, complete and verifiable. I have seen original documentation attesting to this identity. I accept that the SomeCA Arbitrator may call upon me to provide evidence in any dispute, and I may be held responsible.?></td>
+               <td><?=_I believe that the assertion of identity I am making is correct, complete and verifiable. I have seen original documentation attesting to this identity. I accept that the ${appName} Arbitrator may call upon me to provide evidence in any dispute, and I may be held responsible.?></td>
        </tr>
        <tr>
                <td><input type="checkbox" name="rules" value="1" required></td>
index becd77e65d9662afa5328eb9c4d0cedf7709cc48..d95db1b538f2b54a2a72f91df7d0507f98ef3959 100644 (file)
@@ -58,6 +58,8 @@ public class ServerConstants {
 
     private static String suffix = "wpia.local";
 
+    private static String appName = null;
+
     public static void init(Properties conf) {
         securePort = port = "";
         if ( !conf.getProperty("https.port").equals("443")) {
@@ -75,6 +77,10 @@ public class ServerConstants {
             hostnames.put(h, conf.getProperty("name." + h.getConfigName(), h.getHostDefaultPrefix() + "." + suffix));
         }
         ServerConstants.hostnames = Collections.unmodifiableMap(hostnames);
+        appName = conf.getProperty("appName");
+        if (appName == null) {
+            throw new Error("App name missing");
+        }
     }
 
     public static String getHostName(Host h) {
@@ -137,4 +143,11 @@ public class ServerConstants {
         return "quiz-admin@" + getSuffix();
     }
 
+    public static String getAppName() {
+        if (appName == null) {
+            throw new Error("AppName not initialized.");
+        }
+        return appName;
+    }
+
 }
index e4c41b671f53e833263797ffec800712faa62860..025f1d6cc393390f1268469980e5a74395644347 100644 (file)
@@ -117,6 +117,8 @@ public abstract class ConfiguredTest {
         mainProps.setProperty("name.static", testProps.getProperty("name.static"));
         mainProps.setProperty("name.api", testProps.getProperty("name.api"));
 
+        mainProps.setProperty("appName", "SomeCA");
+
         mainProps.setProperty("https.port", testProps.getProperty("serverPort.https"));
         mainProps.setProperty("http.port", testProps.getProperty("serverPort.http"));