changeset 5554:79155213c4da

Log if the modification of the user includes an reactivation request.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Thu, 18 Nov 2021 16:54:07 +0100
parents 0717168c1978
children 8e3f15822c81
files pkg/controllers/user.go
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/pkg/controllers/user.go	Thu Nov 18 16:18:01 2021 +0100
+++ b/pkg/controllers/user.go	Thu Nov 18 16:54:07 2021 +0100
@@ -415,7 +415,13 @@
 		go func() { auth.Sessions.Logout(string(user)) }()
 	}
 
-	log.Infof("User '%s' modified.\n", user)
+	// Log if the user should be reactivated, even if he is already active.
+	var reactivated string
+	if patch.Active != nil && *patch.Active && priv {
+		reactivated = " (reactivation requested)"
+	}
+
+	log.Infof("User '%s' modified%s.\n", user, reactivated)
 
 	jr = mw.JSONResult{
 		Code: http.StatusCreated,