summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/file.go11
-rw-r--r--app/notification.go4
-rw-r--r--app/oauth.go6
3 files changed, 14 insertions, 7 deletions
diff --git a/app/file.go b/app/file.go
index 03d898acd..2ec6694b4 100644
--- a/app/file.go
+++ b/app/file.go
@@ -115,8 +115,11 @@ func MoveFile(oldPath, newPath string) *model.AppError {
secretKey := utils.Cfg.FileSettings.AmazonS3SecretAccessKey
secure := *utils.Cfg.FileSettings.AmazonS3SSL
signV2 := *utils.Cfg.FileSettings.AmazonS3SignV2
- encrypt := *utils.Cfg.FileSettings.AmazonS3SSE
region := utils.Cfg.FileSettings.AmazonS3Region
+ encrypt := false
+ if *utils.Cfg.FileSettings.AmazonS3SSE && utils.IsLicensed && *utils.License.Features.Compliance {
+ encrypt = true
+ }
s3Clnt, err := s3New(endpoint, accessKey, secretKey, secure, signV2, region)
if err != nil {
return model.NewLocAppError("moveFile", "api.file.write_file.s3.app_error", nil, err.Error())
@@ -156,8 +159,12 @@ func WriteFile(f []byte, path string) *model.AppError {
secretKey := utils.Cfg.FileSettings.AmazonS3SecretAccessKey
secure := *utils.Cfg.FileSettings.AmazonS3SSL
signV2 := *utils.Cfg.FileSettings.AmazonS3SignV2
- encrypt := *utils.Cfg.FileSettings.AmazonS3SSE
region := utils.Cfg.FileSettings.AmazonS3Region
+ encrypt := false
+ if *utils.Cfg.FileSettings.AmazonS3SSE && utils.IsLicensed && *utils.License.Features.Compliance {
+ encrypt = true
+ }
+
s3Clnt, err := s3New(endpoint, accessKey, secretKey, secure, signV2, region)
if err != nil {
return model.NewLocAppError("WriteFile", "api.file.write_file.s3.app_error", nil, err.Error())
diff --git a/app/notification.go b/app/notification.go
index 69bfa3b7a..21271c716 100644
--- a/app/notification.go
+++ b/app/notification.go
@@ -333,8 +333,8 @@ func sendNotificationEmail(post *model.Post, user *model.User, channel *model.Ch
if *utils.Cfg.EmailSettings.EnableEmailBatching {
var sendBatched bool
if result := <-Srv.Store.Preference().Get(user.Id, model.PREFERENCE_CATEGORY_NOTIFICATIONS, model.PREFERENCE_NAME_EMAIL_INTERVAL); result.Err != nil {
- // if the call fails, assume it hasn't been set and don't batch notifications for this user
- sendBatched = false
+ // if the call fails, assume that the interval has not been explicitly set and batch the notifications
+ sendBatched = true
} else {
// if the user has chosen to receive notifications immediately, don't batch them
sendBatched = result.Data.(model.Preference).Value != model.PREFERENCE_EMAIL_INTERVAL_NO_BATCHING_SECONDS
diff --git a/app/oauth.go b/app/oauth.go
index d9129dd6f..f8ddc6076 100644
--- a/app/oauth.go
+++ b/app/oauth.go
@@ -682,16 +682,16 @@ func AuthorizeOAuthUser(w http.ResponseWriter, r *http.Request, service, code, s
ar = model.AccessResponseFromJson(resp.Body)
defer CloseBody(resp)
if ar == nil {
- return nil, "", nil, model.NewLocAppError("AuthorizeOAuthUser", "api.user.authorize_oauth_user.bad_response.app_error", nil, "response_body="+string(bodyBytes))
+ return nil, "", stateProps, model.NewLocAppError("AuthorizeOAuthUser", "api.user.authorize_oauth_user.bad_response.app_error", nil, "response_body="+string(bodyBytes))
}
}
if strings.ToLower(ar.TokenType) != model.ACCESS_TOKEN_TYPE {
- return nil, "", nil, model.NewLocAppError("AuthorizeOAuthUser", "api.user.authorize_oauth_user.bad_token.app_error", nil, "token_type="+ar.TokenType+", response_body="+string(bodyBytes))
+ return nil, "", stateProps, model.NewLocAppError("AuthorizeOAuthUser", "api.user.authorize_oauth_user.bad_token.app_error", nil, "token_type="+ar.TokenType+", response_body="+string(bodyBytes))
}
if len(ar.AccessToken) == 0 {
- return nil, "", nil, model.NewLocAppError("AuthorizeOAuthUser", "api.user.authorize_oauth_user.missing.app_error", nil, "response_body="+string(bodyBytes))
+ return nil, "", stateProps, model.NewLocAppError("AuthorizeOAuthUser", "api.user.authorize_oauth_user.missing.app_error", nil, "response_body="+string(bodyBytes))
}
p = url.Values{}