spelling (#19956)
* spelling: activated Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: attachments Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: categories Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: category Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: cellspacing Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: channel Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: compliance Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: constraint Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: counts Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: createat Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: deactivate Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: destination Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: exceeded Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: failed Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: foreign Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: hours Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: inactivity Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: inappropriate Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: initialization Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: initialized Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: management Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: mismatch Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: recipients Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: scheme Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: signature Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: subscription Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: suggestions Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: sync Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: telemetry Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: webhook Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * Trigger CI ```release-note NONE ``` Co-authored-by: Josh Soref <jsoref@users.noreply.github.com> Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
d1de4857aa
Коммит
16b1cbd6e3
@@ -339,7 +339,7 @@ func getInvoicesForSubscription(c *Context, w http.ResponseWriter, r *http.Reque
|
|||||||
|
|
||||||
func getSubscriptionInvoicePDF(c *Context, w http.ResponseWriter, r *http.Request) {
|
func getSubscriptionInvoicePDF(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||||
if c.App.Channels().License() == nil || !*c.App.Channels().License().Features.Cloud {
|
if c.App.Channels().License() == nil || !*c.App.Channels().License().Features.Cloud {
|
||||||
c.Err = model.NewAppError("Api4.getSuscriptionInvoicePDF", "api.cloud.license_error", nil, "", http.StatusNotImplemented)
|
c.Err = model.NewAppError("Api4.getSubscriptionInvoicePDF", "api.cloud.license_error", nil, "", http.StatusNotImplemented)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -355,7 +355,7 @@ func getSubscriptionInvoicePDF(c *Context, w http.ResponseWriter, r *http.Reques
|
|||||||
|
|
||||||
pdfData, filename, appErr := c.App.Cloud().GetInvoicePDF(c.AppContext.Session().UserId, c.Params.InvoiceId)
|
pdfData, filename, appErr := c.App.Cloud().GetInvoicePDF(c.AppContext.Session().UserId, c.Params.InvoiceId)
|
||||||
if appErr != nil {
|
if appErr != nil {
|
||||||
c.Err = model.NewAppError("Api4.getSuscriptionInvoicePDF", "api.cloud.request_error", nil, appErr.Error(), http.StatusInternalServerError)
|
c.Err = model.NewAppError("Api4.getSubscriptionInvoicePDF", "api.cloud.request_error", nil, appErr.Error(), http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1429,15 +1429,15 @@ func updateUserActive(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
auditRec.AddMeta("active", active)
|
auditRec.AddMeta("active", active)
|
||||||
|
|
||||||
// true when you're trying to de-activate yourself
|
// true when you're trying to de-activate yourself
|
||||||
isSelfDeactive := !active && c.Params.UserId == c.AppContext.Session().UserId
|
isSelfDeactivate := !active && c.Params.UserId == c.AppContext.Session().UserId
|
||||||
|
|
||||||
if !isSelfDeactive && !c.App.SessionHasPermissionTo(*c.AppContext.Session(), model.PermissionSysconsoleWriteUserManagementUsers) {
|
if !isSelfDeactivate && !c.App.SessionHasPermissionTo(*c.AppContext.Session(), model.PermissionSysconsoleWriteUserManagementUsers) {
|
||||||
c.Err = model.NewAppError("updateUserActive", "api.user.update_active.permissions.app_error", nil, "userId="+c.Params.UserId, http.StatusForbidden)
|
c.Err = model.NewAppError("updateUserActive", "api.user.update_active.permissions.app_error", nil, "userId="+c.Params.UserId, http.StatusForbidden)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// if EnableUserDeactivation flag is disabled the user cannot deactivate himself.
|
// if EnableUserDeactivation flag is disabled the user cannot deactivate himself.
|
||||||
if isSelfDeactive && !*c.App.Config().TeamSettings.EnableUserDeactivation {
|
if isSelfDeactivate && !*c.App.Config().TeamSettings.EnableUserDeactivation {
|
||||||
c.Err = model.NewAppError("updateUserActive", "api.user.update_active.not_enable.app_error", nil, "userId="+c.Params.UserId, http.StatusUnauthorized)
|
c.Err = model.NewAppError("updateUserActive", "api.user.update_active.not_enable.app_error", nil, "userId="+c.Params.UserId, http.StatusUnauthorized)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -1466,7 +1466,7 @@ func updateUserActive(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
auditRec.Success()
|
auditRec.Success()
|
||||||
c.LogAudit(fmt.Sprintf("user_id=%s active=%v", user.Id, active))
|
c.LogAudit(fmt.Sprintf("user_id=%s active=%v", user.Id, active))
|
||||||
|
|
||||||
if isSelfDeactive {
|
if isSelfDeactivate {
|
||||||
c.App.Srv().Go(func() {
|
c.App.Srv().Go(func() {
|
||||||
if err := c.App.Srv().EmailService.SendDeactivateAccountEmail(user.Email, user.Locale, c.App.GetSiteURL()); err != nil {
|
if err := c.App.Srv().EmailService.SendDeactivateAccountEmail(user.Email, user.Locale, c.App.GetSiteURL()); err != nil {
|
||||||
c.LogErrorByCode(model.NewAppError("SendDeactivateEmail", "api.user.send_deactivate_email_and_forget.failed.error", nil, err.Error(), http.StatusInternalServerError))
|
c.LogErrorByCode(model.NewAppError("SendDeactivateEmail", "api.user.send_deactivate_email_and_forget.failed.error", nil, err.Error(), http.StatusInternalServerError))
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ func createIncomingHook(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
userId := c.AppContext.Session().UserId
|
userId := c.AppContext.Session().UserId
|
||||||
if hook.UserId != "" && hook.UserId != userId {
|
if hook.UserId != "" && hook.UserId != userId {
|
||||||
if !c.App.SessionHasPermissionToTeam(*c.AppContext.Session(), channel.TeamId, model.PermissionManageOthersIncomingWebhooks) {
|
if !c.App.SessionHasPermissionToTeam(*c.AppContext.Session(), channel.TeamId, model.PermissionManageOthersIncomingWebhooks) {
|
||||||
c.LogAudit("fail - innapropriate permissions")
|
c.LogAudit("fail - inappropriate permissions")
|
||||||
c.SetPermissionError(model.PermissionManageOthersIncomingWebhooks)
|
c.SetPermissionError(model.PermissionManageOthersIncomingWebhooks)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -414,7 +414,7 @@ func createOutgoingHook(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
hook.CreatorId = c.AppContext.Session().UserId
|
hook.CreatorId = c.AppContext.Session().UserId
|
||||||
} else {
|
} else {
|
||||||
if !c.App.SessionHasPermissionToTeam(*c.AppContext.Session(), hook.TeamId, model.PermissionManageOthersOutgoingWebhooks) {
|
if !c.App.SessionHasPermissionToTeam(*c.AppContext.Session(), hook.TeamId, model.PermissionManageOthersOutgoingWebhooks) {
|
||||||
c.LogAudit("fail - innapropriate permissions")
|
c.LogAudit("fail - inappropriate permissions")
|
||||||
c.SetPermissionError(model.PermissionManageOthersOutgoingWebhooks)
|
c.SetPermissionError(model.PermissionManageOthersOutgoingWebhooks)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -242,7 +242,7 @@ func (a *App) TestEmail(userID string, cfg *model.Config) *model.AppError {
|
|||||||
func (s *Server) serverBusyStateChanged(sbs *model.ServerBusyState) {
|
func (s *Server) serverBusyStateChanged(sbs *model.ServerBusyState) {
|
||||||
s.Busy.ClusterEventChanged(sbs)
|
s.Busy.ClusterEventChanged(sbs)
|
||||||
if sbs.Busy {
|
if sbs.Busy {
|
||||||
mlog.Warn("server busy state activitated via cluster event - non-critical services disabled", mlog.Int64("expires_sec", sbs.Expires))
|
mlog.Warn("server busy state activated via cluster event - non-critical services disabled", mlog.Int64("expires_sec", sbs.Expires))
|
||||||
} else {
|
} else {
|
||||||
mlog.Info("server busy state cleared via cluster event - non-critical services enabled")
|
mlog.Info("server busy state cleared via cluster event - non-critical services enabled")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ func (a *App) GetComplianceReport(reportId string) (*model.Compliance, *model.Ap
|
|||||||
var nfErr *store.ErrNotFound
|
var nfErr *store.ErrNotFound
|
||||||
switch {
|
switch {
|
||||||
case errors.As(err, &nfErr):
|
case errors.As(err, &nfErr):
|
||||||
return nil, model.NewAppError("GetComplicanceReport", "app.compliance.get.finding.app_error", nil, nfErr.Error(), http.StatusNotFound)
|
return nil, model.NewAppError("GetComplianceReport", "app.compliance.get.finding.app_error", nil, nfErr.Error(), http.StatusNotFound)
|
||||||
default:
|
default:
|
||||||
return nil, model.NewAppError("GetComplianceReport", "app.compliance.get.finding.app_error", nil, err.Error(), http.StatusInternalServerError)
|
return nil, model.NewAppError("GetComplianceReport", "app.compliance.get.finding.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ func (s *Server) setupFeatureFlags() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Server) updateFeatureFlagValuesFromManagment() {
|
func (s *Server) updateFeatureFlagValuesFromManagement() {
|
||||||
newCfg := s.configStore.GetNoEnv().Clone()
|
newCfg := s.configStore.GetNoEnv().Clone()
|
||||||
oldFlags := *newCfg.FeatureFlags
|
oldFlags := *newCfg.FeatureFlags
|
||||||
newFlags := s.featureFlagSynchronizer.UpdateFeatureFlagValues(oldFlags)
|
newFlags := s.featureFlagSynchronizer.UpdateFeatureFlagValues(oldFlags)
|
||||||
@@ -94,13 +94,13 @@ func (s *Server) startFeatureFlagUpdateJob() error {
|
|||||||
s.Log.Warn("Problem connecting to feature flag management. Will fallback to cloud cache.", mlog.Err(err))
|
s.Log.Warn("Problem connecting to feature flag management. Will fallback to cloud cache.", mlog.Err(err))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
s.updateFeatureFlagValuesFromManagment()
|
s.updateFeatureFlagValuesFromManagement()
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case <-s.featureFlagStop:
|
case <-s.featureFlagStop:
|
||||||
return
|
return
|
||||||
case <-ticker.C:
|
case <-ticker.C:
|
||||||
s.updateFeatureFlagValuesFromManagment()
|
s.updateFeatureFlagValuesFromManagement()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|||||||
@@ -832,13 +832,13 @@ func (a *App) importUserTeams(user *model.User, data *[]UserTeamImportData) *mod
|
|||||||
if nErr != nil {
|
if nErr != nil {
|
||||||
var appErr *model.AppError
|
var appErr *model.AppError
|
||||||
var conflictErr *store.ErrConflict
|
var conflictErr *store.ErrConflict
|
||||||
var limitExeededErr *store.ErrLimitExceeded
|
var limitExceededErr *store.ErrLimitExceeded
|
||||||
switch {
|
switch {
|
||||||
case errors.As(nErr, &appErr): // in case we haven't converted to plain error.
|
case errors.As(nErr, &appErr): // in case we haven't converted to plain error.
|
||||||
return appErr
|
return appErr
|
||||||
case errors.As(nErr, &conflictErr):
|
case errors.As(nErr, &conflictErr):
|
||||||
return model.NewAppError("BulkImport", "app.import.import_user_teams.save_members.conflict.app_error", nil, nErr.Error(), http.StatusBadRequest)
|
return model.NewAppError("BulkImport", "app.import.import_user_teams.save_members.conflict.app_error", nil, nErr.Error(), http.StatusBadRequest)
|
||||||
case errors.As(nErr, &limitExeededErr):
|
case errors.As(nErr, &limitExceededErr):
|
||||||
return model.NewAppError("BulkImport", "app.import.import_user_teams.save_members.max_accounts.app_error", nil, nErr.Error(), http.StatusBadRequest)
|
return model.NewAppError("BulkImport", "app.import.import_user_teams.save_members.max_accounts.app_error", nil, nErr.Error(), http.StatusBadRequest)
|
||||||
default: // last fallback in case it doesn't map to an existing app error.
|
default: // last fallback in case it doesn't map to an existing app error.
|
||||||
return model.NewAppError("BulkImport", "app.import.import_user_teams.save_members.error", nil, nErr.Error(), http.StatusInternalServerError)
|
return model.NewAppError("BulkImport", "app.import.import_user_teams.save_members.error", nil, nErr.Error(), http.StatusInternalServerError)
|
||||||
|
|||||||
@@ -509,13 +509,13 @@ func (a *App) doLocalWarnMetricsRequest(c *request.Context, rawURL string, upstr
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
attachements := []*model.SlackAttachment{{
|
attachments := []*model.SlackAttachment{{
|
||||||
AuthorName: "",
|
AuthorName: "",
|
||||||
Title: "",
|
Title: "",
|
||||||
Actions: actions,
|
Actions: actions,
|
||||||
Text: i18n.T("api.server.warn_metric.bot_response.notification_failure.body"),
|
Text: i18n.T("api.server.warn_metric.bot_response.notification_failure.body"),
|
||||||
}}
|
}}
|
||||||
model.ParseSlackAttachment(botPost, attachements)
|
model.ParseSlackAttachment(botPost, attachments)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -338,10 +338,10 @@ func (a *App) SendNotifications(post *model.Post, team *model.Team, channel *mod
|
|||||||
}
|
}
|
||||||
|
|
||||||
if *a.Config().EmailSettings.SendEmailNotifications {
|
if *a.Config().EmailSettings.SendEmailNotifications {
|
||||||
emailReceipients := append(mentionedUsersList, notificationsForCRT.Email...)
|
emailRecipients := append(mentionedUsersList, notificationsForCRT.Email...)
|
||||||
emailReceipients = model.RemoveDuplicateStrings(emailReceipients)
|
emailRecipients = model.RemoveDuplicateStrings(emailRecipients)
|
||||||
|
|
||||||
for _, id := range emailReceipients {
|
for _, id := range emailRecipients {
|
||||||
if profileMap[id] == nil {
|
if profileMap[id] == nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ func SetLogger(logger *mlog.Logger) Option {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func SkipPostInitializiation() Option {
|
func SkipPostInitialization() Option {
|
||||||
return func(s *Server) error {
|
return func(s *Server) error {
|
||||||
s.skipPostInit = true
|
s.skipPostInit = true
|
||||||
|
|
||||||
|
|||||||
@@ -98,12 +98,12 @@ func (ch *Channels) verifyPlugin(plugin, signature io.ReadSeeker) *model.AppErro
|
|||||||
return model.NewAppError("VerifyPlugin", "api.plugin.verify_plugin.app_error", nil, "", http.StatusInternalServerError)
|
return model.NewAppError("VerifyPlugin", "api.plugin.verify_plugin.app_error", nil, "", http.StatusInternalServerError)
|
||||||
}
|
}
|
||||||
|
|
||||||
func verifySignature(publicKey, message, signatrue io.Reader) error {
|
func verifySignature(publicKey, message, signature io.Reader) error {
|
||||||
pk, err := decodeIfArmored(publicKey)
|
pk, err := decodeIfArmored(publicKey)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "can't decode public key")
|
return errors.Wrap(err, "can't decode public key")
|
||||||
}
|
}
|
||||||
s, err := decodeIfArmored(signatrue)
|
s, err := decodeIfArmored(signature)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "can't decode signature")
|
return errors.Wrap(err, "can't decode signature")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -630,7 +630,7 @@ func NewServer(options ...Option) (*Server, error) {
|
|||||||
go func() {
|
go func() {
|
||||||
appInstance := New(ServerConnector(s.Channels()))
|
appInstance := New(ServerConnector(s.Channels()))
|
||||||
if err := appInstance.UpdateProductNotices(); err != nil {
|
if err := appInstance.UpdateProductNotices(); err != nil {
|
||||||
mlog.Warn("Failied to perform initial product notices fetch", mlog.Err(err))
|
mlog.Warn("Failed to perform initial product notices fetch", mlog.Err(err))
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,8 +27,8 @@ func (s *Server) doInactivityCheck() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
inactivityDurationHourseEnv := os.Getenv("MM_INACTIVITY_DURATION")
|
inactivityDurationHoursEnv := os.Getenv("MM_INACTIVITY_DURATION")
|
||||||
inactivityDurationHours, parseError := strconv.ParseFloat(inactivityDurationHourseEnv, 64)
|
inactivityDurationHours, parseError := strconv.ParseFloat(inactivityDurationHoursEnv, 64)
|
||||||
if parseError != nil {
|
if parseError != nil {
|
||||||
// default to 100 hours
|
// default to 100 hours
|
||||||
inactivityDurationHours = serverInactivityHours
|
inactivityDurationHours = serverInactivityHours
|
||||||
@@ -50,14 +50,14 @@ func (s *Server) doInactivityCheck() {
|
|||||||
if systemValue != nil {
|
if systemValue != nil {
|
||||||
sysT, _ := strconv.ParseInt(systemValue.Value, 10, 64)
|
sysT, _ := strconv.ParseInt(systemValue.Value, 10, 64)
|
||||||
tt := time.Unix(sysT/1000, 0)
|
tt := time.Unix(sysT/1000, 0)
|
||||||
timeLastSentInativityEmail := time.Since(tt).Hours()
|
timeLastSentInactivityEmail := time.Since(tt).Hours()
|
||||||
|
|
||||||
lastPostAt, _ := s.Store.Post().GetLastPostRowCreateAt()
|
lastPostAt, _ := s.Store.Post().GetLastPostRowCreateAt()
|
||||||
if lastPostAt != 0 {
|
if lastPostAt != 0 {
|
||||||
posT := time.Unix(lastPostAt/1000, 0)
|
posT := time.Unix(lastPostAt/1000, 0)
|
||||||
timeForLastPost := time.Since(posT).Hours()
|
timeForLastPost := time.Since(posT).Hours()
|
||||||
|
|
||||||
if timeLastSentInativityEmail > inactivityDurationHours && timeForLastPost > inactivityDurationHours {
|
if timeLastSentInactivityEmail > inactivityDurationHours && timeForLastPost > inactivityDurationHours {
|
||||||
s.takeInactivityAction()
|
s.takeInactivityAction()
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
@@ -68,7 +68,7 @@ func (s *Server) doInactivityCheck() {
|
|||||||
sesT := time.Unix(lastSessionAt/1000, 0)
|
sesT := time.Unix(lastSessionAt/1000, 0)
|
||||||
timeForLastSession := time.Since(sesT).Hours()
|
timeForLastSession := time.Since(sesT).Hours()
|
||||||
|
|
||||||
if timeLastSentInativityEmail > inactivityDurationHours && timeForLastSession > inactivityDurationHours {
|
if timeLastSentInactivityEmail > inactivityDurationHours && timeForLastSession > inactivityDurationHours {
|
||||||
s.takeInactivityAction()
|
s.takeInactivityAction()
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -650,7 +650,7 @@ func (a *App) JoinUserToTeam(c *request.Context, team *model.Team, user *model.U
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
var appErr *model.AppError
|
var appErr *model.AppError
|
||||||
var conflictErr *store.ErrConflict
|
var conflictErr *store.ErrConflict
|
||||||
var limitExeededErr *store.ErrLimitExceeded
|
var limitExceededErr *store.ErrLimitExceeded
|
||||||
switch {
|
switch {
|
||||||
case errors.Is(err, teams.AcceptedDomainError):
|
case errors.Is(err, teams.AcceptedDomainError):
|
||||||
return nil, model.NewAppError("JoinUserToTeam", "api.team.join_user_to_team.allowed_domains.app_error", nil, "", http.StatusBadRequest)
|
return nil, model.NewAppError("JoinUserToTeam", "api.team.join_user_to_team.allowed_domains.app_error", nil, "", http.StatusBadRequest)
|
||||||
@@ -662,7 +662,7 @@ func (a *App) JoinUserToTeam(c *request.Context, team *model.Team, user *model.U
|
|||||||
return nil, appErr
|
return nil, appErr
|
||||||
case errors.As(err, &conflictErr):
|
case errors.As(err, &conflictErr):
|
||||||
return nil, model.NewAppError("JoinUserToTeam", "app.team.join_user_to_team.save_member.conflict.app_error", nil, err.Error(), http.StatusBadRequest)
|
return nil, model.NewAppError("JoinUserToTeam", "app.team.join_user_to_team.save_member.conflict.app_error", nil, err.Error(), http.StatusBadRequest)
|
||||||
case errors.As(err, &limitExeededErr):
|
case errors.As(err, &limitExceededErr):
|
||||||
return nil, model.NewAppError("JoinUserToTeam", "app.team.join_user_to_team.save_member.max_accounts.app_error", nil, err.Error(), http.StatusBadRequest)
|
return nil, model.NewAppError("JoinUserToTeam", "app.team.join_user_to_team.save_member.max_accounts.app_error", nil, err.Error(), http.StatusBadRequest)
|
||||||
default: // last fallback in case it doesn't map to an existing app error.
|
default: // last fallback in case it doesn't map to an existing app error.
|
||||||
return nil, model.NewAppError("JoinUserToTeam", "app.team.join_user_to_team.save_member.app_error", nil, err.Error(), http.StatusInternalServerError)
|
return nil, model.NewAppError("JoinUserToTeam", "app.team.join_user_to_team.save_member.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||||
|
|||||||
@@ -147,9 +147,9 @@ SET @preparedStatement = (SELECT IF(
|
|||||||
'SELECT 1'
|
'SELECT 1'
|
||||||
));
|
));
|
||||||
|
|
||||||
PREPARE updateIfMissmatch FROM @preparedStatement;
|
PREPARE updateIfMismatch FROM @preparedStatement;
|
||||||
EXECUTE updateIfMissmatch;
|
EXECUTE updateIfMismatch;
|
||||||
DEALLOCATE PREPARE updateIfMissmatch;
|
DEALLOCATE PREPARE updateIfMismatch;
|
||||||
|
|
||||||
SET @preparedStatement = (SELECT IF(
|
SET @preparedStatement = (SELECT IF(
|
||||||
(
|
(
|
||||||
|
|||||||
@@ -8,6 +8,6 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type AccountMigrationInterface interface {
|
type AccountMigrationInterface interface {
|
||||||
MigrateToLdap(fromAuthService string, forignUserFieldNameToMatch string, force bool, dryRun bool) *model.AppError
|
MigrateToLdap(fromAuthService string, foreignUserFieldNameToMatch string, force bool, dryRun bool) *model.AppError
|
||||||
MigrateToSaml(fromAuthService string, usersMap map[string]string, auto bool, dryRun bool) *model.AppError
|
MigrateToSaml(fromAuthService string, usersMap map[string]string, auto bool, dryRun bool) *model.AppError
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,13 +14,13 @@ type AccountMigrationInterface struct {
|
|||||||
mock.Mock
|
mock.Mock
|
||||||
}
|
}
|
||||||
|
|
||||||
// MigrateToLdap provides a mock function with given fields: fromAuthService, forignUserFieldNameToMatch, force, dryRun
|
// MigrateToLdap provides a mock function with given fields: fromAuthService, foreignUserFieldNameToMatch, force, dryRun
|
||||||
func (_m *AccountMigrationInterface) MigrateToLdap(fromAuthService string, forignUserFieldNameToMatch string, force bool, dryRun bool) *model.AppError {
|
func (_m *AccountMigrationInterface) MigrateToLdap(fromAuthService string, foreignUserFieldNameToMatch string, force bool, dryRun bool) *model.AppError {
|
||||||
ret := _m.Called(fromAuthService, forignUserFieldNameToMatch, force, dryRun)
|
ret := _m.Called(fromAuthService, foreignUserFieldNameToMatch, force, dryRun)
|
||||||
|
|
||||||
var r0 *model.AppError
|
var r0 *model.AppError
|
||||||
if rf, ok := ret.Get(0).(func(string, string, bool, bool) *model.AppError); ok {
|
if rf, ok := ret.Get(0).(func(string, string, bool, bool) *model.AppError); ok {
|
||||||
r0 = rf(fromAuthService, forignUserFieldNameToMatch, force, dryRun)
|
r0 = rf(fromAuthService, foreignUserFieldNameToMatch, force, dryRun)
|
||||||
} else {
|
} else {
|
||||||
if ret.Get(0) != nil {
|
if ret.Get(0) != nil {
|
||||||
r0 = ret.Get(0).(*model.AppError)
|
r0 = ret.Get(0).(*model.AppError)
|
||||||
|
|||||||
@@ -260,7 +260,7 @@ type Hooks interface {
|
|||||||
// Minimum server version: 6.5
|
// Minimum server version: 6.5
|
||||||
OnInstall(c *Context, event model.OnInstallEvent) error
|
OnInstall(c *Context, event model.OnInstallEvent) error
|
||||||
|
|
||||||
// OnSendDailyTelemetry is invoked when the server send the daily telemtry data.
|
// OnSendDailyTelemetry is invoked when the server send the daily telemetry data.
|
||||||
//
|
//
|
||||||
// Minimum server version: 6.5
|
// Minimum server version: 6.5
|
||||||
OnSendDailyTelemetry()
|
OnSendDailyTelemetry()
|
||||||
|
|||||||
@@ -80,12 +80,12 @@ func BLVUserFromUserAndTeams(user *model.User, teamsIds, channelsIds []string) *
|
|||||||
fullnameSuggestions = searchengine.GetSuggestionInputsSplitBy(fullname, " ")
|
fullnameSuggestions = searchengine.GetSuggestionInputsSplitBy(fullname, " ")
|
||||||
}
|
}
|
||||||
|
|
||||||
nicknameSuggesitons := []string{}
|
nicknameSuggestions := []string{}
|
||||||
if user.Nickname != "" {
|
if user.Nickname != "" {
|
||||||
nicknameSuggesitons = searchengine.GetSuggestionInputsSplitBy(user.Nickname, " ")
|
nicknameSuggestions = searchengine.GetSuggestionInputsSplitBy(user.Nickname, " ")
|
||||||
}
|
}
|
||||||
|
|
||||||
usernameAndNicknameSuggestions := append(usernameSuggestions, nicknameSuggesitons...)
|
usernameAndNicknameSuggestions := append(usernameSuggestions, nicknameSuggestions...)
|
||||||
|
|
||||||
return &BLVUser{
|
return &BLVUser{
|
||||||
Id: user.Id,
|
Id: user.Id,
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ func New() (*Tracer, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
mlog.Info("Opentracing initialzed")
|
mlog.Info("Opentracing initialized")
|
||||||
return &Tracer{
|
return &Tracer{
|
||||||
closer: closer,
|
closer: closer,
|
||||||
}, nil
|
}, nil
|
||||||
|
|||||||
@@ -297,7 +297,7 @@ func (b *S3FileBackend) MoveFile(oldPath, newPath string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if _, err := b.client.CopyObject(context.Background(), dstOpts, srcOpts); err != nil {
|
if _, err := b.client.CopyObject(context.Background(), dstOpts, srcOpts); err != nil {
|
||||||
return errors.Wrapf(err, "unable to copy the file to %s to the new destionation", newPath)
|
return errors.Wrapf(err, "unable to copy the file to %s to the new destination", newPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := b.client.RemoveObject(context.Background(), b.bucket, oldPath, s3.RemoveObjectOptions{}); err != nil {
|
if err := b.client.RemoveObject(context.Background(), b.bucket, oldPath, s3.RemoveObjectOptions{}); err != nil {
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ type ErrUniqueConstraint struct {
|
|||||||
// Examples:
|
// Examples:
|
||||||
//
|
//
|
||||||
// store.NewErrUniqueConstraint("DisplayName") // single column constraint
|
// store.NewErrUniqueConstraint("DisplayName") // single column constraint
|
||||||
// store.NewErrUniqueConstraint("Name", "Source") // multi-column constaint
|
// store.NewErrUniqueConstraint("Name", "Source") // multi-column constraint
|
||||||
func NewErrUniqueConstraint(columns ...string) *ErrUniqueConstraint {
|
func NewErrUniqueConstraint(columns ...string) *ErrUniqueConstraint {
|
||||||
return &ErrUniqueConstraint{
|
return &ErrUniqueConstraint{
|
||||||
Columns: columns,
|
Columns: columns,
|
||||||
|
|||||||
@@ -35,8 +35,8 @@ const (
|
|||||||
EmojiCacheSize = 5000
|
EmojiCacheSize = 5000
|
||||||
EmojiCacheSec = 30 * 60
|
EmojiCacheSec = 30 * 60
|
||||||
|
|
||||||
ChannelPinnedPostsCounsCacheSize = model.ChannelCacheSize
|
ChannelPinnedPostsCountsCacheSize = model.ChannelCacheSize
|
||||||
ChannelPinnedPostsCountsCacheSec = 30 * 60
|
ChannelPinnedPostsCountsCacheSec = 30 * 60
|
||||||
|
|
||||||
ChannelMembersCountsCacheSize = model.ChannelCacheSize
|
ChannelMembersCountsCacheSize = model.ChannelCacheSize
|
||||||
ChannelMembersCountsCacheSec = 30 * 60
|
ChannelMembersCountsCacheSec = 30 * 60
|
||||||
@@ -206,7 +206,7 @@ func NewLocalCacheLayer(baseStore store.Store, metrics einterfaces.MetricsInterf
|
|||||||
|
|
||||||
// Channels
|
// Channels
|
||||||
if localCacheStore.channelPinnedPostCountsCache, err = cacheProvider.NewCache(&cache.CacheOptions{
|
if localCacheStore.channelPinnedPostCountsCache, err = cacheProvider.NewCache(&cache.CacheOptions{
|
||||||
Size: ChannelPinnedPostsCounsCacheSize,
|
Size: ChannelPinnedPostsCountsCacheSize,
|
||||||
Name: "ChannelPinnedPostsCounts",
|
Name: "ChannelPinnedPostsCounts",
|
||||||
DefaultExpiry: ChannelPinnedPostsCountsCacheSec * time.Second,
|
DefaultExpiry: ChannelPinnedPostsCountsCacheSec * time.Second,
|
||||||
InvalidateClusterEvent: model.ClusterEventInvalidateCacheForChannelPinnedpostsCounts,
|
InvalidateClusterEvent: model.ClusterEventInvalidateCacheForChannelPinnedpostsCounts,
|
||||||
|
|||||||
@@ -1326,7 +1326,7 @@ func (s SqlChannelStore) GetPrivateChannelsForTeam(teamId string, offset int, li
|
|||||||
|
|
||||||
err = s.GetReplicaX().Select(&channels, query, args...)
|
err = s.GetReplicaX().Select(&channels, query, args...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrapf(err, "failed to find chaneld with teamId=%s", teamId)
|
return nil, errors.Wrapf(err, "failed to find channel with teamId=%s", teamId)
|
||||||
}
|
}
|
||||||
return channels, nil
|
return channels, nil
|
||||||
}
|
}
|
||||||
@@ -1349,7 +1349,7 @@ func (s SqlChannelStore) GetPublicChannelsForTeam(teamId string, offset int, lim
|
|||||||
`, teamId, limit, offset)
|
`, teamId, limit, offset)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrapf(err, "failed to find chaneld with teamId=%s", teamId)
|
return nil, errors.Wrapf(err, "failed to find channel with teamId=%s", teamId)
|
||||||
}
|
}
|
||||||
|
|
||||||
return channels, nil
|
return channels, nil
|
||||||
@@ -2229,7 +2229,7 @@ func (s SqlChannelStore) GetMemberCount(channelId string, allowFromCache bool) (
|
|||||||
AND ChannelMembers.ChannelId = ?
|
AND ChannelMembers.ChannelId = ?
|
||||||
AND Users.DeleteAt = 0`, channelId)
|
AND Users.DeleteAt = 0`, channelId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, errors.Wrapf(err, "failed to count ChanenelMembers with channelId=%s", channelId)
|
return 0, errors.Wrapf(err, "failed to count ChannelMembers with channelId=%s", channelId)
|
||||||
}
|
}
|
||||||
|
|
||||||
return count, nil
|
return count, nil
|
||||||
|
|||||||
@@ -683,7 +683,7 @@ func (s SqlChannelStore) UpdateSidebarCategories(userId, teamId string, categori
|
|||||||
).ToSql()
|
).ToSql()
|
||||||
|
|
||||||
if err2 != nil {
|
if err2 != nil {
|
||||||
return nil, nil, errors.Wrap(err2, "update_sidebar_catetories_tosql")
|
return nil, nil, errors.Wrap(err2, "update_sidebar_categories_tosql")
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, err = transaction.Exec(query, args...); err != nil {
|
if _, err = transaction.Exec(query, args...); err != nil {
|
||||||
@@ -1017,7 +1017,7 @@ func (s SqlChannelStore) DeleteSidebarCategory(categoryId string) error {
|
|||||||
Delete("SidebarCategories").
|
Delete("SidebarCategories").
|
||||||
Where(sq.Eq{"Id": categoryId}).ToSql()
|
Where(sq.Eq{"Id": categoryId}).ToSql()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "delete_sidebar_cateory_tosql")
|
return errors.Wrap(err, "delete_sidebar_category_tosql")
|
||||||
}
|
}
|
||||||
if _, err = transaction.Exec(query, args...); err != nil {
|
if _, err = transaction.Exec(query, args...); err != nil {
|
||||||
return errors.Wrap(err, "failed to delete SidebarCategory")
|
return errors.Wrap(err, "failed to delete SidebarCategory")
|
||||||
@@ -1028,7 +1028,7 @@ func (s SqlChannelStore) DeleteSidebarCategory(categoryId string) error {
|
|||||||
Delete("SidebarChannels").
|
Delete("SidebarChannels").
|
||||||
Where(sq.Eq{"CategoryId": categoryId}).ToSql()
|
Where(sq.Eq{"CategoryId": categoryId}).ToSql()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "delete_sidebar_cateory_tosql")
|
return errors.Wrap(err, "delete_sidebar_category_tosql")
|
||||||
}
|
}
|
||||||
if _, err = transaction.Exec(query, args...); err != nil {
|
if _, err = transaction.Exec(query, args...); err != nil {
|
||||||
return errors.Wrap(err, "failed to delete SidebarChannel")
|
return errors.Wrap(err, "failed to delete SidebarChannel")
|
||||||
|
|||||||
@@ -226,7 +226,7 @@ func (me *SqlSessionStore) GetLastSessionRowCreateAt() (int64, error) {
|
|||||||
var createAt int64
|
var createAt int64
|
||||||
err := me.GetReplicaX().Get(&createAt, query)
|
err := me.GetReplicaX().Get(&createAt, query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, errors.Wrapf(err, "failed to get last session creatat")
|
return 0, errors.Wrapf(err, "failed to get last session createat")
|
||||||
}
|
}
|
||||||
|
|
||||||
return createAt, nil
|
return createAt, nil
|
||||||
|
|||||||
@@ -809,7 +809,7 @@ func (s SqlSharedChannelStore) UpdateAttachmentLastSyncAt(id string, syncTime in
|
|||||||
|
|
||||||
result, err := s.GetMasterX().Exec(squery, args...)
|
result, err := s.GetMasterX().Exec(squery, args...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "failed to update LastSycnAt for SharedChannelAttachment")
|
return errors.Wrap(err, "failed to update LastSyncAt for SharedChannelAttachment")
|
||||||
}
|
}
|
||||||
|
|
||||||
count, err := result.RowsAffected()
|
count, err := result.RowsAffected()
|
||||||
|
|||||||
@@ -1391,7 +1391,7 @@ func (s SqlTeamStore) AnalyticsGetTeamCountForScheme(schemeId string) (int64, er
|
|||||||
var count int64
|
var count int64
|
||||||
err = s.GetReplicaX().Get(&count, query, args...)
|
err = s.GetReplicaX().Get(&count, query, args...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, errors.Wrapf(err, "failed to count Teams with schemdId=%s", schemeId)
|
return 0, errors.Wrapf(err, "failed to count Teams with schemeId=%s", schemeId)
|
||||||
}
|
}
|
||||||
|
|
||||||
return count, nil
|
return count, nil
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ func (s SqlWebhookStore) GetIncomingByTeamByUser(teamId string, userId string, o
|
|||||||
}
|
}
|
||||||
|
|
||||||
if err := s.GetReplicaX().Select(&webhooks, queryString, args...); err != nil {
|
if err := s.GetReplicaX().Select(&webhooks, queryString, args...); err != nil {
|
||||||
return nil, errors.Wrapf(err, "failed to find IncomingWebhoook with teamId=%s", teamId)
|
return nil, errors.Wrapf(err, "failed to find IncomingWebhook with teamId=%s", teamId)
|
||||||
}
|
}
|
||||||
|
|
||||||
return webhooks, nil
|
return webhooks, nil
|
||||||
|
|||||||
@@ -51,7 +51,7 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<table align="center" border="0" cellpadding="0" cellspcing="0" width="612px">
|
<table align="center" border="0" cellpadding="0" cellspacing="0" width="612px">
|
||||||
<tr>
|
<tr>
|
||||||
<td style="border-bottom: 1px solid #E5E5E5"></td>
|
<td style="border-bottom: 1px solid #E5E5E5"></td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -66,7 +66,7 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<table align="center" border="0" cellpadding="0" cellspcing="0" width="612px">
|
<table align="center" border="0" cellpadding="0" cellspacing="0" width="612px">
|
||||||
<tr>
|
<tr>
|
||||||
<td style="border-bottom: 1px solid #E5E5E5"></td>
|
<td style="border-bottom: 1px solid #E5E5E5"></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -50,7 +50,7 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<table align="center" border="0" cellpadding="0" cellspcing="0" width="612px">
|
<table align="center" border="0" cellpadding="0" cellspacing="0" width="612px">
|
||||||
<tr>
|
<tr>
|
||||||
<td style="border-bottom: 1px solid #E5E5E5"></td>
|
<td style="border-bottom: 1px solid #E5E5E5"></td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -65,7 +65,7 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<table align="center" border="0" cellpadding="0" cellspcing="0" width="612px">
|
<table align="center" border="0" cellpadding="0" cellspacing="0" width="612px">
|
||||||
<tr>
|
<tr>
|
||||||
<td style="border-bottom: 1px solid #E5E5E5"></td>
|
<td style="border-bottom: 1px solid #E5E5E5"></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user