X-Git-Url: https://code.wpia.club/?p=gigi.git;a=blobdiff_plain;f=src%2Forg%2Fcacert%2Fgigi%2Fpages%2Fadmin%2Fsupport%2FSupportUserDetailsForm.java;h=f97b2c44e0601d9eccecb6356899ff282400379e;hp=75173e06a8ff6534b22fbad327a947cce88cb742;hb=db5449730f0f774b43a72a5d553bef34ade30e91;hpb=8862fb3f5a428afff2a0321ee83e880e14b1a252 diff --git a/src/org/cacert/gigi/pages/admin/support/SupportUserDetailsForm.java b/src/org/cacert/gigi/pages/admin/support/SupportUserDetailsForm.java index 75173e06..f97b2c44 100644 --- a/src/org/cacert/gigi/pages/admin/support/SupportUserDetailsForm.java +++ b/src/org/cacert/gigi/pages/admin/support/SupportUserDetailsForm.java @@ -13,6 +13,7 @@ import org.cacert.gigi.dbObjects.Name; import org.cacert.gigi.dbObjects.SupportedUser; import org.cacert.gigi.dbObjects.User; import org.cacert.gigi.localisation.Language; +import org.cacert.gigi.output.ArrayIterable; import org.cacert.gigi.output.DateSelector; import org.cacert.gigi.output.GroupSelector; import org.cacert.gigi.output.template.Form; @@ -25,7 +26,7 @@ import org.cacert.gigi.pages.PasswordResetPage; public class SupportUserDetailsForm extends Form { - private static final Template t = new Template(FindDomainForm.class.getResource("SupportUserDetailsForm.templ")); + private static final Template t = new Template(FindUserByDomainForm.class.getResource("SupportUserDetailsForm.templ")); private SupportedUser user; @@ -76,22 +77,11 @@ public class SupportUserDetailsForm extends Form { return true; } dobSelector.update(req); - String fname = req.getParameter("fname"); - String mname = req.getParameter("mname"); - String lname = req.getParameter("lname"); - String suffix = req.getParameter("suffix"); - if (fname == null || mname == null || lname == null | suffix == null) { - throw new GigiApiException("Incomplete request!"); - } if ( !dobSelector.isValid()) { throw new GigiApiException("Invalid date of birth!"); } - Name newName = new Name(fname, lname, mname, suffix); - synchronized (user.getTargetUser()) { - if (user.setDob(dobSelector.getDate()) | user.setName(newName)) { - user.submitSupportAction(); - } - } + user.setDob(dobSelector.getDate()); + String subject = "Change Account Data"; Outputable message = new TranslateCommand("The account data was changed."); user.sendSupportNotification(subject, message); @@ -101,12 +91,17 @@ public class SupportUserDetailsForm extends Form { @Override protected void outputContent(PrintWriter out, Language l, Map vars) { User user = this.user.getTargetUser(); - Name name = user.getName(); vars.put("mail", user.getEmail()); - vars.put("fname", name.getFname()); - vars.put("mname", name.getMname()); - vars.put("lname", name.getLname()); - vars.put("suffix", name.getSuffix()); + vars.put("status", l.getTranslation(user.isValidEmail(user.getEmail()) ? "verified" : "not verified")); + vars.put("exNames", new ArrayIterable(user.getNames()) { + + @Override + public void apply(Name t, Language l, Map vars) { + vars.put("name", t); + vars.put("points", Integer.toString(t.getAssurancePoints())); + } + + }); vars.put("assurer", user.canAssure()); vars.put("dob", dobSelector); vars.put("assurancepoints", user.getAssurancePoints());