summaryrefslogtreecommitdiffstats
path: root/model
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2015-09-10 15:15:04 -0700
committer=Corey Hulen <corey@hulen.com>2015-09-10 15:15:04 -0700
commit83b04181da84d0456dfa02b8d52953eb3fd3d7d1 (patch)
tree49510d8a6d4be6aeed9a86816cffcbc82d66b09b /model
parent1108ac53063bedcfe00647fa0577e91cf60555de (diff)
parent927b474005b9e6c03f7385f4d1a06626dd0450e3 (diff)
downloadchat-83b04181da84d0456dfa02b8d52953eb3fd3d7d1.tar.gz
chat-83b04181da84d0456dfa02b8d52953eb3fd3d7d1.tar.bz2
chat-83b04181da84d0456dfa02b8d52953eb3fd3d7d1.zip
merging
Diffstat (limited to 'model')
-rw-r--r--model/channel.go3
-rw-r--r--model/post.go3
-rw-r--r--model/team.go3
-rw-r--r--model/user.go15
4 files changed, 19 insertions, 5 deletions
diff --git a/model/channel.go b/model/channel.go
index b46f79f75..7d8edeee7 100644
--- a/model/channel.go
+++ b/model/channel.go
@@ -117,3 +117,6 @@ func (o *Channel) PreUpdate() {
func (o *Channel) ExtraUpdated() {
o.ExtraUpdateAt = GetMillis()
}
+
+func (o *Channel) PreExport() {
+}
diff --git a/model/post.go b/model/post.go
index 0c035d4e7..e78469940 100644
--- a/model/post.go
+++ b/model/post.go
@@ -147,3 +147,6 @@ func (o *Post) AddProp(key string, value string) {
o.Props[key] = value
}
+
+func (o *Post) PreExport() {
+}
diff --git a/model/team.go b/model/team.go
index 95e2757c8..6006f738c 100644
--- a/model/team.go
+++ b/model/team.go
@@ -197,3 +197,6 @@ func CleanTeamName(s string) string {
return s
}
+
+func (o *Team) PreExport() {
+}
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{