]> WPIA git - gigi.git/commitdiff
add: show information about domains in user account
authorINOPIAE <m.maengel@inopiae.de>
Mon, 1 Aug 2016 06:25:07 +0000 (08:25 +0200)
committerINOPIAE <m.maengel@inopiae.de>
Mon, 1 Aug 2016 06:25:07 +0000 (08:25 +0200)
fixes issue #57

Change-Id: I086b1c284046e382d187f7f5dc1e56976f9377d3

src/org/cacert/gigi/pages/admin/support/SupportUserDetailsPage.java
src/org/cacert/gigi/pages/admin/support/SupportUserDetailsPage.templ

index 726bdd391566bd740b29faf426048d06047e9a5d..7ab65b329f351da4a5194fb2f968d8103e026852 100644 (file)
@@ -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<String, Object> 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);
     }
index 879367f91eb4763dea2513b100bea2574b410ebe..667ff997171f1dfec1cec605be5b88b814f67380 100644 (file)
         <? } ?>
         </tbody>
 </table>
+
+<table class="table">
+        <tbody><tr>
+            <th><?=_Domains?></th>
+        </tr>
+        <? foreach($domains) {?>
+        <tr>
+            <td><?=$domain?> (<?=$status?>)</td>
+        </tr>
+        <? } ?>
+        </tbody>
+</table>
+
 <?=$certifrevoke?>