1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-19 05:09:42 +02:00

improved event logging

This commit is contained in:
Harvey Kandola 2017-05-04 16:11:42 +01:00
parent 92eca1a1ce
commit 2d5b8e652f
13 changed files with 1882 additions and 4 deletions

View file

@ -83,6 +83,8 @@ func SaveSMTPConfig(w http.ResponseWriter, r *http.Request) {
request.ConfigSet("SMTP", config)
util.WriteSuccessEmptyJSON(w)
p.RecordEvent(entity.EventTypeSystemSMTP)
}
// GetLicense returns product license

View file

@ -556,8 +556,9 @@ const (
EventTypeUserDelete EventType = "removed-user"
EventTypeUserPasswordReset EventType = "reset-user-password"
EventTypeAccountAdd EventType = "added-account"
EventTypeSystemLicense EventType = "changed-license"
EventTypeSystemAuth EventType = "changed-auth-config"
EventTypeSystemLicense EventType = "changed-system-license"
EventTypeSystemAuth EventType = "changed-system-auth"
EventTypeSystemSMTP EventType = "changed-system-smtp"
EventTypeSessionStart EventType = "started-session"
EventTypeSearch EventType = "searched"
)

View file

@ -19,6 +19,7 @@ import (
"github.com/documize/community/core/api/entity"
"github.com/documize/community/core/log"
"github.com/documize/community/core/utility"
"github.com/pkg/errors"
)
// AddAccount inserts the given record into the datbase account table.
@ -30,14 +31,14 @@ func (p *Persister) AddAccount(account entity.Account) (err error) {
defer utility.Close(stmt)
if err != nil {
log.Error("Unable to prepare insert for account", err)
errors.Wrap(err, "Unable to prepare insert for account")
return
}
_, err = stmt.Exec(account.RefID, account.OrgID, account.UserID, account.Admin, account.Editor, account.Active, account.Created, account.Revised)
if err != nil {
log.Error("Unable to execute insert for account", err)
errors.Wrap(err, "Unable to execute insert for account")
return
}