summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2015-09-17 09:21:56 -0700
committer=Corey Hulen <corey@hulen.com>2015-09-17 09:21:56 -0700
commit9b5198c69c01ff11b0977282b61cf2222ef2f2b1 (patch)
treea5179226ff013f082a6629dbf888454c53611383 /api
parent51c3445e694e68fdecd809f17fbaa64751e5931c (diff)
parent3edd8dbdf65e0b7be422a46328cb85482aa78f69 (diff)
downloadchat-9b5198c69c01ff11b0977282b61cf2222ef2f2b1.tar.gz
chat-9b5198c69c01ff11b0977282b61cf2222ef2f2b1.tar.bz2
chat-9b5198c69c01ff11b0977282b61cf2222ef2f2b1.zip
Merge branch 'master' into PLT-92
Diffstat (limited to 'api')
-rw-r--r--api/auto_constants.go4
-rw-r--r--api/auto_teams.go2
-rw-r--r--api/context.go8
-rw-r--r--api/file.go2
-rw-r--r--api/post.go2
-rw-r--r--api/team.go4
-rw-r--r--api/user.go2
7 files changed, 14 insertions, 10 deletions
diff --git a/api/auto_constants.go b/api/auto_constants.go
index f80f15f2d..73ecb47f8 100644
--- a/api/auto_constants.go
+++ b/api/auto_constants.go
@@ -12,8 +12,8 @@ const (
USER_PASSWORD = "passwd"
CHANNEL_TYPE = model.CHANNEL_OPEN
FUZZ_USER_EMAIL_PREFIX_LEN = 10
- BTEST_TEAM_DISPLAY_NAME = "TestTeam"
- BTEST_TEAM_NAME = "z-z-testdomaina"
+ BTEST_TEAM_DISPLAY_NAME = "TestTeam"
+ BTEST_TEAM_NAME = "z-z-testdomaina"
BTEST_TEAM_EMAIL = "test@nowhere.com"
BTEST_TEAM_TYPE = model.TEAM_OPEN
BTEST_USER_NAME = "Mr. Testing Tester"
diff --git a/api/auto_teams.go b/api/auto_teams.go
index e5c772b4c..dd82abe8d 100644
--- a/api/auto_teams.go
+++ b/api/auto_teams.go
@@ -52,7 +52,7 @@ func (cfg *AutoTeamCreator) createRandomTeam() (*model.Team, bool) {
}
team := &model.Team{
DisplayName: teamDisplayName,
- Name: teamName,
+ Name: teamName,
Email: teamEmail,
Type: model.TEAM_OPEN,
}
diff --git a/api/context.go b/api/context.go
index b896ca7b1..f7dbeedee 100644
--- a/api/context.go
+++ b/api/context.go
@@ -439,10 +439,10 @@ func IsBetaDomain(r *http.Request) bool {
}
var privateIpAddress = []*net.IPNet{
- &net.IPNet{IP: net.IPv4(10, 0, 0, 1), Mask: net.IPv4Mask(255, 0, 0, 0)},
- &net.IPNet{IP: net.IPv4(176, 16, 0, 1), Mask: net.IPv4Mask(255, 255, 0, 0)},
- &net.IPNet{IP: net.IPv4(192, 168, 0, 1), Mask: net.IPv4Mask(255, 255, 255, 0)},
- &net.IPNet{IP: net.IPv4(127, 0, 0, 1), Mask: net.IPv4Mask(255, 255, 255, 252)},
+ {IP: net.IPv4(10, 0, 0, 1), Mask: net.IPv4Mask(255, 0, 0, 0)},
+ {IP: net.IPv4(176, 16, 0, 1), Mask: net.IPv4Mask(255, 255, 0, 0)},
+ {IP: net.IPv4(192, 168, 0, 1), Mask: net.IPv4Mask(255, 255, 255, 0)},
+ {IP: net.IPv4(127, 0, 0, 1), Mask: net.IPv4Mask(255, 255, 255, 252)},
}
func IsPrivateIpAddress(ipAddress string) bool {
diff --git a/api/file.go b/api/file.go
index 692558acf..c24775ee2 100644
--- a/api/file.go
+++ b/api/file.go
@@ -86,7 +86,7 @@ func uploadFile(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
- for i, _ := range files {
+ for i := range files {
file, err := files[i].Open()
defer file.Close()
if err != nil {
diff --git a/api/post.go b/api/post.go
index 005f3f884..21bc35b97 100644
--- a/api/post.go
+++ b/api/post.go
@@ -353,7 +353,7 @@ func fireAndForgetNotifications(post *model.Post, teamId, siteURL string) {
}
}
- for id, _ := range toEmailMap {
+ for id := range toEmailMap {
fireAndForgetMentionUpdate(post.ChannelId, id)
}
}
diff --git a/api/team.go b/api/team.go
index 44f86b160..92fcbff93 100644
--- a/api/team.go
+++ b/api/team.go
@@ -100,6 +100,10 @@ func createTeamFromSSO(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
+ if !isTreamCreationAllowed(c, team.Email) {
+ return
+ }
+
team.PreSave()
team.Name = model.CleanTeamName(team.Name)
diff --git a/api/user.go b/api/user.go
index b42d156ae..0a54b6a5d 100644
--- a/api/user.go
+++ b/api/user.go
@@ -5,10 +5,10 @@ package api
import (
"bytes"
- "code.google.com/p/freetype-go/freetype"
l4g "code.google.com/p/log4go"
b64 "encoding/base64"
"fmt"
+ "github.com/golang/freetype"
"github.com/gorilla/mux"
"github.com/mattermost/platform/model"
"github.com/mattermost/platform/store"