# Functions
AddContact add a contact to user.
AddDefaultGroup add default group to user.
AddFavoriteTag Add a favorite tag to user.
AddFavoriteTopic add a favorite topic to user.
Archive changes username of one user and set attribute email, username to random string.
AskReset generate a new saltTokenVerify / hashedTokenVerify return tokenVerify (to be sent to user by mail).
CheckDefaultGroup check default group and creates it if fixDefaultGroup is true.
CheckTopics check default topics for user and creates them if fixTopics is true.
ConvertToAdmin set attribute IsAdmin to true.
ConvertToSystem set attribute IsSysetm to true and suffix mail with a random string.
CountUsers returns the total number of users in db.
CreatePrivateTopic creates a Private Topic.
DisableNotificationsAllTopics add all topics to user list offNotificationsTopics, except /Private/*.
DisableNotificationsTopic add topic to user list offNotificationsTopics.
EnableNotificationsAllTopics removes all topics from user list offNotificationsTopics.
EnableNotificationsTopic remove topic from user list offNotificationsTopics.
FindByEmail retrieve information from user with email.
FindByFullname retrieve information from user with fullname.
FindByUsername retrieve information from user with username.
FindByUsernameAndEmail retrieve information from user with username.
FindByUsernameAndPassword search username, use user's salt to generates hashedPassword and check username + hashedPassword in DB.
GenerateSalt generates salt, 32 length, with rand.Reader.
HashPassword hashes password, with given salt It uses sha512.Sum.
Insert a new user, return tokenVerify to user, in order to validate account after check email.
ListUsers returns users list selected by criteria.
RemoveContact removes a contact from user.
RemoveFavoriteTag remove a favorite tag from user.
RemoveFavoriteTopic removes a favorite topic from user.
Rename changes username of one user.
ResetSystemUserPassword reset a password for a system user returns newPassword.
SendAskResetEmail send a mail to user, ask him to confirm reset password.
SendVerifyEmail send a mail to new user, ask him to valide his new account.
TrustUsername create user is not already registered.
Update changes fullname and email of user.
UpdateSystemUser updates flags CanListUsersAsAdmin.
Verify checks username and tokenVerify, if ok, return true, password if it's a new user Password is not stored in Database (only hashedPassword) return isNewUser, password, err.