X-Git-Url: https://code.wpia.club/?p=gigi.git;a=blobdiff_plain;f=src%2Forg%2Fcacert%2Fgigi%2Fpages%2Fadmin%2Fsupport%2FSupportUserDetailsForm.java;h=5738203661cb504326a19898e45f3905ed9d48d1;hp=ccfb3cc75518886ef8ec86f2bc7939f0aabcd01b;hb=4ff2f7a462e9d6ef5171b7d0a4c8d3cf3f26c024;hpb=f5eae3344a5999304bf9cad2c119dcfc064f3003 diff --git a/src/org/cacert/gigi/pages/admin/support/SupportUserDetailsForm.java b/src/org/cacert/gigi/pages/admin/support/SupportUserDetailsForm.java index ccfb3cc7..57382036 100644 --- a/src/org/cacert/gigi/pages/admin/support/SupportUserDetailsForm.java +++ b/src/org/cacert/gigi/pages/admin/support/SupportUserDetailsForm.java @@ -48,18 +48,23 @@ public class SupportUserDetailsForm extends Form { throw new GigiApiException("More than one action requested!"); } if (req.getParameter("addGroup") != null || req.getParameter("removeGroup") != null) { - String actionType = "granted"; value.update(req); Group toMod = value.getGroup(); + boolean grant; if (req.getParameter("addGroup") != null) { + grant = true; user.grant(toMod); } else { - actionType = "revoked"; + grant = false; user.revoke(toMod); } String subject = "Change Group Permissions"; - Outputable message = SprintfCommand.createSimple("The group permission {0} was {1}.", toMod.getDatabaseName(), actionType); + // send notification to support + Outputable message = SprintfCommand.createSimple(grant ? "The group permission '{0}' was granted." : "The group permission '{0}' was revoked.", toMod.getName()); user.sendSupportNotification(subject, message); + // send notification to user + message = SprintfCommand.createSimple(grant ? "The group permission '{0}' was granted to your account." : "The group permission '{0}' was revoked from your account.", toMod.getName()); + user.sendSupportUserNotification(subject, message); return true; } if (req.getParameter("resetPass") != null) { @@ -81,9 +86,13 @@ public class SupportUserDetailsForm extends Form { } user.setDob(dobSelector.getDate()); - String subject = "Change Account Data"; - Outputable message = new TranslateCommand("The account data was changed."); + String subject = "Change DoB Data"; + // send notification to support + Outputable message = new TranslateCommand("The DoB was changed."); user.sendSupportNotification(subject, message); + // send notification to user + message = SprintfCommand.createSimple("The DoB in your account was changed to {0}.", dobSelector.getDate()); + user.sendSupportUserNotification(subject, message); return true; }