diff options
Diffstat (limited to 'api')
-rw-r--r-- | api/authentication.go | 2 | ||||
-rw-r--r-- | api/team.go | 4 | ||||
-rw-r--r-- | api/user.go | 2 | ||||
-rw-r--r-- | api/webhook.go | 2 |
4 files changed, 8 insertions, 2 deletions
diff --git a/api/authentication.go b/api/authentication.go index 9243947ad..d30fc0a1f 100644 --- a/api/authentication.go +++ b/api/authentication.go @@ -127,7 +127,7 @@ func checkUserNotDisabled(user *model.User) *model.AppError { } func authenticateUser(user *model.User, password, mfaToken string) (*model.User, *model.AppError) { - ldapAvailable := *utils.Cfg.LdapSettings.Enable && einterfaces.GetLdapInterface() != nil + ldapAvailable := *utils.Cfg.LdapSettings.Enable && einterfaces.GetLdapInterface() != nil && utils.IsLicensed && *utils.License.Features.LDAP if user.AuthService == model.USER_AUTH_SERVICE_LDAP { if !ldapAvailable { diff --git a/api/team.go b/api/team.go index f9b718e06..52d01b1cc 100644 --- a/api/team.go +++ b/api/team.go @@ -266,6 +266,10 @@ func JoinUserToTeam(team *model.Team, user *model.User) *model.AppError { return tmr.Err } + if uua := <-Srv.Store.User().UpdateUpdateAt(user.Id); uua.Err != nil { + return uua.Err + } + // Soft error if there is an issue joining the default channels if err := JoinDefaultChannels(team.Id, user, channelRole); err != nil { l4g.Error(utils.T("api.user.create_user.joining.error"), user.Id, team.Id, err) diff --git a/api/user.go b/api/user.go index 9e93ae779..559cda076 100644 --- a/api/user.go +++ b/api/user.go @@ -487,7 +487,7 @@ func login(c *Context, w http.ResponseWriter, r *http.Request) { } func getUserForLogin(loginId string, onlyLdap bool) (*model.User, *model.AppError) { - ldapAvailable := *utils.Cfg.LdapSettings.Enable && einterfaces.GetLdapInterface() != nil + ldapAvailable := *utils.Cfg.LdapSettings.Enable && einterfaces.GetLdapInterface() != nil && utils.IsLicensed && *utils.License.Features.LDAP if result := <-Srv.Store.User().GetForLogin( loginId, diff --git a/api/webhook.go b/api/webhook.go index a4367026f..11456d69e 100644 --- a/api/webhook.go +++ b/api/webhook.go @@ -434,6 +434,8 @@ func incomingWebhook(c *Context, w http.ResponseWriter, r *http.Request) { IsOAuth: false, } + c.TeamId = hook.TeamId + if !c.HasPermissionsToChannel(pchan, "createIncomingHook") && channel.Type != model.CHANNEL_OPEN { c.Err = model.NewLocAppError("incomingWebhook", "web.incoming_webhook.permissions.app_error", nil, "") return |