changeset 5552:5680c44ff6c0

Log if user was created/modified/deactivated/deleted.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Thu, 18 Nov 2021 15:56:12 +0100
parents e9ef27c75e5c
children 0717168c1978
files pkg/controllers/user.go
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/pkg/controllers/user.go	Sun Nov 07 22:45:11 2021 +0100
+++ b/pkg/controllers/user.go	Thu Nov 18 15:56:12 2021 +0100
@@ -189,6 +189,8 @@
 	// Running in a go routine should not be necessary.
 	go func() { auth.Sessions.Logout(user) }()
 
+	log.Infof("User '%s' deleted/deactivated.\n", user)
+
 	jr = mw.JSONResult{
 		Result: struct {
 			Action string `json:"action"`
@@ -279,6 +281,8 @@
 		go func() { auth.Sessions.Logout(string(user)) }()
 	}
 
+	log.Infof("User '%s' updated.\n", user)
+
 	jr = mw.JSONResult{
 		Code: http.StatusCreated,
 		Result: struct {
@@ -413,6 +417,8 @@
 		go func() { auth.Sessions.Logout(string(user)) }()
 	}
 
+	log.Infof("User '%s' modified.\n", user)
+
 	jr = mw.JSONResult{
 		Code: http.StatusCreated,
 		Result: struct {
@@ -460,6 +466,8 @@
 		return
 	}
 
+	log.Infof("User '%s' created.\n", user.User)
+
 	jr = mw.JSONResult{
 		Code: http.StatusCreated,
 		Result: struct {