]> WPIA git - gigi.git/commitdiff
Add register page with dummy language "de"
authorFelix Dörre <felix@dogcraft.de>
Sat, 21 Jun 2014 20:01:01 +0000 (22:01 +0200)
committerFelix Dörre <felix@dogcraft.de>
Sun, 22 Jun 2014 23:20:07 +0000 (01:20 +0200)
src/org/cacert/gigi/Gigi.java
src/org/cacert/gigi/Language.java
src/org/cacert/gigi/pages/Page.java
src/org/cacert/gigi/pages/main/RegisterPage.java [new file with mode: 0644]

index c52b98f0a7e5fc83df19e554d34f5f84aff95fc7..8fbdbc22b71e06ded2748347f76331b685e0ac22 100644 (file)
@@ -22,6 +22,7 @@ import org.cacert.gigi.database.DatabaseConnection;
 import org.cacert.gigi.pages.LoginPage;
 import org.cacert.gigi.pages.MainPage;
 import org.cacert.gigi.pages.Page;
+import org.cacert.gigi.pages.main.RegisterPage;
 import org.cacert.gigi.util.PasswordHash;
 import org.eclipse.jetty.util.log.Log;
 
@@ -36,6 +37,7 @@ public class Gigi extends HttpServlet {
        public void init() throws ServletException {
                pages.put("/login", new LoginPage("CACert - Login"));
                pages.put("/", new MainPage("CACert - Home"));
+               pages.put(RegisterPage.PATH, new RegisterPage());
                String templ = "";
                try {
                        BufferedReader reader = new BufferedReader(new InputStreamReader(
index 431f0b32a41989fa2ff87a4e45aae4eec47e218f..9faaaad669038005d728017ee83a95c922c8afe1 100644 (file)
@@ -35,6 +35,9 @@ public class Language {
                }
                System.out.println(translations.size() + " strings loaded.");
        }
+       public String getTranslation(String text) {
+               return translations.get(text);
+       }
        public static Language getInstance(String language) {
                Language l = langs.get(language);
                if (l == null) {
@@ -51,7 +54,5 @@ public class Language {
                }
                return l;
        }
-       public static void main(String[] args) {
-               Language.getInstance("de");
-       }
+
 }
index afe96dc76f4dddba3820e0b05da08f91851f3763..7b69e56cfbd21fc6b9e88f6980b5f0363f8f800e 100644 (file)
@@ -5,6 +5,8 @@ import java.io.IOException;
 import javax.servlet.ServletRequest;
 import javax.servlet.ServletResponse;
 
+import org.cacert.gigi.Language;
+
 public abstract class Page {
        private String title;
 
@@ -27,4 +29,9 @@ public abstract class Page {
        public void setTitle(String title) {
                this.title = title;
        }
+       public static String translate(ServletRequest req, String string) {
+               Language l = Language.getInstance("de");
+               return l.getTranslation(string);
+       }
+
 }
diff --git a/src/org/cacert/gigi/pages/main/RegisterPage.java b/src/org/cacert/gigi/pages/main/RegisterPage.java
new file mode 100644 (file)
index 0000000..f162b91
--- /dev/null
@@ -0,0 +1,57 @@
+package org.cacert.gigi.pages.main;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+
+import org.cacert.gigi.pages.Page;
+
+public class RegisterPage extends Page {
+
+       public static final String PATH = "/register";
+
+       public RegisterPage() {
+               super("Register");
+       }
+
+       @Override
+       public void doGet(ServletRequest req, ServletResponse resp)
+                       throws IOException {
+               PrintWriter out = resp.getWriter();
+               out.print("<p>");
+               out.print(translate(
+                               req,
+                               "By joining CAcert and becoming a member, you agree to the CAcert Community Agreement. Please take a moment now to read that and agree to it; this will be required to complete the process of joining."));
+               out.println("</p>");
+               out.print("<p>");
+               out.print(translate(
+                               req,
+                               "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."));
+               out.println("</p>");
+               out.print("<p style=\"border:dotted 1px #900;padding:0.3em;background-color:#ffe;\"><b>");
+               out.print(translate(
+                               req,
+                               "Note: Please enter your date of birth and names as they are written in your official documents."));
+               out.println("</b><br /><br/>");
+               out.println(translate(
+                               req,
+                               "Because CAcert 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."));
+               out.print(translate(
+                               req,
+                               "Your private information will be used for internal procedures only and will not be shared with third parties."));
+               out.println("</p>");
+               out.print("<p style=\"border:dotted 1px #900;padding:0.3em;background-color:#ffe;\">");
+               out.println(translate(
+                               req,
+                               "A proper password wouldn't match your name or email at all, it contains at least 1 lower case letter, 1 upper case letter, a number, white space and a misc symbol. You get additional security for being over 15 characters and a second additional point for having it over 30. The system starts reducing security if you include any section of your name, or password or email address or if it matches a word from the english dictionary..."));
+               out.println("<br/><br/>");
+               out.print("<b>");
+               out.print(translate(req,
+                               "Note: White spaces at the beginning and end of a password will be removed."));
+               out.println("</b>");
+               out.println("</p>");
+
+       }
+}