diff options
author | Christopher Speller <crspeller@gmail.com> | 2018-04-27 14:12:01 -0700 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2018-04-27 14:12:01 -0700 |
commit | eb9ff34fcfa51cd8205841a02f3d3d61ec5be8fa (patch) | |
tree | ed01fd9488bd86f6c2daf0b299dff5beb43973db /app/security_update_check.go | |
parent | 2386acb3ddabd8827e21b1862c338a8b13a25de6 (diff) | |
parent | 2e6b3da1d3466db379fef0d61a23e2878d17ee9d (diff) | |
download | chat-eb9ff34fcfa51cd8205841a02f3d3d61ec5be8fa.tar.gz chat-eb9ff34fcfa51cd8205841a02f3d3d61ec5be8fa.tar.bz2 chat-eb9ff34fcfa51cd8205841a02f3d3d61ec5be8fa.zip |
Merge branch 'master' into advanced-permissions-phase-2
Diffstat (limited to 'app/security_update_check.go')
-rw-r--r-- | app/security_update_check.go | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/app/security_update_check.go b/app/security_update_check.go index 1f1759fef..15bb81e5a 100644 --- a/app/security_update_check.go +++ b/app/security_update_check.go @@ -4,13 +4,14 @@ package app import ( + "fmt" "io/ioutil" "net/http" "net/url" "runtime" "strconv" - l4g "github.com/alecthomas/log4go" + "github.com/mattermost/mattermost-server/mlog" "github.com/mattermost/mattermost-server/model" "github.com/mattermost/mattermost-server/utils" ) @@ -38,7 +39,7 @@ func (a *App) DoSecurityUpdateCheck() { currentTime := model.GetMillis() if (currentTime - lastSecurityTime) > SECURITY_UPDATE_PERIOD { - l4g.Debug(utils.T("mattermost.security_checks.debug")) + mlog.Debug("Checking for security update from Mattermost") v := url.Values{} @@ -75,7 +76,7 @@ func (a *App) DoSecurityUpdateCheck() { res, err := http.Get(SECURITY_URL + "/security?" + v.Encode()) if err != nil { - l4g.Error(utils.T("mattermost.security_info.error")) + mlog.Error("Failed to get security update information from Mattermost.") return } @@ -86,26 +87,26 @@ func (a *App) DoSecurityUpdateCheck() { if bulletin.AppliesToVersion == model.CurrentVersion { if props["SecurityBulletin_"+bulletin.Id] == "" { if results := <-a.Srv.Store.User().GetSystemAdminProfiles(); results.Err != nil { - l4g.Error(utils.T("mattermost.system_admins.error")) + mlog.Error("Failed to get system admins for security update information from Mattermost.") return } else { users := results.Data.(map[string]*model.User) resBody, err := http.Get(SECURITY_URL + "/bulletins/" + bulletin.Id) if err != nil { - l4g.Error(utils.T("mattermost.security_bulletin.error")) + mlog.Error("Failed to get security bulletin details") return } body, err := ioutil.ReadAll(resBody.Body) res.Body.Close() if err != nil || resBody.StatusCode != 200 { - l4g.Error(utils.T("mattermost.security_bulletin_read.error")) + mlog.Error("Failed to read security bulletin details") return } for _, user := range users { - l4g.Info(utils.T("mattermost.send_bulletin.info"), bulletin.Id, user.Email) + mlog.Info(fmt.Sprintf("Sending security bulletin for %v to %v", bulletin.Id, user.Email)) a.SendMail(user.Email, utils.T("mattermost.bulletin.subject"), string(body)) } } |