X-Git-Url: https://code.wpia.club/?p=gigi.git;a=blobdiff_plain;f=src%2Forg%2Fcacert%2Fgigi%2Fpages%2Fadmin%2Fsupport%2FSupportRevokeCertificatesForm.java;h=8c106dcb5d8d6bbd3cf5fdfd1e12e86dd2925cf7;hp=32f52254247f16711615c6ccd1d5ba5c2536ebaf;hb=4ff2f7a462e9d6ef5171b7d0a4c8d3cf3f26c024;hpb=f0b9b09f6cc96110ec0974d085bd05bef403a9c6 diff --git a/src/org/cacert/gigi/pages/admin/support/SupportRevokeCertificatesForm.java b/src/org/cacert/gigi/pages/admin/support/SupportRevokeCertificatesForm.java index 32f52254..8c106dcb 100644 --- a/src/org/cacert/gigi/pages/admin/support/SupportRevokeCertificatesForm.java +++ b/src/org/cacert/gigi/pages/admin/support/SupportRevokeCertificatesForm.java @@ -13,19 +13,19 @@ import org.cacert.gigi.dbObjects.Certificate; import org.cacert.gigi.dbObjects.Certificate.CertificateStatus; import org.cacert.gigi.dbObjects.CertificateProfile; import org.cacert.gigi.dbObjects.SupportedUser; +import org.cacert.gigi.dbObjects.User; import org.cacert.gigi.localisation.Language; import org.cacert.gigi.output.template.Form; import org.cacert.gigi.output.template.IterableDataset; +import org.cacert.gigi.output.template.Outputable; +import org.cacert.gigi.output.template.SprintfCommand; import org.cacert.gigi.output.template.Template; public class SupportRevokeCertificatesForm extends Form { - private static Template t; + private static final Template t = new Template(SupportRevokeCertificatesForm.class.getResource("SupportRevokeCertificatesForm.templ")); private SupportedUser user; - static { - t = new Template(SupportRevokeCertificatesForm.class.getResource("SupportRevokeCertificatesForm.templ")); - } public SupportRevokeCertificatesForm(HttpServletRequest hsr, SupportedUser user) { super(hsr); @@ -36,6 +36,15 @@ public class SupportRevokeCertificatesForm extends Form { public boolean submit(PrintWriter out, HttpServletRequest req) throws GigiApiException { if (user.getTicket() != null) { user.revokeAllCertificates(); + User target = user.getTargetUser(); + // send notification to support + String subject = "Revoke certificates"; + Outputable message = SprintfCommand.createSimple("All certificates in the account {0} <{1}> have been revoked.", target.getPreferredName().toString(), target.getEmail()); + user.sendSupportNotification(subject, message); + // send notification to user + subject = "Revoke certificate"; + message = SprintfCommand.createSimple("All certificates in your account have been revoked."); + user.sendSupportUserNotification(subject, message); return true; } return false;