summaryrefslogtreecommitdiffstats
path: root/mattermost.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2015-12-08 13:38:43 -0500
committerChristopher Speller <crspeller@gmail.com>2015-12-16 17:30:15 -0500
commit58358ddd7cd0152bf16a7326e1d595524fb51246 (patch)
tree350cd462f9b530529e0f098fa1d458c3a36abd4a /mattermost.go
parent4f881046bf2a4c74fb44d71e2e78826c70719a8c (diff)
downloadchat-58358ddd7cd0152bf16a7326e1d595524fb51246.tar.gz
chat-58358ddd7cd0152bf16a7326e1d595524fb51246.tar.bz2
chat-58358ddd7cd0152bf16a7326e1d595524fb51246.zip
Some refactoring
Diffstat (limited to 'mattermost.go')
-rw-r--r--mattermost.go23
1 files changed, 15 insertions, 8 deletions
diff --git a/mattermost.go b/mattermost.go
index da50a26c3..3d8ab736f 100644
--- a/mattermost.go
+++ b/mattermost.go
@@ -23,8 +23,16 @@ import (
"github.com/mattermost/platform/model"
"github.com/mattermost/platform/utils"
"github.com/mattermost/platform/web"
+
+ // Plugins
+ _ "github.com/mattermost/platform/model/gitlab"
+
+ // Enterprise Deps
+ _ "github.com/go-ldap/ldap"
)
+//ENTERPRISE_IMPORTS
+
var flagCmdCreateTeam bool
var flagCmdCreateUser bool
var flagCmdAssignRole bool
@@ -51,6 +59,7 @@ func main() {
pwd, _ := os.Getwd()
l4g.Info("Current version is %v (%v/%v/%v)", model.CurrentVersion, model.BuildNumber, model.BuildDate, model.BuildHash)
+ l4g.Info("Enterprise Enabled: %t", model.BuildEnterpriseReady)
l4g.Info("Current working directory is %v", pwd)
l4g.Info("Loaded config file from %v", utils.FindConfigFile(flagConfigFile))
@@ -112,6 +121,7 @@ func runSecurityAndDiagnosticsJobAndForget() {
v.Set(utils.PROP_DIAGNOSTIC_ID, utils.CfgDiagnosticId)
v.Set(utils.PROP_DIAGNOSTIC_BUILD, model.CurrentVersion+"."+model.BuildNumber)
+ v.Set(utils.PROP_DIAGNOSTIC_ENTERPRISE_READY, model.BuildEnterpriseReady)
v.Set(utils.PROP_DIAGNOSTIC_DATABASE, utils.Cfg.SqlSettings.DriverName)
v.Set(utils.PROP_DIAGNOSTIC_OS, runtime.GOOS)
v.Set(utils.PROP_DIAGNOSTIC_CATEGORY, utils.VAL_DIAGNOSTIC_CATEGORY_DEFAULT)
@@ -283,10 +293,6 @@ func cmdCreateUser() {
os.Exit(1)
}
- c := &api.Context{}
- c.RequestId = model.NewId()
- c.IpAddress = "cmd_line"
-
var team *model.Team
user := &model.User{}
user.Email = flagEmail
@@ -302,10 +308,10 @@ func cmdCreateUser() {
user.TeamId = team.Id
}
- api.CreateUser(c, team, user)
- if c.Err != nil {
- if c.Err.Message != "An account with that email already exists." {
- l4g.Error("%v", c.Err)
+ _, err := api.CreateUser(team, user)
+ if err != nil {
+ if err.Message != "An account with that email already exists." {
+ l4g.Error("%v", err)
flushLogAndExit(1)
}
}
@@ -320,6 +326,7 @@ func cmdVersion() {
fmt.Fprintln(os.Stderr, "Build Number: "+model.BuildNumber)
fmt.Fprintln(os.Stderr, "Build Date: "+model.BuildDate)
fmt.Fprintln(os.Stderr, "Build Hash: "+model.BuildHash)
+ fmt.Fprintln(os.Stderr, "Build Enterprise Ready: "+model.BuildEnterpriseReady)
os.Exit(0)
}