]> WPIA git - gigi.git/blobdiff - src/club/wpia/gigi/dbObjects/SupportedUser.java
add: implement password change log
[gigi.git] / src / club / wpia / gigi / dbObjects / SupportedUser.java
index c9364f4ef63ad96cbf0fd14c10c2bcbcb5d7c167..84c43ab8e0db5261d745d200d34d69663be20ef8 100644 (file)
@@ -9,6 +9,7 @@ import javax.servlet.http.HttpServletRequest;
 import club.wpia.gigi.GigiApiException;
 import club.wpia.gigi.database.GigiPreparedStatement;
 import club.wpia.gigi.dbObjects.Certificate.CertificateStatus;
+import club.wpia.gigi.dbObjects.Certificate.RevocationType;
 import club.wpia.gigi.localisation.Language;
 import club.wpia.gigi.output.template.MailTemplate;
 import club.wpia.gigi.output.template.Outputable;
@@ -54,7 +55,7 @@ public class SupportedUser {
         // TODO Check for open jobs!
         for (int i = 0; i < certs.length; i++) {
             if (certs[i].getStatus() == CertificateStatus.ISSUED) {
-                certs[i].revoke();
+                certs[i].revoke(RevocationType.SUPPORT);
             }
         }
         // send notification to support
@@ -69,7 +70,7 @@ public class SupportedUser {
         // TODO Check for open jobs!
         if (cert.getStatus() == CertificateStatus.ISSUED) {
             writeSELog("SE Revoke certificate");
-            cert.revoke().waitFor(60000);
+            cert.revoke(RevocationType.SUPPORT).waitFor(60000);
             // send notification to support
             String subject = "Revoke certificate";
             Outputable message = SprintfCommand.createSimple("Certificate with serial number {0} for {1} <{2}> has been revoked.", cert.getSerial(), target.getPreferredName().toString(), target.getEmail());
@@ -174,13 +175,14 @@ public class SupportedUser {
         }
     }
 
-    public void triggerPasswordReset(String aword, HttpServletRequest req) {
+    public void triggerPasswordReset(String aword, HttpServletRequest req) throws GigiApiException {
         Language l = Language.getInstance(target.getPreferredLocale());
         String method = l.getTranslation("A password reset was triggered. Please enter the required text sent to you by support on this page:");
         String subject = l.getTranslation("Password reset by support.");
         PasswordResetPage.initPasswordResetProcess(target, req, aword, l, method, subject);
         Outputable message = new TranslateCommand("A password reset was triggered and an email was sent to user.");
         sendSupportNotification(subject, message);
+        writeSELog("SE triggered password reset");
     }
 
     private void sendBoardNotification(String subject, Outputable message) {