Allow deactivation of SSO users (#7952)

Этот коммит содержится в:
Joram Wilander
2017-12-08 14:14:55 -05:00
коммит произвёл Christopher Speller
родитель ae931ae6b6
Коммит 617a98d6d8
3 изменённых файлов: 22 добавлений и 5 удалений

Просмотреть файл

@@ -683,10 +683,18 @@ func updateUserActive(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
if ruser, err := c.App.UpdateNonSSOUserActive(c.Params.UserId, active); err != nil {
var user *model.User
var err *model.AppError
if user, err = c.App.GetUser(c.Params.UserId); err != nil {
c.Err = err
return
}
if _, err := c.App.UpdateActive(user, active); err != nil {
c.Err = err
} else {
c.LogAuditWithUserId(ruser.Id, fmt.Sprintf("active=%v", active))
c.LogAuditWithUserId(user.Id, fmt.Sprintf("active=%v", active))
ReturnStatusOK(w)
}
}