summaryrefslogtreecommitdiffstats
path: root/cmd/commands/user.go
diff options
context:
space:
mode:
authorDerrick Anderson <derrick@andersonwebstudio.com>2018-04-17 09:21:33 -0400
committerDerrick Anderson <derrick@andersonwebstudio.com>2018-04-17 09:21:33 -0400
commit885b8e51f3c0b0a4d98814b43917670c2193b3a4 (patch)
treee68563c27267d1d493e016f6846531bc033f698e /cmd/commands/user.go
parent997df03ac1455785b7a39e40edcd67b3b3e86f9e (diff)
parent3176e13b1f9b14192bef2337ff3fb9346f26ef66 (diff)
downloadchat-885b8e51f3c0b0a4d98814b43917670c2193b3a4.tar.gz
chat-885b8e51f3c0b0a4d98814b43917670c2193b3a4.tar.bz2
chat-885b8e51f3c0b0a4d98814b43917670c2193b3a4.zip
Merge remote-tracking branch 'origin/release-4.9' into merge49final
Diffstat (limited to 'cmd/commands/user.go')
-rw-r--r--cmd/commands/user.go40
1 files changed, 0 insertions, 40 deletions
diff --git a/cmd/commands/user.go b/cmd/commands/user.go
index 9f5e5ae0d..e3bc8208a 100644
--- a/cmd/commands/user.go
+++ b/cmd/commands/user.go
@@ -66,15 +66,6 @@ var ResetUserPasswordCmd = &cobra.Command{
RunE: resetUserPasswordCmdF,
}
-var updateUserEmailCmd = &cobra.Command{
- Use: "email [user] [new email]",
- Short: "Change email of the user",
- Long: "Change email of the user.",
- Example: ` user email test user@example.com
- user activate username`,
- RunE: updateUserEmailCmdF,
-}
-
var ResetUserMfaCmd = &cobra.Command{
Use: "resetmfa [users]",
Short: "Turn off MFA",
@@ -238,7 +229,6 @@ Global Flags:
UserCreateCmd,
UserInviteCmd,
ResetUserPasswordCmd,
- updateUserEmailCmd,
ResetUserMfaCmd,
DeleteUserCmd,
DeleteAllUsersCmd,
@@ -409,36 +399,6 @@ func resetUserPasswordCmdF(command *cobra.Command, args []string) error {
return nil
}
-func updateUserEmailCmdF(command *cobra.Command, args []string) error {
- a, err := cmd.InitDBCommandContextCobra(command)
- if err != nil {
- return err
- }
-
- newEmail := args[1]
-
- if !model.IsValidEmail(newEmail) {
- return errors.New("Invalid email: '" + newEmail + "'")
- }
-
- if len(args) != 2 {
- return errors.New("Expected two arguments. See help text for details.")
- }
-
- user := getUserFromUserArg(a, args[0])
- if user == nil {
- return errors.New("Unable to find user '" + args[0] + "'")
- }
-
- user.Email = newEmail
- _, errUpdate := a.UpdateUser(user, true)
- if err != nil {
- return errUpdate
- }
-
- return nil
-}
-
func resetUserMfaCmdF(command *cobra.Command, args []string) error {
a, err := cmd.InitDBCommandContextCobra(command)
if err != nil {