mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Allow deactivation of SSO users api3 (#8008)
This commit is contained in:
10
api/user.go
10
api/user.go
@@ -727,7 +727,15 @@ func updateActive(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
if ruser, err := c.App.UpdateNonSSOUserActive(userId, active); err != nil {
|
||||
var ruser *model.User
|
||||
var err *model.AppError
|
||||
|
||||
if ruser, err = c.App.GetUser(userId); err != nil {
|
||||
c.Err = err
|
||||
return
|
||||
}
|
||||
|
||||
if _, err := c.App.UpdateActive(ruser, active); err != nil {
|
||||
c.Err = err
|
||||
} else {
|
||||
c.LogAuditWithUserId(ruser.Id, fmt.Sprintf("active=%v", active))
|
||||
|
||||
Reference in New Issue
Block a user