Files
mattermost/cmd/platform/ldap.go
Harrison Healey fb6f2a123c PLT-5860 Updated copyright date (#6058)
* PLT-5860 Updated copyright date in about modal

* PLT-5860 Updated copyright notice in JSX files

* PLT-5860 Updated copyright notice in go files

* Fixed misc copyright dates

* Fixed component snapshots
2017-04-12 08:27:57 -04:00

40 lines
859 B
Go

// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
package main
import (
"github.com/mattermost/platform/einterfaces"
"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 {
if ldapI := einterfaces.GetLdapInterface(); ldapI != nil {
if err := ldapI.Syncronize(); err != nil {
CommandPrintErrorln("ERROR: AD/LDAP Synchronization Failed")
} else {
CommandPrettyPrintln("SUCCESS: AD/LDAP Synchronization Complete")
}
}
return nil
}