summaryrefslogtreecommitdiffstats
path: root/model/user.go
diff options
context:
space:
mode:
Diffstat (limited to 'model/user.go')
-rw-r--r--model/user.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/model/user.go b/model/user.go
index c4dbfb6d0..3e99c6fa4 100644
--- a/model/user.go
+++ b/model/user.go
@@ -497,6 +497,14 @@ func (u *User) IsSAMLUser() bool {
return u.AuthService == USER_AUTH_SERVICE_SAML
}
+func (u *User) GetPreferredTimezone() string {
+ if u.Timezone["useAutomaticTimezone"] == "true" {
+ return u.Timezone["automaticTimezone"]
+ }
+
+ return u.Timezone["manualTimezone"]
+}
+
// UserFromJson will decode the input and return a User
func UserFromJson(data io.Reader) *User {
var user *User
@@ -565,6 +573,7 @@ var restrictedUsernames = []string{
"all",
"channel",
"matterbot",
+ "system",
}
func IsValidUsername(s string) bool {