summaryrefslogtreecommitdiffstats
path: root/cmd/platform/ldap.go
diff options
context:
space:
mode:
authorJesús Espino <jespinog@gmail.com>2018-03-07 20:04:18 +0000
committerGitHub <noreply@github.com>2018-03-07 20:04:18 +0000
commitb2dd00dd5b83fc7e8b311a55f5a2536e4f3d45a5 (patch)
tree00d2bbb524e27727dc111994082f5293e6d12b11 /cmd/platform/ldap.go
parent03b6d1f652407fa9c3ec7e740e120a1c3e920de0 (diff)
downloadchat-b2dd00dd5b83fc7e8b311a55f5a2536e4f3d45a5.tar.gz
chat-b2dd00dd5b83fc7e8b311a55f5a2536e4f3d45a5.tar.bz2
chat-b2dd00dd5b83fc7e8b311a55f5a2536e4f3d45a5.zip
Adding enterprise commands support (#8327)
Diffstat (limited to 'cmd/platform/ldap.go')
-rw-r--r--cmd/platform/ldap.go45
1 files changed, 0 insertions, 45 deletions
diff --git a/cmd/platform/ldap.go b/cmd/platform/ldap.go
deleted file mode 100644
index 1bbcaa2f5..000000000
--- a/cmd/platform/ldap.go
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
-// See License.txt for license information.
-package main
-
-import (
- "github.com/mattermost/mattermost-server/model"
- "github.com/spf13/cobra"
-)
-
-var ldapCmd = &cobra.Command{
- Use: "ldap",
- Short: "LDAP related utilities",
-}
-
-var ldapSyncCmd = &cobra.Command{
- Use: "sync",
- Short: "Synchronize now",
- Long: "Synchronize all LDAP users now.",
- Example: " ldap sync",
- RunE: ldapSyncCmdF,
-}
-
-func init() {
- ldapCmd.AddCommand(
- ldapSyncCmd,
- )
-}
-
-func ldapSyncCmdF(cmd *cobra.Command, args []string) error {
- a, err := initDBCommandContextCobra(cmd)
- if err != nil {
- return err
- }
-
- if ldapI := a.Ldap; ldapI != nil {
- job, err := ldapI.StartSynchronizeJob(true)
- if err != nil || job.Status == model.JOB_STATUS_ERROR || job.Status == model.JOB_STATUS_CANCELED {
- CommandPrintErrorln("ERROR: AD/LDAP Synchronization please check the server logs")
- } else {
- CommandPrettyPrintln("SUCCESS: AD/LDAP Synchronization Complete")
- }
- }
-
- return nil
-}