]> WPIA git - gigi.git/commitdiff
Merge changes I6dffa325,I086b1c28
authorFelix Dörre <felix@dogcraft.de>
Tue, 2 Aug 2016 11:51:01 +0000 (13:51 +0200)
committerGerrit Code Review <gigi-system@dogcraft.de>
Tue, 2 Aug 2016 11:51:01 +0000 (13:51 +0200)
* changes:
  add: show verification status of email address for support
  add: show information about domains in user account

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

index 16ece06789d6c7be0f20477420b062bbe706fa79..bf6f1488b998d2eda8287dfd5d88ed798236a882 100644 (file)
@@ -92,6 +92,7 @@ public class SupportUserDetailsForm extends Form {
     protected void outputContent(PrintWriter out, Language l, Map<String, Object> 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<Name>(user.getNames()) {
 
             @Override
index 06dbd0423ae9410f8b79f2421364e9bf1758efc4..08ea759759aa273e07f098643774eca4a3e15d94 100644 (file)
@@ -4,7 +4,7 @@
         </tr>
         <tr>
             <td><?=_Email?>:</td>
-            <td><?=$mail?></td>
+            <td><?=$mail?><br/>(<?=$status?>)</td>
         </tr>
   <? foreach($exNames) { ?>
         <tr>
index 726bdd391566bd740b29faf426048d06047e9a5d..fad39e90c4007cc2b69b7f2eb90e0d78280d325f 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;
@@ -48,15 +49,36 @@ public class SupportUserDetailsPage extends Page {
             @Override
             public boolean next(Language l, Map<String, Object> 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<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..7b5b54e6d1b8de3f2622f7728d0e8bb92c25bd0a 100644 (file)
@@ -5,9 +5,22 @@
         </tr>
         <? foreach($emails) {?>
         <tr>
-            <td><?=$secmail?></td>
+            <td><?=$secmail?> (<?=$status?>)</td>
         </tr>
         <? } ?>
         </tbody>
 </table>
+
+<table class="table">
+        <tbody><tr>
+            <th><?=_Domains?></th>
+        </tr>
+        <? foreach($domains) {?>
+        <tr>
+            <td><?=$domain?> (<?=$status?>)</td>
+        </tr>
+        <? } ?>
+        </tbody>
+</table>
+
 <?=$certifrevoke?>