diff options
Diffstat (limited to 'model/user.go')
-rw-r--r-- | model/user.go | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/model/user.go b/model/user.go index 9cec37ac6..1a169f763 100644 --- a/model/user.go +++ b/model/user.go @@ -317,6 +317,16 @@ func IsInRole(userRoles string, inRole string) bool { return false } +func (u *User) PreExport() { + u.Password = "" + u.AuthData = "" + u.LastActivityAt = 0 + u.LastPingAt = 0 + u.LastPasswordUpdate = 0 + u.LastPictureUpdate = 0 + u.FailedAttempts = 0 +} + // UserFromJson will decode the input and return a User func UserFromJson(data io.Reader) *User { decoder := json.NewDecoder(data) @@ -370,11 +380,6 @@ func ComparePassword(hash string, password string) bool { return err == nil } -func IsUsernameValid(username string) bool { - - return true -} - var validUsernameChars = regexp.MustCompile(`^[a-z0-9\.\-_]+$`) var restrictedUsernames = []string{ |