diff options
author | Wim <wim@42.be> | 2016-04-16 20:39:43 +0200 |
---|---|---|
committer | Wim <wim@42.be> | 2016-04-16 20:39:43 +0200 |
commit | 51265d546409de12483531773fc1fbc73453ae6e (patch) | |
tree | 924b5be51b320a6fe05784f2495a2bfcfc7a3242 /vendor/github.com/mattermost/platform/model/user.go | |
parent | de4c7804101a47a01d0c9b88ea34d2b153e2b6b9 (diff) | |
download | matterbridge-msglm-51265d546409de12483531773fc1fbc73453ae6e.tar.gz matterbridge-msglm-51265d546409de12483531773fc1fbc73453ae6e.tar.bz2 matterbridge-msglm-51265d546409de12483531773fc1fbc73453ae6e.zip |
Sync with mattermost 2.2.0 release
Diffstat (limited to 'vendor/github.com/mattermost/platform/model/user.go')
-rw-r--r-- | vendor/github.com/mattermost/platform/model/user.go | 37 |
1 files changed, 12 insertions, 25 deletions
diff --git a/vendor/github.com/mattermost/platform/model/user.go b/vendor/github.com/mattermost/platform/model/user.go index 173fe2b4..675a1ded 100644 --- a/vendor/github.com/mattermost/platform/model/user.go +++ b/vendor/github.com/mattermost/platform/model/user.go @@ -15,19 +15,17 @@ import ( ) const ( - ROLE_TEAM_ADMIN = "admin" - ROLE_SYSTEM_ADMIN = "system_admin" - USER_AWAY_TIMEOUT = 5 * 60 * 1000 // 5 minutes - USER_OFFLINE_TIMEOUT = 1 * 60 * 1000 // 1 minute - USER_OFFLINE = "offline" - USER_AWAY = "away" - USER_ONLINE = "online" - USER_NOTIFY_ALL = "all" - USER_NOTIFY_MENTION = "mention" - USER_NOTIFY_NONE = "none" - DEFAULT_LOCALE = "en" - USER_AUTH_SERVICE_EMAIL = "email" - USER_AUTH_SERVICE_USERNAME = "username" + ROLE_TEAM_ADMIN = "admin" + ROLE_SYSTEM_ADMIN = "system_admin" + USER_AWAY_TIMEOUT = 5 * 60 * 1000 // 5 minutes + USER_OFFLINE_TIMEOUT = 1 * 60 * 1000 // 1 minute + USER_OFFLINE = "offline" + USER_AWAY = "away" + USER_ONLINE = "online" + USER_NOTIFY_ALL = "all" + USER_NOTIFY_MENTION = "mention" + USER_NOTIFY_NONE = "none" + DEFAULT_LOCALE = "en" ) type User struct { @@ -56,8 +54,6 @@ type User struct { LastPictureUpdate int64 `json:"last_picture_update,omitempty"` FailedAttempts int `json:"failed_attempts,omitempty"` Locale string `json:"locale"` - MfaActive bool `json:"mfa_active,omitempty"` - MfaSecret string `json:"mfa_secret,omitempty"` } // IsValid validates the user and returns an error if it isn't configured @@ -144,8 +140,6 @@ func (u *User) PreSave() { u.LastPasswordUpdate = u.CreateAt - u.MfaActive = false - if u.Locale == "" { u.Locale = DEFAULT_LOCALE } @@ -352,14 +346,7 @@ func IsInRole(userRoles string, inRole string) bool { } func (u *User) IsSSOUser() bool { - if len(u.AuthData) != 0 && len(u.AuthService) != 0 && u.AuthService != USER_AUTH_SERVICE_LDAP { - return true - } - return false -} - -func (u *User) IsLDAPUser() bool { - if u.AuthService == USER_AUTH_SERVICE_LDAP { + if len(u.AuthData) != 0 && len(u.AuthService) != 0 { return true } return false |