MCPcopy Create free account
hub / github.com/OpenListTeam/OpenList / UpdateUser

Function UpdateUser

internal/op/user.go:88–102  ·  view source on GitHub ↗
(u *model.User)

Source from the content-addressed store, hash-verified

86}
87
88func UpdateUser(u *model.User) error {
89 old, err := db.GetUserById(u.ID)
90 if err != nil {
91 return err
92 }
93 if u.IsAdmin() {
94 adminUser = nil
95 }
96 if u.IsGuest() {
97 guestUser = nil
98 }
99 Cache.DeleteUser(old.Username)
100 u.BasePath = utils.FixAndCleanPath(u.BasePath)
101 return db.UpdateUser(u)
102}
103
104func Cancel2FAByUser(u *model.User) error {
105 u.OtpSecret = ""

Callers 6

GrantAdminPermissionsFunction · 0.92
setAdminPasswordFunction · 0.92
UpdateCurrentFunction · 0.92
Verify2FAFunction · 0.92
UpdateUserFunction · 0.92
Cancel2FAByUserFunction · 0.70

Calls 6

GetUserByIdFunction · 0.92
FixAndCleanPathFunction · 0.92
UpdateUserFunction · 0.92
IsAdminMethod · 0.80
IsGuestMethod · 0.80
DeleteUserMethod · 0.80

Tested by

no test coverage detected