Changeset 625 in code for trunk/user.go
- Timestamp:
- Oct 12, 2021, 7:11:14 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/user.go
r612 r625 59 59 60 60 type eventStop struct{} 61 62 type eventUserUpdate struct { 63 password *string 64 admin *bool 65 done chan error 66 } 61 67 62 68 type deliveredClientMap map[string]string // client name -> msg ID … … 643 649 dc.SendMessage(msg) 644 650 }) 651 case eventUserUpdate: 652 // copy the user record because we'll mutate it 653 record := u.User 654 655 if e.password != nil { 656 record.Password = *e.password 657 } 658 if e.admin != nil { 659 record.Admin = *e.admin 660 } 661 662 e.done <- u.updateUser(&record) 663 664 // If the password was updated, kill all downstream connections to 665 // force them to re-authenticate with the new credentials. 666 if e.password != nil { 667 u.forEachDownstream(func(dc *downstreamConn) { 668 dc.Close() 669 }) 670 } 645 671 case eventStop: 646 672 u.forEachDownstream(func(dc *downstreamConn) {
Note:
See TracChangeset
for help on using the changeset viewer.