summaryrefslogtreecommitdiffstats
path: root/model/utils.go
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2016-10-21 17:19:28 -0700
committerGitHub <noreply@github.com>2016-10-21 17:19:28 -0700
commit486d12e1c3a5d6658ca0ebd8fd28bec9f6753ce9 (patch)
tree1833ccb7c0ecfccf1400fa5c8153902d8c058fe0 /model/utils.go
parent38855327502420f06d1235d9ac34a66d0bcbca34 (diff)
downloadchat-486d12e1c3a5d6658ca0ebd8fd28bec9f6753ce9.tar.gz
chat-486d12e1c3a5d6658ca0ebd8fd28bec9f6753ce9.tar.bz2
chat-486d12e1c3a5d6658ca0ebd8fd28bec9f6753ce9.zip
PLT-4165 removing team name reserved words (#4289)
Diffstat (limited to 'model/utils.go')
-rw-r--r--model/utils.go47
1 files changed, 2 insertions, 45 deletions
diff --git a/model/utils.go b/model/utils.go
index 4ebd23939..457b64c09 100644
--- a/model/utils.go
+++ b/model/utils.go
@@ -253,58 +253,15 @@ func IsValidEmail(email string) bool {
}
var reservedName = []string{
- "www",
- "web",
+ "signup",
+ "login",
"admin",
- "support",
- "notify",
- "test",
- "demo",
- "mail",
- "team",
"channel",
- "internal",
- "localhost",
- "dockerhost",
- "stag",
"post",
- "cluster",
"api",
"oauth",
}
-var wwwStart = regexp.MustCompile(`^www`)
-var betaStart = regexp.MustCompile(`^beta`)
-var ciStart = regexp.MustCompile(`^ci`)
-
-func GetSubDomain(s string) (string, string) {
- s = strings.Replace(s, "http://", "", 1)
- s = strings.Replace(s, "https://", "", 1)
-
- match := wwwStart.MatchString(s)
- if match {
- return "", ""
- }
-
- match = betaStart.MatchString(s)
- if match {
- return "", ""
- }
-
- match = ciStart.MatchString(s)
- if match {
- return "", ""
- }
-
- parts := strings.Split(s, ".")
-
- if len(parts) != 3 {
- return "", ""
- }
-
- return parts[0], parts[1]
-}
-
func IsValidChannelIdentifier(s string) bool {
if !IsValidAlphaNum(s, true) {