Deactivating and invalidating sessions of guest users on guest disable (#13007)
Automatic Merge
Этот коммит содержится в:
коммит произвёл
mattermod
родитель
6a75d2fc68
Коммит
7031f51b41
@@ -1051,6 +1051,11 @@ func updateUserActive(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
if active && user.IsGuest() && !*c.App.Config().GuestAccountsSettings.Enable {
|
||||
c.Err = model.NewAppError("updateUserActive", "api.user.update_active.cannot_enable_guest_when_guest_feature_is_disabled.app_error", nil, "userId="+c.Params.UserId, http.StatusUnauthorized)
|
||||
return
|
||||
}
|
||||
|
||||
if _, err = c.App.UpdateActive(user, active); err != nil {
|
||||
c.Err = err
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user