[MM-28363] User Limit Overage Warning Emails (#16053)
* Adding files, commit of UI in good shape * Translations added, working with activation and deactivation * Add check for error * Fix i18n? * Push without subscription check so Steve and Matt can look at it * Fix font-weight in chrome * Fix font-weight on button * UX fixes * Fixes for PR * Add back subscription stuff * Fix tests Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
19
api4/user.go
19
api4/user.go
@@ -155,6 +155,15 @@ func createUser(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
// New user created, check cloud limits and send emails if needed
|
||||
if ruser != nil {
|
||||
err = c.App.CheckAndSendUserLimitWarningEmails()
|
||||
if err != nil {
|
||||
c.Err = err
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
auditRec.Success()
|
||||
auditRec.AddMeta("user", ruser) // overwrite meta
|
||||
|
||||
@@ -1349,6 +1358,16 @@ func updateUserActive(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_USER_ACTIVATION_STATUS_CHANGE, "", "", "", nil)
|
||||
c.App.Publish(message)
|
||||
|
||||
// If activating, run cloud check for limit overages
|
||||
if active {
|
||||
emailErr := c.App.CheckAndSendUserLimitWarningEmails()
|
||||
if emailErr != nil {
|
||||
c.Err = emailErr
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
ReturnStatusOK(w)
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user