From: INOPIAE Date: Mon, 1 Aug 2016 06:25:07 +0000 (+0200) Subject: add: show information about domains in user account X-Git-Url: https://code.wpia.club/?p=gigi.git;a=commitdiff_plain;h=b885f9bde0cb9e4b08070d2fae14eeca00923d3a add: show information about domains in user account fixes issue #57 Change-Id: I086b1c284046e382d187f7f5dc1e56976f9377d3 --- diff --git a/src/org/cacert/gigi/pages/admin/support/SupportUserDetailsPage.java b/src/org/cacert/gigi/pages/admin/support/SupportUserDetailsPage.java index 726bdd39..7ab65b32 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; @@ -57,6 +58,25 @@ public class SupportUserDetailsPage extends Page { 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..667ff997 100644 --- a/src/org/cacert/gigi/pages/admin/support/SupportUserDetailsPage.templ +++ b/src/org/cacert/gigi/pages/admin/support/SupportUserDetailsPage.templ @@ -10,4 +10,17 @@ + + + + + + + + + + + +
()
+