1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-24 07:39:43 +02:00

event logging

This commit is contained in:
Harvey Kandola 2017-05-04 12:31:52 +01:00
parent b6c676149a
commit 93ed361705
48 changed files with 861 additions and 853 deletions

View file

@ -18,9 +18,11 @@ import (
"encoding/xml"
"fmt"
"github.com/documize/community/core/api/entity"
"github.com/documize/community/core/api/request"
"github.com/documize/community/core/api/util"
"github.com/documize/community/core/event"
"github.com/documize/community/core/log"
)
// GetSMTPConfig returns installation-wide SMTP settings
@ -160,6 +162,15 @@ func SaveLicense(w http.ResponseWriter, r *http.Request) {
event.Handler().Publish(string(event.TypeSystemLicenseChange))
p.Context.Transaction, err = request.Db.Beginx()
if err != nil {
writeTransactionError(w, method, err)
return
}
p.RecordEvent(entity.EventTypeSystemLicense)
log.IfErr(p.Context.Transaction.Commit())
util.WriteSuccessEmptyJSON(w)
}
@ -227,6 +238,8 @@ func SaveAuthConfig(w http.ResponseWriter, r *http.Request) {
return
}
p.RecordEvent(entity.EventTypeSystemAuth)
p.Context.Transaction.Commit()
util.WriteSuccessEmptyJSON(w)