From: Felix Dörre Date: Tue, 2 Aug 2016 11:58:02 +0000 (+0200) Subject: Merge "fix: Actually generate random IDs for use in tests" X-Git-Url: https://code.wpia.club/?p=gigi.git;a=commitdiff_plain;h=8b302ad07512bfd240922d5b4d930b729bdb8ce1;hp=0931c8e7e936837334372fa3c77d44e65b3e8df7 Merge "fix: Actually generate random IDs for use in tests" --- diff --git a/src/org/cacert/gigi/dbObjects/Group.java b/src/org/cacert/gigi/dbObjects/Group.java index dd6767ef..e85b8277 100644 --- a/src/org/cacert/gigi/dbObjects/Group.java +++ b/src/org/cacert/gigi/dbObjects/Group.java @@ -11,7 +11,7 @@ public enum Group { BLOCKEDLOGIN("blockedlogin", "may not login"), BLOCKEDCERT("blockedcert", "may not issue certificates"), // TTP_ASSURER("ttp-assurer", "may verify via TTP"), TTP_APPLICANT("ttp-applicant", "requests to be verified via ttp"), // CODESIGNING("codesigning", "may issue codesigning certificates"), ORGASSURER("orgassurer", "may verify organisations"), // - NUCLEUS_ASSURER("nucleus-assurer", "may issue nucleus assurances"), LOCATE_AGENT("locate-agent", "wants access to the locate agent system"); + NUCLEUS_ASSURER("nucleus-assurer", "may enter nucleus verifications"), LOCATE_AGENT("locate-agent", "wants access to the locate agent system"); private final String dbName; diff --git a/src/org/cacert/gigi/dbObjects/User.java b/src/org/cacert/gigi/dbObjects/User.java index 61f347a4..cf43f80f 100644 --- a/src/org/cacert/gigi/dbObjects/User.java +++ b/src/org/cacert/gigi/dbObjects/User.java @@ -136,7 +136,7 @@ public class User extends CertificateOwner { public void setDoB(DayDate dob) throws GigiApiException { synchronized (Notary.class) { if (getReceivedAssurances().length != 0) { - throw new GigiApiException("No change after assurance allowed."); + throw new GigiApiException("No change after verification allowed."); } if ( !CalendarUtil.isOfAge(dob, User.MINIMUM_AGE)) { diff --git a/src/org/cacert/gigi/pages/account/certs/CertificateIssueForm.templ b/src/org/cacert/gigi/pages/account/certs/CertificateIssueForm.templ index 0bc3d1c2..7fd6cf23 100644 --- a/src/org/cacert/gigi/pages/account/certs/CertificateIssueForm.templ +++ b/src/org/cacert/gigi/pages/account/certs/CertificateIssueForm.templ @@ -72,7 +72,7 @@ + https://secure.cacert.org/'.?> diff --git a/src/org/cacert/gigi/pages/account/certs/RequestCertificate.templ b/src/org/cacert/gigi/pages/account/certs/RequestCertificate.templ index 0711cddd..5139a695 100644 --- a/src/org/cacert/gigi/pages/account/certs/RequestCertificate.templ +++ b/src/org/cacert/gigi/pages/account/certs/RequestCertificate.templ @@ -7,7 +7,7 @@ -
Don't know, what as CSR is and how to create one? Take a look in the Wiki! +
'Wiki!''!?> diff --git a/src/org/cacert/gigi/pages/admin/support/SupportUserDetailsForm.java b/src/org/cacert/gigi/pages/admin/support/SupportUserDetailsForm.java index 16ece067..bf6f1488 100644 --- a/src/org/cacert/gigi/pages/admin/support/SupportUserDetailsForm.java +++ b/src/org/cacert/gigi/pages/admin/support/SupportUserDetailsForm.java @@ -92,6 +92,7 @@ public class SupportUserDetailsForm extends Form { protected void outputContent(PrintWriter out, Language l, Map vars) { User user = this.user.getTargetUser(); vars.put("mail", user.getEmail()); + vars.put("status", l.getTranslation(user.isValidEmail(user.getEmail()) ? "verified" : "not verified")); vars.put("exNames", new ArrayIterable(user.getNames()) { @Override diff --git a/src/org/cacert/gigi/pages/admin/support/SupportUserDetailsForm.templ b/src/org/cacert/gigi/pages/admin/support/SupportUserDetailsForm.templ index 06dbd042..08ea7597 100644 --- a/src/org/cacert/gigi/pages/admin/support/SupportUserDetailsForm.templ +++ b/src/org/cacert/gigi/pages/admin/support/SupportUserDetailsForm.templ @@ -4,7 +4,7 @@ : - +
() diff --git a/src/org/cacert/gigi/pages/admin/support/SupportUserDetailsPage.java b/src/org/cacert/gigi/pages/admin/support/SupportUserDetailsPage.java index 726bdd39..fad39e90 100644 --- a/src/org/cacert/gigi/pages/admin/support/SupportUserDetailsPage.java +++ b/src/org/cacert/gigi/pages/admin/support/SupportUserDetailsPage.java @@ -8,6 +8,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.cacert.gigi.GigiApiException; +import org.cacert.gigi.dbObjects.Domain; import org.cacert.gigi.dbObjects.EmailAddress; import org.cacert.gigi.dbObjects.SupportedUser; import org.cacert.gigi.dbObjects.User; @@ -48,15 +49,36 @@ public class SupportUserDetailsPage extends Page { @Override public boolean next(Language l, Map vars) { for (; i < addrs.length;) { - String address = addrs[i++].getAddress(); + EmailAddress secAddress = addrs[i++]; + String address = secAddress.getAddress(); if ( !address.equals(user.getEmail())) { vars.put("secmail", address); + vars.put("status", l.getTranslation(secAddress.isVerified() ? "verified" : "not verified")); return true; } } return false; } }); + + final Domain[] doms = user.getDomains(); + vars.put("domains", new IterableDataset() { + + private int point = 0; + + @Override + public boolean next(Language l, Map vars) { + if (point >= doms.length) { + return false; + } + Domain domain = doms[point]; + vars.put("domain", domain.getSuffix()); + vars.put("status", l.getTranslation(domain.isVerified() ? "verified" : "not verified")); + point++; + return true; + } + }); + vars.put("certifrevoke", new SupportRevokeCertificatesForm(req, targetUser)); getDefaultTemplate().output(resp.getWriter(), getLanguage(req), vars); } diff --git a/src/org/cacert/gigi/pages/admin/support/SupportUserDetailsPage.templ b/src/org/cacert/gigi/pages/admin/support/SupportUserDetailsPage.templ index 879367f9..7b5b54e6 100644 --- a/src/org/cacert/gigi/pages/admin/support/SupportUserDetailsPage.templ +++ b/src/org/cacert/gigi/pages/admin/support/SupportUserDetailsPage.templ @@ -5,9 +5,22 @@ - + () + + + + + + + + + + + +
()
+ diff --git a/src/org/cacert/gigi/pages/wot/AssuranceForm.java b/src/org/cacert/gigi/pages/wot/AssuranceForm.java index aca82b91..e5521dab 100644 --- a/src/org/cacert/gigi/pages/wot/AssuranceForm.java +++ b/src/org/cacert/gigi/pages/wot/AssuranceForm.java @@ -152,14 +152,14 @@ public class AssuranceForm extends Form { try { type = AssuranceType.valueOf(val); } catch (IllegalArgumentException e) { - gae.mergeInto(new GigiApiException("Assurance Type wrong.")); + gae.mergeInto(new GigiApiException("Verification Type wrong.")); } } int pointsI = 0; String points = req.getParameter("points"); if (points == null || "".equals(points)) { - gae.mergeInto(new GigiApiException("For an assurance, you need to enter points.")); + gae.mergeInto(new GigiApiException("For a verification, you need to enter points.")); } else { try { pointsI = Integer.parseInt(points); @@ -191,8 +191,8 @@ public class AssuranceForm extends Form { if (aword != null && !aword.equals("")) { Language langApplicant = Language.getInstance(assuree.getPreferredLocale()); - String method = langApplicant.getTranslation("A password reset was triggered. If you did a password reset by assurance, please enter your secret password using this form:"); - String subject = langApplicant.getTranslation("Password reset by assurance"); + String method = langApplicant.getTranslation("A password reset was triggered. If you did a password reset by verification, please enter your secret password using this form:"); + String subject = langApplicant.getTranslation("Password reset by verification"); PasswordResetPage.initPasswordResetProcess(out, assuree, req, aword, langApplicant, method, subject); } return true; diff --git a/src/org/cacert/gigi/pages/wot/AssurePage.java b/src/org/cacert/gigi/pages/wot/AssurePage.java index 8d4a3aac..508a9c62 100644 --- a/src/org/cacert/gigi/pages/wot/AssurePage.java +++ b/src/org/cacert/gigi/pages/wot/AssurePage.java @@ -26,7 +26,7 @@ public class AssurePage extends Page { private static final Template t = new Template(AssuranceForm.class.getResource("AssureeSearch.templ")); public AssurePage() { - super("Assure someone"); + super("Verify someone"); } @@ -51,7 +51,7 @@ public class AssurePage extends Page { AssuranceForm form = Form.getForm(req, AssuranceForm.class); try { if (form.submit(out, req)) { - out.println(translate(req, "Assurance complete.")); + out.println(translate(req, "Verification complete.")); return; } } catch (GigiApiException e) {