X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;ds=inline;f=lib%2Fmix%2Ftasks%2Fpleroma%2Fuser.ex;h=d8400662d3fafbcb4bf5d957a80b4969673a6e2f;hb=0590d16089e4ffd52ac3e446f44aefd3f90dc38a;hp=85c9e4954afdc344d695c7f132882cf292cb1b30;hpb=835ac2157c53e8c85bd3759efe061dbfbdfc367e;p=akkoma
diff --git a/lib/mix/tasks/pleroma/user.ex b/lib/mix/tasks/pleroma/user.ex
index 85c9e4954..d8400662d 100644
--- a/lib/mix/tasks/pleroma/user.ex
+++ b/lib/mix/tasks/pleroma/user.ex
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2019 Pleroma Authors
+# Copyright © 2017-2020 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Mix.Tasks.Pleroma.User do
@@ -100,8 +100,7 @@ defmodule Mix.Tasks.Pleroma.User do
User.perform(:delete, user)
shell_info("User #{nickname} deleted.")
else
- _ ->
- shell_error("No local user #{nickname}")
+ _ -> shell_error("No local user #{nickname}")
end
end
@@ -334,6 +333,35 @@ defmodule Mix.Tasks.Pleroma.User do
end
end
+ def run(["change_email", nickname, email]) do
+ start_pleroma()
+ with %User{} = user <- User.get_cached_by_nickname(nickname) do
+ user
+ |> User.update_changeset(%{"email" => email})
+ |> User.update_and_set_cache()
+ shell_info("#{nickname}'s email updated")
+ end
+ end
+
+ def run(["show", nickname]) do
+ start_pleroma()
+ nickname
+ |> User.get_cached_by_nickname()
+ |> IO.inspect
+ end
+
+ def run(["send_confirmation", nickname]) do
+ start_pleroma()
+ with %User{} = user <- User.get_cached_by_nickname(nickname) do
+ user
+ |> Pleroma.Emails.UserEmail.account_confirmation_email()
+ |> IO.inspect
+ |> Pleroma.Emails.Mailer.deliver!()
+ shell_info("#{nickname}'s email sent")
+ end
+ end
+
+
def run(["toggle_confirmed", nickname]) do
start_pleroma()