useropr.go 749 B

12345678910111213141516171819202122232425262728293031
  1. package user
  2. import "log"
  3. //Get the user's handler
  4. func (u *User) Parent() *UserHandler {
  5. return u.parent
  6. }
  7. //Remove the current user
  8. func (u *User) RemoveUser() {
  9. //Remove the user storage quota settings
  10. log.Println("Removing User Quota: ", u.Username)
  11. u.StorageQuota.RemoveUserQuota()
  12. //Remove the user authentication register
  13. u.parent.authAgent.UnregisterUser(u.Username)
  14. }
  15. //Get the current user icon
  16. func (u *User) GetUserIcon() string {
  17. var userIconpath []byte
  18. u.parent.database.Read("auth", "profilepic/"+u.Username, &userIconpath)
  19. return string(userIconpath)
  20. }
  21. //Set the current user icon
  22. func (u *User) SetUserIcon(base64data string) {
  23. u.parent.database.Write("auth", "profilepic/"+u.Username, []byte(base64data))
  24. return
  25. }