mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-12-25 04:53:06 +00:00
Merge branch 'refactor/confirmation_pending_user_field' into 'develop'
Change user.confirmation_pending field to user.is_confirmed See merge request pleroma/pleroma!3081
This commit is contained in:
commit
0ad6ea2057
|
@ -8,10 +8,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|||
|
||||
### Changed
|
||||
|
||||
- **Breaking:** Changed `mix pleroma.user toggle_confirmed` to `mix pleroma.user confirm`
|
||||
- **Breaking**: AdminAPI changed User field `confirmation_pending` to `is_confirmed`
|
||||
- Polls now always return a `voters_count`, even if they are single-choice.
|
||||
- Admin Emails: The ap id is used as the user link in emails now.
|
||||
- Improved registration workflow for email confirmation and account approval modes.
|
||||
- **Breaking:** Changed `mix pleroma.user toggle_confirmed` to `mix pleroma.user confirm`
|
||||
- Search: When using Postgres 11+, Pleroma will use the `websearch_to_tsvector` function to parse search queries.
|
||||
- Emoji: Support the full Unicode 13.1 set of Emoji for reactions, plus regional indicators.
|
||||
- Admin API: Reports now ordered by newest
|
||||
|
|
|
@ -34,7 +34,7 @@ def run(["resend_confirmation_emails"]) do
|
|||
Pleroma.User.Query.build(%{
|
||||
local: true,
|
||||
deactivated: false,
|
||||
confirmation_pending: true,
|
||||
is_confirmed: false,
|
||||
invisible: false
|
||||
})
|
||||
|> Pleroma.Repo.chunk_stream(500)
|
||||
|
|
|
@ -74,7 +74,7 @@ def run(["new", nickname, email | rest]) do
|
|||
bio: bio
|
||||
}
|
||||
|
||||
changeset = User.register_changeset(%User{}, params, need_confirmation: false)
|
||||
changeset = User.register_changeset(%User{}, params, is_confirmed: true)
|
||||
{:ok, _user} = User.register(changeset)
|
||||
|
||||
shell_info("User #{nickname} created")
|
||||
|
@ -213,7 +213,7 @@ def run(["set", nickname | rest]) do
|
|||
user =
|
||||
case Keyword.get(options, :confirmed) do
|
||||
nil -> user
|
||||
value -> set_confirmed(user, value)
|
||||
value -> set_confirmation(user, value)
|
||||
end
|
||||
|
||||
user =
|
||||
|
@ -351,7 +351,7 @@ def run(["confirm", nickname]) do
|
|||
with %User{} = user <- User.get_cached_by_nickname(nickname) do
|
||||
{:ok, user} = User.confirm(user)
|
||||
|
||||
message = if user.confirmation_pending, do: "needs", else: "doesn't need"
|
||||
message = if !user.is_confirmed, do: "needs", else: "doesn't need"
|
||||
|
||||
shell_info("#{nickname} #{message} confirmation.")
|
||||
else
|
||||
|
@ -373,7 +373,7 @@ def run(["confirm_all"]) do
|
|||
|> Pleroma.Repo.chunk_stream(500, :batches)
|
||||
|> Stream.each(fn users ->
|
||||
users
|
||||
|> Enum.each(fn user -> User.need_confirmation(user, false) end)
|
||||
|> Enum.each(fn user -> User.set_confirmation(user, true) end)
|
||||
end)
|
||||
|> Stream.run()
|
||||
end
|
||||
|
@ -391,7 +391,7 @@ def run(["unconfirm_all"]) do
|
|||
|> Pleroma.Repo.chunk_stream(500, :batches)
|
||||
|> Stream.each(fn users ->
|
||||
users
|
||||
|> Enum.each(fn user -> User.need_confirmation(user, true) end)
|
||||
|> Enum.each(fn user -> User.set_confirmation(user, false) end)
|
||||
end)
|
||||
|> Stream.run()
|
||||
end
|
||||
|
@ -454,10 +454,10 @@ defp set_locked(user, value) do
|
|||
user
|
||||
end
|
||||
|
||||
defp set_confirmed(user, value) do
|
||||
{:ok, user} = User.need_confirmation(user, !value)
|
||||
defp set_confirmation(user, value) do
|
||||
{:ok, user} = User.set_confirmation(user, value)
|
||||
|
||||
shell_info("Confirmation pending status of #{user.nickname}: #{user.confirmation_pending}")
|
||||
shell_info("Confirmation status of #{user.nickname}: #{user.is_confirmed}")
|
||||
user
|
||||
end
|
||||
end
|
||||
|
|
|
@ -110,7 +110,7 @@ defmodule Pleroma.User do
|
|||
field(:follower_count, :integer, default: 0)
|
||||
field(:following_count, :integer, default: 0)
|
||||
field(:is_locked, :boolean, default: false)
|
||||
field(:confirmation_pending, :boolean, default: false)
|
||||
field(:is_confirmed, :boolean, default: true)
|
||||
field(:password_reset_pending, :boolean, default: false)
|
||||
field(:approval_pending, :boolean, default: false)
|
||||
field(:registration_reason, :string, default: nil)
|
||||
|
@ -290,7 +290,7 @@ def account_status(%User{deactivated: true}), do: :deactivated
|
|||
def account_status(%User{password_reset_pending: true}), do: :password_reset_pending
|
||||
def account_status(%User{local: true, approval_pending: true}), do: :approval_pending
|
||||
|
||||
def account_status(%User{local: true, confirmation_pending: true}) do
|
||||
def account_status(%User{local: true, is_confirmed: false}) do
|
||||
if Config.get([:instance, :account_activation_required]) do
|
||||
:confirmation_pending
|
||||
else
|
||||
|
@ -704,11 +704,11 @@ def register_changeset(struct, params \\ %{}, opts \\ []) do
|
|||
reason_limit = Config.get([:instance, :registration_reason_length], 500)
|
||||
params = Map.put_new(params, :accepts_chat_messages, true)
|
||||
|
||||
need_confirmation? =
|
||||
if is_nil(opts[:need_confirmation]) do
|
||||
Config.get([:instance, :account_activation_required])
|
||||
confirmed? =
|
||||
if is_nil(opts[:confirmed]) do
|
||||
!Config.get([:instance, :account_activation_required])
|
||||
else
|
||||
opts[:need_confirmation]
|
||||
opts[:confirmed]
|
||||
end
|
||||
|
||||
need_approval? =
|
||||
|
@ -719,7 +719,7 @@ def register_changeset(struct, params \\ %{}, opts \\ []) do
|
|||
end
|
||||
|
||||
struct
|
||||
|> confirmation_changeset(need_confirmation: need_confirmation?)
|
||||
|> confirmation_changeset(set_confirmation: confirmed?)
|
||||
|> approval_changeset(need_approval: need_approval?)
|
||||
|> cast(params, [
|
||||
:bio,
|
||||
|
@ -808,7 +808,7 @@ def register(%Ecto.Changeset{} = changeset) do
|
|||
end
|
||||
end
|
||||
|
||||
def post_register_action(%User{confirmation_pending: true} = user) do
|
||||
def post_register_action(%User{is_confirmed: false} = user) do
|
||||
with {:ok, _} <- try_send_confirmation_email(user) do
|
||||
{:ok, user}
|
||||
end
|
||||
|
@ -821,7 +821,7 @@ def post_register_action(%User{approval_pending: true} = user) do
|
|||
end
|
||||
end
|
||||
|
||||
def post_register_action(%User{approval_pending: false, confirmation_pending: false} = user) do
|
||||
def post_register_action(%User{approval_pending: false, is_confirmed: true} = user) do
|
||||
with {:ok, user} <- autofollow_users(user),
|
||||
{:ok, _} <- autofollowing_users(user),
|
||||
{:ok, user} <- set_cache(user),
|
||||
|
@ -882,7 +882,7 @@ def send_welcome_email(%User{email: email} = user) when is_binary(email) do
|
|||
def send_welcome_email(_), do: {:ok, :noop}
|
||||
|
||||
@spec try_send_confirmation_email(User.t()) :: {:ok, :enqueued | :noop}
|
||||
def try_send_confirmation_email(%User{confirmation_pending: true, email: email} = user)
|
||||
def try_send_confirmation_email(%User{is_confirmed: false, email: email} = user)
|
||||
when is_binary(email) do
|
||||
if Config.get([:instance, :account_activation_required]) do
|
||||
send_confirmation_email(user)
|
||||
|
@ -1642,8 +1642,8 @@ def confirm(users) when is_list(users) do
|
|||
end)
|
||||
end
|
||||
|
||||
def confirm(%User{confirmation_pending: true} = user) do
|
||||
with chg <- confirmation_changeset(user, need_confirmation: false),
|
||||
def confirm(%User{is_confirmed: false} = user) do
|
||||
with chg <- confirmation_changeset(user, set_confirmation: true),
|
||||
{:ok, user} <- update_and_set_cache(chg) do
|
||||
post_register_action(user)
|
||||
{:ok, user}
|
||||
|
@ -1682,7 +1682,7 @@ def purge_user_changeset(user) do
|
|||
follower_count: 0,
|
||||
following_count: 0,
|
||||
is_locked: false,
|
||||
confirmation_pending: false,
|
||||
is_confirmed: true,
|
||||
password_reset_pending: false,
|
||||
approval_pending: false,
|
||||
registration_reason: nil,
|
||||
|
@ -2138,10 +2138,10 @@ def touch_last_digest_emailed_at(user) do
|
|||
updated_user
|
||||
end
|
||||
|
||||
@spec need_confirmation(User.t(), boolean()) :: {:ok, User.t()} | {:error, Changeset.t()}
|
||||
def need_confirmation(%User{} = user, bool) do
|
||||
@spec set_confirmation(User.t(), boolean()) :: {:ok, User.t()} | {:error, Changeset.t()}
|
||||
def set_confirmation(%User{} = user, bool) do
|
||||
user
|
||||
|> confirmation_changeset(need_confirmation: bool)
|
||||
|> confirmation_changeset(set_confirmation: bool)
|
||||
|> update_and_set_cache()
|
||||
end
|
||||
|
||||
|
@ -2309,21 +2309,21 @@ def mastodon_settings_update(user, settings) do
|
|||
end
|
||||
|
||||
@spec confirmation_changeset(User.t(), keyword()) :: Changeset.t()
|
||||
def confirmation_changeset(user, need_confirmation: need_confirmation?) do
|
||||
def confirmation_changeset(user, set_confirmation: confirmed?) do
|
||||
params =
|
||||
if need_confirmation? do
|
||||
if confirmed? do
|
||||
%{
|
||||
confirmation_pending: true,
|
||||
confirmation_token: :crypto.strong_rand_bytes(32) |> Base.url_encode64()
|
||||
is_confirmed: true,
|
||||
confirmation_token: nil
|
||||
}
|
||||
else
|
||||
%{
|
||||
confirmation_pending: false,
|
||||
confirmation_token: nil
|
||||
is_confirmed: false,
|
||||
confirmation_token: :crypto.strong_rand_bytes(32) |> Base.url_encode64()
|
||||
}
|
||||
end
|
||||
|
||||
cast(user, params, [:confirmation_pending, :confirmation_token])
|
||||
cast(user, params, [:is_confirmed, :confirmation_token])
|
||||
end
|
||||
|
||||
@spec approval_changeset(User.t(), keyword()) :: Changeset.t()
|
||||
|
|
|
@ -155,7 +155,7 @@ defp compose_query({:deactivated, true}, query) do
|
|||
end
|
||||
|
||||
defp compose_query({:confirmation_pending, bool}, query) do
|
||||
where(query, [u], u.confirmation_pending == ^bool)
|
||||
where(query, [u], u.is_confirmed != ^bool)
|
||||
end
|
||||
|
||||
defp compose_query({:need_approval, _}, query) do
|
||||
|
@ -163,7 +163,7 @@ defp compose_query({:need_approval, _}, query) do
|
|||
end
|
||||
|
||||
defp compose_query({:unconfirmed, _}, query) do
|
||||
where(query, [u], u.confirmation_pending)
|
||||
where(query, [u], u.is_confirmed == false)
|
||||
end
|
||||
|
||||
defp compose_query({:followers, %User{id: id}}, query) do
|
||||
|
|
|
@ -77,7 +77,7 @@ def render("show.json", %{user: user}) do
|
|||
"local" => user.local,
|
||||
"roles" => User.roles(user),
|
||||
"tags" => user.tags || [],
|
||||
"confirmation_pending" => user.confirmation_pending,
|
||||
"is_confirmed" => user.is_confirmed,
|
||||
"approval_pending" => user.approval_pending,
|
||||
"url" => user.uri || user.ap_id,
|
||||
"registration_reason" => user.registration_reason,
|
||||
|
|
|
@ -191,7 +191,7 @@ defp account_admin do
|
|||
moderator: %Schema{type: :boolean}
|
||||
}
|
||||
},
|
||||
confirmation_pending: %Schema{type: :boolean}
|
||||
is_confirmed: %Schema{type: :boolean}
|
||||
})
|
||||
}
|
||||
end
|
||||
|
|
|
@ -142,7 +142,7 @@ def admin_account do
|
|||
}
|
||||
},
|
||||
tags: %Schema{type: :string},
|
||||
confirmation_pending: %Schema{type: :string}
|
||||
is_confirmed: %Schema{type: :string}
|
||||
}
|
||||
}
|
||||
end
|
||||
|
|
|
@ -236,7 +236,7 @@ def chats_response do
|
|||
"account" => %{
|
||||
"pleroma" => %{
|
||||
"is_admin" => false,
|
||||
"confirmation_pending" => false,
|
||||
"is_confirmed" => true,
|
||||
"hide_followers_count" => false,
|
||||
"is_moderator" => false,
|
||||
"hide_favorites" => true,
|
||||
|
|
|
@ -48,7 +48,7 @@ defmodule Pleroma.Web.ApiSpec.Schemas.Account do
|
|||
},
|
||||
background_image: %Schema{type: :string, nullable: true, format: :uri},
|
||||
chat_token: %Schema{type: :string},
|
||||
confirmation_pending: %Schema{
|
||||
is_confirmed: %Schema{
|
||||
type: :boolean,
|
||||
description:
|
||||
"whether the user account is waiting on email confirmation to be activated"
|
||||
|
@ -166,7 +166,7 @@ defmodule Pleroma.Web.ApiSpec.Schemas.Account do
|
|||
"pleroma" => %{
|
||||
"allow_following_move" => true,
|
||||
"background_image" => nil,
|
||||
"confirmation_pending" => true,
|
||||
"is_confirmed" => false,
|
||||
"hide_favorites" => true,
|
||||
"hide_followers" => false,
|
||||
"hide_followers_count" => false,
|
||||
|
|
|
@ -23,7 +23,7 @@ defmodule Pleroma.Web.ApiSpec.Schemas.Chat do
|
|||
"account" => %{
|
||||
"pleroma" => %{
|
||||
"is_admin" => false,
|
||||
"confirmation_pending" => false,
|
||||
"is_confirmed" => true,
|
||||
"hide_followers_count" => false,
|
||||
"is_moderator" => false,
|
||||
"hide_favorites" => true,
|
||||
|
|
|
@ -256,7 +256,7 @@ defmodule Pleroma.Web.ApiSpec.Schemas.Status do
|
|||
"note" => "Tester Number 6",
|
||||
"pleroma" => %{
|
||||
"background_image" => nil,
|
||||
"confirmation_pending" => false,
|
||||
"is_confirmed" => true,
|
||||
"hide_favorites" => true,
|
||||
"hide_followers" => false,
|
||||
"hide_followers_count" => false,
|
||||
|
|
|
@ -84,7 +84,7 @@ def create_from_registration(
|
|||
password_confirmation: random_password
|
||||
},
|
||||
external: true,
|
||||
need_confirmation: false
|
||||
confirmed: true
|
||||
)
|
||||
|> Repo.insert(),
|
||||
{:ok, _} <-
|
||||
|
|
|
@ -266,7 +266,7 @@ defp do_render("show.json", %{user: user} = opts) do
|
|||
pleroma: %{
|
||||
ap_id: user.ap_id,
|
||||
also_known_as: user.also_known_as,
|
||||
confirmation_pending: user.confirmation_pending,
|
||||
is_confirmed: user.is_confirmed,
|
||||
tags: user.tags,
|
||||
hide_followers_count: user.hide_followers_count,
|
||||
hide_follows_count: user.hide_follows_count,
|
||||
|
|
|
@ -30,7 +30,7 @@ defmodule Pleroma.Web.TwitterAPI.Controller do
|
|||
|
||||
def confirm_email(conn, %{"user_id" => uid, "token" => token}) do
|
||||
with %User{} = user <- User.get_cached_by_id(uid),
|
||||
true <- user.local and user.confirmation_pending and user.confirmation_token == token,
|
||||
true <- user.local and !user.is_confirmed and user.confirmation_token == token,
|
||||
{:ok, _} <- User.confirm(user) do
|
||||
redirect(conn, to: "/")
|
||||
end
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
# Pleroma: A lightweight social networking server
|
||||
# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule Pleroma.Repo.Migrations.RefactorConfirmationPendingUserField do
|
||||
use Ecto.Migration
|
||||
|
||||
def up do
|
||||
# Flip the values before we change the meaning of the column
|
||||
execute("UPDATE users SET confirmation_pending = NOT confirmation_pending;")
|
||||
execute("ALTER TABLE users RENAME COLUMN confirmation_pending TO is_confirmed;")
|
||||
execute("ALTER TABLE users ALTER COLUMN is_confirmed SET DEFAULT true;")
|
||||
end
|
||||
|
||||
def down do
|
||||
execute("UPDATE users SET is_confirmed = NOT is_confirmed;")
|
||||
execute("ALTER TABLE users RENAME COLUMN is_confirmed TO confirmation_pending;")
|
||||
execute("ALTER TABLE users ALTER COLUMN confirmation_pending SET DEFAULT false;")
|
||||
end
|
||||
end
|
|
@ -11,9 +11,9 @@ defmodule Pleroma.Repo.Migrations.ConfirmLoggedInUsers do
|
|||
|
||||
def up do
|
||||
User
|
||||
|> where([u], u.confirmation_pending == true)
|
||||
|> where([u], u.is_confirmed == false)
|
||||
|> join(:inner, [u], t in Token, on: t.user_id == u.id)
|
||||
|> Repo.update_all(set: [confirmation_pending: false])
|
||||
|> Repo.update_all(set: [is_confirmed: true])
|
||||
end
|
||||
|
||||
def down do
|
||||
|
|
File diff suppressed because one or more lines are too long
1
priv/static/adminfe/chunk-1e1e.5980e665.css
Normal file
1
priv/static/adminfe/chunk-1e1e.5980e665.css
Normal file
|
@ -0,0 +1 @@
|
|||
.moderation-log-container[data-v-ab8fe5e2]{margin:0 15px}h1[data-v-ab8fe5e2]{margin:0}.el-timeline[data-v-ab8fe5e2]{margin:25px 45px 0 0;padding:0}.moderation-log-date-panel[data-v-ab8fe5e2]{width:350px}.moderation-log-header-container[data-v-ab8fe5e2]{-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin:10px 0 15px}.moderation-log-header-container[data-v-ab8fe5e2],.moderation-log-nav-container[data-v-ab8fe5e2]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.moderation-log-search[data-v-ab8fe5e2]{width:350px}.moderation-log-user-select[data-v-ab8fe5e2]{margin:0 0 20px;width:350px}.reboot-button[data-v-ab8fe5e2]{padding:10px;margin:0;width:145px}.router-link[data-v-ab8fe5e2]{text-decoration:none}.search-container[data-v-ab8fe5e2]{text-align:right}.pagination[data-v-ab8fe5e2]{text-align:center}@media only screen and (max-width:480px){h1[data-v-ab8fe5e2]{font-size:24px}.moderation-log-date-panel[data-v-ab8fe5e2]{width:100%}.moderation-log-user-select[data-v-ab8fe5e2]{margin:0 0 10px;width:55%}.moderation-log-search[data-v-ab8fe5e2]{width:40%}}@media only screen and (max-width:801px) and (min-width:481px){.moderation-log-date-panel[data-v-ab8fe5e2]{width:55%}.moderation-log-user-select[data-v-ab8fe5e2]{margin:0 0 10px;width:55%}.moderation-log-search[data-v-ab8fe5e2]{width:40%}}
|
1
priv/static/adminfe/chunk-4770.20caaae1.css
Normal file
1
priv/static/adminfe/chunk-4770.20caaae1.css
Normal file
File diff suppressed because one or more lines are too long
|
@ -1 +1 @@
|
|||
.actions-button[data-v-794b0bb8]{text-align:left;width:350px;padding:10px}.actions-button-container[data-v-794b0bb8]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.el-dropdown[data-v-794b0bb8]{float:right}.el-icon-edit[data-v-794b0bb8]{margin-right:5px}.tag-container[data-v-794b0bb8]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.tag-text[data-v-794b0bb8]{padding-right:20px}.no-hover[data-v-794b0bb8]:hover{color:#606266;background-color:#fff;cursor:auto}
|
||||
.actions-button[data-v-4c2a46a6]{text-align:left;width:350px;padding:10px}.actions-button-container[data-v-4c2a46a6]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.el-dropdown[data-v-4c2a46a6]{float:right}.el-icon-edit[data-v-4c2a46a6]{margin-right:5px}.tag-container[data-v-4c2a46a6]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.tag-text[data-v-4c2a46a6]{padding-right:20px}.no-hover[data-v-4c2a46a6]:hover{color:#606266;background-color:#fff;cursor:auto}
|
File diff suppressed because one or more lines are too long
1
priv/static/adminfe/chunk-7968.613084d0.css
Normal file
1
priv/static/adminfe/chunk-7968.613084d0.css
Normal file
File diff suppressed because one or more lines are too long
|
@ -1 +0,0 @@
|
|||
.router-link{text-decoration:none}.moderation-log-container[data-v-0a1d7388]{margin:0 15px}h1[data-v-0a1d7388]{margin:0}.el-timeline[data-v-0a1d7388]{margin:25px 45px 0 0;padding:0}.moderation-log-date-panel[data-v-0a1d7388]{width:350px}.moderation-log-header-container[data-v-0a1d7388]{-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin:10px 0 15px}.moderation-log-header-container[data-v-0a1d7388],.moderation-log-nav-container[data-v-0a1d7388]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.moderation-log-search[data-v-0a1d7388]{width:350px}.moderation-log-user-select[data-v-0a1d7388]{margin:0 0 20px;width:350px}.reboot-button[data-v-0a1d7388]{padding:10px;margin:0;width:145px}.search-container[data-v-0a1d7388]{text-align:right}.pagination[data-v-0a1d7388]{text-align:center}@media only screen and (max-width:480px){h1[data-v-0a1d7388]{font-size:24px}.moderation-log-date-panel[data-v-0a1d7388]{width:100%}.moderation-log-user-select[data-v-0a1d7388]{margin:0 0 10px;width:55%}.moderation-log-search[data-v-0a1d7388]{width:40%}}@media only screen and (max-width:801px) and (min-width:481px){.moderation-log-date-panel[data-v-0a1d7388]{width:55%}.moderation-log-user-select[data-v-0a1d7388]{margin:0 0 10px;width:55%}.moderation-log-search[data-v-0a1d7388]{width:40%}}
|
1
priv/static/adminfe/chunk-f364.4fd16c53.css
Normal file
1
priv/static/adminfe/chunk-f364.4fd16c53.css
Normal file
|
@ -0,0 +1 @@
|
|||
.moderate-user-dropdown{width:350px}a{text-decoration:underline}.el-icon-arrow-right{margin-right:6px}.note-header{-webkit-box-align:baseline;-ms-flex-align:baseline;align-items:baseline;height:40px}.note-actor{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.note-actor-name{margin:0;height:28px}.note-avatar-img{width:15px;height:15px;margin-right:5px}.note-body{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.note-card{margin-bottom:15px}.note-content,.note-header{font-size:15px}.note-header{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:28px;font-weight:500}@media only screen and (max-width:480px){.el-card__header{padding:10px 17px}.note-header{height:65px}.note-actor{margin-bottom:5px}.note-header{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}}.account{line-height:26px;font-size:13px;color:#606266}.account:hover{text-decoration:underline}.avatar-img{vertical-align:bottom;width:15px;height:15px}.deactivated{color:grey}.divider{margin:15px 0}.report-account{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-flex:2;-ms-flex-positive:2;flex-grow:2}.report-account,.report-account-container{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:baseline;-ms-flex-align:baseline;align-items:baseline}.report-account-name{font-size:15px;font-weight:500}.report-note-form{margin:15px 0 0}.report-post-note{margin:5px 0 0;text-align:right}.report-row-key{font-size:14px;font-weight:500;padding-right:5px}.reported-statuses{margin-top:15px}.router-link{text-decoration:none}@media only screen and (max-width:480px){.divider{margin:10px 0}.el-card__body{padding:13px}.report-account{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}}.report-show-page-container .id{color:grey;margin:0 15px 22px}.report-show-page-container .report{max-width:1000px;margin:auto}.report-show-page-container .report-actions-button{margin:0 5px}.report-show-page-container .report-actions-container{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.report-show-page-container .report-card-container{margin:auto;padding:0 15px}.report-show-page-container .report-page-header{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;margin:10px 0;padding:0}.report-show-page-container .report-page-header h1{display:inline;margin:0}.report-show-page-container .report-page-header h4{margin-top:10px}.report-show-page-container .report-page-header .avatar-name-container{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.report-show-page-container .report-page-header .avatar-name-container .el-icon-top-right{font-size:2em;line-height:36px;color:#606266}.report-show-page-container .report-page-header .report-page-avatar{margin:0 7px 0 12px}.report-show-page-container .report-page-header-container{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;margin:0 15px;padding:0}.report-show-page-container .report-tag{height:36px;line-height:36px;padding:0 20px;font-size:14px}@media only screen and (max-width:801px){.report-show-page-container .id{margin:7px 15px 15px}.report-show-page-container .report-actions-button{margin:0 3px 6px}.report-show-page-container .report-page-header-container{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.report-show-page-container .report-page-header .avatar-name-container .el-icon-top-right,.report-show-page-container .report-page-header h1{font-size:24px}.report-show-page-container .report-page-header .report-page-avatar{margin:0 5px 0 9px}}@media only screen and (max-width:480px){.report-tag{height:32px;line-height:32px;font-size:14px}}
|
|
@ -1 +0,0 @@
|
|||
.moderate-user-dropdown{width:350px}a{text-decoration:underline}.el-icon-arrow-right{margin-right:6px}.note-header{-webkit-box-align:baseline;-ms-flex-align:baseline;align-items:baseline;height:40px}.note-actor{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.note-actor-name{margin:0;height:28px}.note-avatar-img{width:15px;height:15px;margin-right:5px}.note-body{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.note-card{margin-bottom:15px}.note-content,.note-header{font-size:15px}.note-header{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:28px;font-weight:500}@media only screen and (max-width:480px){.el-card__header{padding:10px 17px}.note-header{height:65px}.note-actor{margin-bottom:5px}.note-header{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}}.account{line-height:26px;font-size:13px;color:#606266}.account:hover{text-decoration:underline}.avatar-img{vertical-align:bottom;width:15px;height:15px}.deactivated{color:grey}.divider{margin:15px 0}.report-account{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-flex:2;-ms-flex-positive:2;flex-grow:2}.report-account,.report-account-container{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:baseline;-ms-flex-align:baseline;align-items:baseline}.report-account-name{font-size:15px;font-weight:500}.report-note-form{margin:15px 0 0}.report-post-note{margin:5px 0 0;text-align:right}.report-row-key{font-size:14px;font-weight:500;padding-right:5px}.reported-statuses{margin-top:15px}.router-link{text-decoration:none}.report-show-page-container .id{color:grey;margin:0 15px 22px}.report-show-page-container .report{width:1000px;margin:auto}.report-show-page-container .report-actions-button{margin:3px 0 6px}.report-show-page-container .report-page-header{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;margin:10px 0;padding:0}.report-show-page-container .report-page-header h1{display:inline;margin:0}.report-show-page-container .report-page-header h4{margin-top:10px}.report-show-page-container .report-page-header .avatar-name-container{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.report-show-page-container .report-page-header .avatar-name-container .el-icon-top-right{font-size:2em;line-height:36px;color:#606266}.report-show-page-container .report-page-header .report-page-avatar{margin:0 7px 0 12px}.report-show-page-container .report-page-header-container{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;margin:0 15px;padding:0}.report-show-page-container .report-tag{height:36px;line-height:36px;padding:0 20px;font-size:14px}
|
|
@ -1 +1 @@
|
|||
<!DOCTYPE html><html><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1"><meta name=renderer content=webkit><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"><title>Admin FE</title><link rel="shortcut icon" href=favicon.ico><link href=chunk-elementUI.f77689d7.css rel=stylesheet><link href=chunk-libs.5cf7f50a.css rel=stylesheet><link href=app.6fb984d1.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=static/js/runtime.ba96836e.js></script><script type=text/javascript src=static/js/chunk-elementUI.21957ec8.js></script><script type=text/javascript src=static/js/chunk-libs.32ea9181.js></script><script type=text/javascript src=static/js/app.c67f9a2f.js></script></body></html>
|
||||
<!DOCTYPE html><html><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1"><meta name=renderer content=webkit><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"><title>Admin FE</title><link rel="shortcut icon" href=favicon.ico><link href=chunk-elementUI.f77689d7.css rel=stylesheet><link href=chunk-libs.5cf7f50a.css rel=stylesheet><link href=app.6fb984d1.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=static/js/runtime.52fd11cf.js></script><script type=text/javascript src=static/js/chunk-elementUI.21957ec8.js></script><script type=text/javascript src=static/js/chunk-libs.5ca2c8e8.js></script><script type=text/javascript src=static/js/app.3e54b198.js></script></body></html>
|
2
priv/static/adminfe/static/js/app.3e54b198.js
Normal file
2
priv/static/adminfe/static/js/app.3e54b198.js
Normal file
File diff suppressed because one or more lines are too long
1
priv/static/adminfe/static/js/app.3e54b198.js.map
Normal file
1
priv/static/adminfe/static/js/app.3e54b198.js.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
priv/static/adminfe/static/js/chunk-0537.d0eef370.js
Normal file
2
priv/static/adminfe/static/js/chunk-0537.d0eef370.js
Normal file
File diff suppressed because one or more lines are too long
1
priv/static/adminfe/static/js/chunk-0537.d0eef370.js.map
Normal file
1
priv/static/adminfe/static/js/chunk-0537.d0eef370.js.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
priv/static/adminfe/static/js/chunk-1e1e.37f6f555.js
Normal file
2
priv/static/adminfe/static/js/chunk-1e1e.37f6f555.js
Normal file
File diff suppressed because one or more lines are too long
1
priv/static/adminfe/static/js/chunk-1e1e.37f6f555.js.map
Normal file
1
priv/static/adminfe/static/js/chunk-1e1e.37f6f555.js.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
priv/static/adminfe/static/js/chunk-35b1.51b3140e.js.map
Normal file
1
priv/static/adminfe/static/js/chunk-35b1.51b3140e.js.map
Normal file
File diff suppressed because one or more lines are too long
2
priv/static/adminfe/static/js/chunk-4770.1c1fff97.js
Normal file
2
priv/static/adminfe/static/js/chunk-4770.1c1fff97.js
Normal file
File diff suppressed because one or more lines are too long
1
priv/static/adminfe/static/js/chunk-4770.1c1fff97.js.map
Normal file
1
priv/static/adminfe/static/js/chunk-4770.1c1fff97.js.map
Normal file
File diff suppressed because one or more lines are too long
2
priv/static/adminfe/static/js/chunk-50ba.afb924bf.js
Normal file
2
priv/static/adminfe/static/js/chunk-50ba.afb924bf.js
Normal file
File diff suppressed because one or more lines are too long
1
priv/static/adminfe/static/js/chunk-50ba.afb924bf.js.map
Normal file
1
priv/static/adminfe/static/js/chunk-50ba.afb924bf.js.map
Normal file
File diff suppressed because one or more lines are too long
2
priv/static/adminfe/static/js/chunk-606c.f5585a4f.js
Normal file
2
priv/static/adminfe/static/js/chunk-606c.f5585a4f.js
Normal file
File diff suppressed because one or more lines are too long
1
priv/static/adminfe/static/js/chunk-606c.f5585a4f.js.map
Normal file
1
priv/static/adminfe/static/js/chunk-606c.f5585a4f.js.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,2 +1,2 @@
|
|||
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-6e81"],{BF41:function(t,a,i){},"UUO+":function(t,a,i){"use strict";i.r(a);var e=i("zGwZ"),s=i.n(e),r={name:"Page401",data:function(){return{errGif:s.a+"?"+ +new Date,ewizardClap:"https://wpimg.wallstcn.com/007ef517-bafd-4066-aae4-6883632d9646",dialogVisible:!1}},methods:{back:function(){this.$route.query.noGoBack?this.$router.push({path:"/dashboard"}):this.$router.go(-1)}}},n=(i("UrVv"),i("KHd+")),l=Object(n.a)(r,function(){var t=this,a=t.$createElement,i=t._self._c||a;return i("div",{staticClass:"errPage-container"},[i("el-button",{staticClass:"pan-back-btn",attrs:{icon:"arrow-left"},on:{click:t.back}},[t._v("返回")]),t._v(" "),i("el-row",[i("el-col",{attrs:{span:12}},[i("h1",{staticClass:"text-jumbo text-ginormous"},[t._v("Oops!")]),t._v("\n gif来源"),i("a",{attrs:{href:"https://zh.airbnb.com/",target:"_blank"}},[t._v("airbnb")]),t._v(" 页面\n "),i("h2",[t._v("你没有权限去该页面")]),t._v(" "),i("h6",[t._v("如有不满请联系你领导")]),t._v(" "),i("ul",{staticClass:"list-unstyled"},[i("li",[t._v("或者你可以去:")]),t._v(" "),i("li",{staticClass:"link-type"},[i("router-link",{attrs:{to:"/dashboard"}},[t._v("回首页")])],1),t._v(" "),i("li",{staticClass:"link-type"},[i("a",{attrs:{href:"https://www.taobao.com/"}},[t._v("随便看看")])]),t._v(" "),i("li",[i("a",{attrs:{href:"#"},on:{click:function(a){a.preventDefault(),t.dialogVisible=!0}}},[t._v("点我看图")])])])]),t._v(" "),i("el-col",{attrs:{span:12}},[i("img",{attrs:{src:t.errGif,width:"313",height:"428",alt:"Girl has dropped her ice cream."}})])],1),t._v(" "),i("el-dialog",{attrs:{visible:t.dialogVisible,title:"随便看"},on:{"update:visible":function(a){t.dialogVisible=a}}},[i("img",{staticClass:"pan-img",attrs:{src:t.ewizardClap}})])],1)},[],!1,null,"ab9be52c",null);l.options.__file="401.vue";a.default=l.exports},UrVv:function(t,a,i){"use strict";var e=i("BF41");i.n(e).a},zGwZ:function(t,a,i){t.exports=i.p+"static/img/401.089007e.gif"}}]);
|
||||
//# sourceMappingURL=chunk-6e81.afade883.js.map
|
||||
//# sourceMappingURL=chunk-6e81.6c4f2ce1.js.map
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
priv/static/adminfe/static/js/chunk-7041.9658c334.js.map
Normal file
1
priv/static/adminfe/static/js/chunk-7041.9658c334.js.map
Normal file
File diff suppressed because one or more lines are too long
2
priv/static/adminfe/static/js/chunk-7968.d6317b83.js
Normal file
2
priv/static/adminfe/static/js/chunk-7968.d6317b83.js
Normal file
File diff suppressed because one or more lines are too long
1
priv/static/adminfe/static/js/chunk-7968.d6317b83.js.map
Normal file
1
priv/static/adminfe/static/js/chunk-7968.d6317b83.js.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,2 +1,2 @@
|
|||
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-e660"],{GFxI:function(e,n,t){},aSQl:function(e,n,t){"use strict";t.d(n,"a",function(){return p});var o=t("o0o1"),a=t.n(o),r=t("yXPU"),s=t.n(r),i=t("oAJy"),l=t.n(i),c=t("LvDl"),u=t.n(c),p=function(){var e=s()(a.a.mark(function e(n){var t,o;return a.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,l.a.getItem("vuex-lz");case 2:if(t=e.sent,void 0!==(o=u.a.get(t,"oauth.userToken"))){e.next=6;break}throw new Error("PleromaFE token not found");case 6:return e.next=8,n.dispatch("LoginByPleromaFE",{token:o});case 8:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}()},abDm:function(e,n,t){"use strict";var o=t("GFxI");t.n(o).a},c11S:function(e,n,t){"use strict";var o=t("gTgX");t.n(o).a},gTgX:function(e,n,t){},ntYl:function(e,n,t){"use strict";t.r(n);var o=t("J4zp"),a=t.n(o),r=t("o0o1"),s=t.n(r),i=t("yXPU"),l=t.n(i),c=t("zT9a"),u=t("oAJy"),p=t.n(u),d=t("LvDl"),m=t.n(d),g=t("mSNy"),v=t("aSQl"),h={name:"Login",components:{"svg-icon":c.a},data:function(){return{loginForm:{username:"",password:""},passwordType:"password",loading:!1,loadingPleromaFE:!1,showDialog:!1,redirect:void 0,pleromaFEToken:!1,pleromaFEStateKey:"vuex-lz",pleromaFEState:{}}},watch:{$route:{handler:function(e){this.redirect=e.query&&e.query.redirect},immediate:!0}},mounted:function(){var e=this;return l()(s.a.mark(function n(){var t;return s.a.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,p.a.getItem(e.pleromaFEStateKey);case 2:if(t=n.sent,e.pleromaFEState=t,void 0!==m.a.get(t,"oauth.userToken")){n.next=6;break}return n.abrupt("return");case 6:e.pleromaFEToken=!0;case 7:case"end":return n.stop()}},n)}))()},methods:{showPwd:function(){"password"===this.passwordType?this.passwordType="":this.passwordType="password"},handleLogin:function(){var e=this;this.loading=!0;var n=this.getLoginData();this.$store.dispatch("LoginByUsername",n).then(function(){e.loading=!1,e.$router.push({path:e.redirect||"/users/index"})}).catch(function(){e.loading=!1})},handlePleromaFELogin:function(){var e=this;return l()(s.a.mark(function n(){return s.a.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return e.loadingPleromaFE=!0,n.prev=1,n.next=4,Object(v.a)(e.$store);case 4:n.next=10;break;case 6:n.prev=6,n.t0=n.catch(1),e.loadingPleromaFE=!1,e.$message.error(g.a.t("login.pleromaFELoginFailed"));case 10:e.loadingPleromaFE=!1,e.$message.success(g.a.t("login.pleromaFELoginSucceed")),e.$router.push({path:e.redirect||"/users/index"});case 13:case"end":return n.stop()}},n,null,[[1,6]])}))()},getLoginData:function(){var e=this.loginForm.username.split("@"),n=a()(e,2),t=n[0],o=n[1];return{username:t.trim(),authHost:o?o.trim():window.location.host,password:this.loginForm.password}}}},f=(t("c11S"),t("abDm"),t("KHd+")),w=Object(f.a)(h,function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("div",{staticClass:"login-container"},[t("el-form",{ref:"loginForm",staticClass:"login-form",attrs:{model:e.loginForm,"auto-complete":"on","label-position":"left"}},[t("div",{staticClass:"title-container"},[t("h3",{staticClass:"title"},[e._v("\n "+e._s(e.$t("login.title"))+"\n ")])]),e._v(" "),t("el-form-item",{attrs:{prop:"username"}},[t("span",{staticClass:"svg-container"},[t("svg-icon",{attrs:{"icon-class":"user"}})],1),e._v(" "),t("el-input",{attrs:{placeholder:e.$t("login.username"),name:"username",type:"text","auto-complete":"on"},model:{value:e.loginForm.username,callback:function(n){e.$set(e.loginForm,"username",n)},expression:"loginForm.username"}})],1),e._v(" "),t("div",{staticClass:"omit-host-note"},[e._v(e._s(e.$t("login.omitHostname")))]),e._v(" "),t("el-form-item",{attrs:{prop:"password"}},[t("span",{staticClass:"svg-container"},[t("svg-icon",{attrs:{"icon-class":"password"}})],1),e._v(" "),t("el-input",{attrs:{type:e.passwordType,placeholder:e.$t("login.password"),name:"password","auto-complete":"on"},nativeOn:{keyup:function(n){return!n.type.indexOf("key")&&e._k(n.keyCode,"enter",13,n.key,"Enter")?null:e.handleLogin(n)}},model:{value:e.loginForm.password,callback:function(n){e.$set(e.loginForm,"password",n)},expression:"loginForm.password"}}),e._v(" "),t("span",{staticClass:"show-pwd",on:{click:e.showPwd}},[t("svg-icon",{attrs:{"icon-class":"password"===e.passwordType?"eye":"eye-open"}})],1)],1),e._v(" "),t("el-button",{staticClass:"login-button",attrs:{loading:e.loading,type:"primary"},nativeOn:{click:function(n){return n.preventDefault(),e.handleLogin(n)}}},[e._v("\n "+e._s(e.$t("login.logIn"))+"\n ")]),e._v(" "),e.pleromaFEToken?t("el-button",{staticClass:"login-button",attrs:{loading:e.loadingPleromaFE,type:"primary"},nativeOn:{click:function(n){return n.preventDefault(),e.handlePleromaFELogin(n)}}},[e._v("\n "+e._s(e.$t("login.logInViaPleromaFE"))+"\n ")]):e._e()],1)],1)},[],!1,null,"5bb13616",null);w.options.__file="index.vue";n.default=w.exports}}]);
|
||||
//# sourceMappingURL=chunk-e660.feca27c4.js.map
|
||||
//# sourceMappingURL=chunk-e660.2101cafc.js.map
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
priv/static/adminfe/static/js/chunk-f364.f22b0eee.js
Normal file
2
priv/static/adminfe/static/js/chunk-f364.f22b0eee.js
Normal file
File diff suppressed because one or more lines are too long
1
priv/static/adminfe/static/js/chunk-f364.f22b0eee.js.map
Normal file
1
priv/static/adminfe/static/js/chunk-f364.f22b0eee.js.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
priv/static/adminfe/static/js/runtime.52fd11cf.js
Normal file
2
priv/static/adminfe/static/js/runtime.52fd11cf.js
Normal file
|
@ -0,0 +1,2 @@
|
|||
!function(e){function n(n){for(var t,r,a=n[0],f=n[1],h=n[2],i=0,s=[];i<a.length;i++)r=a[i],Object.prototype.hasOwnProperty.call(u,r)&&u[r]&&s.push(u[r][0]),u[r]=0;for(t in f)Object.prototype.hasOwnProperty.call(f,t)&&(e[t]=f[t]);for(k&&k(n);s.length;)s.shift()();return o.push.apply(o,h||[]),c()}function c(){for(var e,n=0;n<o.length;n++){for(var c=o[n],t=!0,r=1;r<c.length;r++){var f=c[r];0!==u[f]&&(t=!1)}t&&(o.splice(n--,1),e=a(a.s=c[0]))}return e}var t={},r={runtime:0},u={runtime:0},o=[];function a(n){if(t[n])return t[n].exports;var c=t[n]={i:n,l:!1,exports:{}};return e[n].call(c.exports,c,c.exports,a),c.l=!0,c.exports}a.e=function(e){var n=[];r[e]?n.push(r[e]):0!==r[e]&&{"chunk-68ea9":1,"chunk-6e81":1,"chunk-commons":1,"chunk-03c5":1,"chunk-0537":1,"chunk-50ba":1,"chunk-606c":1,"chunk-4770":1,"chunk-7c6b":1,"chunk-170f":1,"chunk-1e1e":1,"chunk-35b1":1,"chunk-176e":1,"chunk-7041":1,"chunk-7968":1,"chunk-f364":1,"chunk-e660":1}[e]&&n.push(r[e]=new Promise(function(n,c){for(var t=({"chunk-commons":"chunk-commons"}[e]||e)+"."+{"7zzA":"31d6cfe0",JEtC:"31d6cfe0","chunk-68ea9":"892994aa","chunk-6e81":"687d5046","chunk-commons":"f7c3d390","chunk-03c5":"3368e00c","chunk-0537":"76929cff","chunk-50ba":"6e4bf9f4","chunk-606c":"7c5b0a08","chunk-68ea":"31d6cfe0","chunk-4770":"20caaae1","chunk-7c6b":"b633878a","chunk-d55e":"31d6cfe0","chunk-170f":"fea927c5","chunk-1e1e":"5980e665","chunk-35b1":"949db050","chunk-176e":"d9a630b2","chunk-7041":"c5f6eab7","chunk-7968":"613084d0","chunk-f364":"4fd16c53",oAJy:"31d6cfe0","chunk-16d0":"31d6cfe0","chunk-e660":"62c077ac"}[e]+".css",r=a.p+t,u=document.getElementsByTagName("link"),o=0;o<u.length;o++){var f=(i=u[o]).getAttribute("data-href")||i.getAttribute("href");if("stylesheet"===i.rel&&(f===t||f===r))return n()}var h=document.getElementsByTagName("style");for(o=0;o<h.length;o++){var i;if((f=(i=h[o]).getAttribute("data-href"))===t||f===r)return n()}var k=document.createElement("link");k.rel="stylesheet",k.type="text/css",k.onload=n,k.onerror=function(n){var t=n&&n.target&&n.target.src||r,u=new Error("Loading CSS chunk "+e+" failed.\n("+t+")");u.request=t,c(u)},k.href=r,document.getElementsByTagName("head")[0].appendChild(k)}).then(function(){r[e]=0}));var c=u[e];if(0!==c)if(c)n.push(c[2]);else{var t=new Promise(function(n,t){c=u[e]=[n,t]});n.push(c[2]=t);var o,f=document.createElement("script");f.charset="utf-8",f.timeout=120,a.nc&&f.setAttribute("nonce",a.nc),f.src=function(e){return a.p+"static/js/"+({"chunk-commons":"chunk-commons"}[e]||e)+"."+{"7zzA":"e1ae1c94",JEtC:"f9ba4594","chunk-68ea9":"5a11341a","chunk-6e81":"6c4f2ce1","chunk-commons":"4ae74caa","chunk-03c5":"1b0ab243","chunk-0537":"d0eef370","chunk-50ba":"afb924bf","chunk-606c":"f5585a4f","chunk-68ea":"6d56674a","chunk-4770":"1c1fff97","chunk-7c6b":"34152862","chunk-d55e":"f9bab96d","chunk-170f":"e1d6aac3","chunk-1e1e":"37f6f555","chunk-35b1":"51b3140e","chunk-176e":"f64cb745","chunk-7041":"9658c334","chunk-7968":"d6317b83","chunk-f364":"f22b0eee",oAJy:"2d5429b2","chunk-16d0":"fef0ce65","chunk-e660":"2101cafc"}[e]+".js"}(e);var h=new Error;o=function(n){f.onerror=f.onload=null,clearTimeout(i);var c=u[e];if(0!==c){if(c){var t=n&&("load"===n.type?"missing":n.type),r=n&&n.target&&n.target.src;h.message="Loading chunk "+e+" failed.\n("+t+": "+r+")",h.name="ChunkLoadError",h.type=t,h.request=r,c[1](h)}u[e]=void 0}};var i=setTimeout(function(){o({type:"timeout",target:f})},12e4);f.onerror=f.onload=o,document.head.appendChild(f)}return Promise.all(n)},a.m=e,a.c=t,a.d=function(e,n,c){a.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:c})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,n){if(1&n&&(e=a(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var c=Object.create(null);if(a.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var t in e)a.d(c,t,function(n){return e[n]}.bind(null,t));return c},a.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(n,"a",n),n},a.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},a.p="",a.oe=function(e){throw console.error(e),e};var f=window.webpackJsonp=window.webpackJsonp||[],h=f.push.bind(f);f.push=n,f=f.slice();for(var i=0;i<f.length;i++)n(f[i]);var k=h;c()}([]);
|
||||
//# sourceMappingURL=runtime.52fd11cf.js.map
|
1
priv/static/adminfe/static/js/runtime.52fd11cf.js.map
Normal file
1
priv/static/adminfe/static/js/runtime.52fd11cf.js.map
Normal file
File diff suppressed because one or more lines are too long
|
@ -1,2 +0,0 @@
|
|||
!function(e){function n(n){for(var t,r,a=n[0],h=n[1],f=n[2],d=0,k=[];d<a.length;d++)r=a[d],Object.prototype.hasOwnProperty.call(u,r)&&u[r]&&k.push(u[r][0]),u[r]=0;for(t in h)Object.prototype.hasOwnProperty.call(h,t)&&(e[t]=h[t]);for(i&&i(n);k.length;)k.shift()();return o.push.apply(o,f||[]),c()}function c(){for(var e,n=0;n<o.length;n++){for(var c=o[n],t=!0,r=1;r<c.length;r++){var h=c[r];0!==u[h]&&(t=!1)}t&&(o.splice(n--,1),e=a(a.s=c[0]))}return e}var t={},r={runtime:0},u={runtime:0},o=[];function a(n){if(t[n])return t[n].exports;var c=t[n]={i:n,l:!1,exports:{}};return e[n].call(c.exports,c,c.exports,a),c.l=!0,c.exports}a.e=function(e){var n=[];r[e]?n.push(r[e]):0!==r[e]&&{"chunk-68ea9":1,"chunk-6e81":1,"chunk-commons":1,"chunk-03c5":1,"chunk-0537":1,"chunk-0492":1,"chunk-7c6b":1,"chunk-170f":1,"chunk-1944":1,"chunk-7968":1,"chunk-8fbb":1,"chunk-ad1e":1,"chunk-f364":1,"chunk-f625":1,"chunk-176e":1,"chunk-04b0":1,"chunk-e660":1}[e]&&n.push(r[e]=new Promise(function(n,c){for(var t=({"chunk-commons":"chunk-commons"}[e]||e)+"."+{"7zzA":"31d6cfe0",JEtC:"31d6cfe0","chunk-68ea9":"8331e95e","chunk-6e81":"559b76f9","chunk-commons":"f7c3d390","chunk-03c5":"e6a0e2d0","chunk-0537":"cd83e5d6","chunk-68ea":"31d6cfe0","chunk-0492":"15b0611f","chunk-7c6b":"b633878a","chunk-d55e":"31d6cfe0","chunk-170f":"fea927c5","chunk-1944":"731ba892","chunk-7968":"283bc086","chunk-8fbb":"dd321643","chunk-ad1e":"1a3c5339","chunk-f364":"6b5f3f0d","chunk-f625":"bcd0ea3b","chunk-176e":"d9a630b2","chunk-04b0":"7e25cd78",oAJy:"31d6cfe0","chunk-16d0":"31d6cfe0","chunk-e660":"9e75af5b"}[e]+".css",r=a.p+t,u=document.getElementsByTagName("link"),o=0;o<u.length;o++){var h=(d=u[o]).getAttribute("data-href")||d.getAttribute("href");if("stylesheet"===d.rel&&(h===t||h===r))return n()}var f=document.getElementsByTagName("style");for(o=0;o<f.length;o++){var d;if((h=(d=f[o]).getAttribute("data-href"))===t||h===r)return n()}var i=document.createElement("link");i.rel="stylesheet",i.type="text/css",i.onload=n,i.onerror=function(n){var t=n&&n.target&&n.target.src||r,u=new Error("Loading CSS chunk "+e+" failed.\n("+t+")");u.request=t,c(u)},i.href=r,document.getElementsByTagName("head")[0].appendChild(i)}).then(function(){r[e]=0}));var c=u[e];if(0!==c)if(c)n.push(c[2]);else{var t=new Promise(function(n,t){c=u[e]=[n,t]});n.push(c[2]=t);var o,h=document.createElement("script");h.charset="utf-8",h.timeout=120,a.nc&&h.setAttribute("nonce",a.nc),h.src=function(e){return a.p+"static/js/"+({"chunk-commons":"chunk-commons"}[e]||e)+"."+{"7zzA":"e1ae1c94",JEtC:"f9ba4594","chunk-68ea9":"2b2877d5","chunk-6e81":"afade883","chunk-commons":"4ae74caa","chunk-03c5":"6de0c4c7","chunk-0537":"74db16b0","chunk-68ea":"6d56674a","chunk-0492":"47abe1dc","chunk-7c6b":"34152862","chunk-d55e":"f9bab96d","chunk-170f":"e1d6aac3","chunk-1944":"7bed0c4b","chunk-7968":"f51e3292","chunk-8fbb":"c847ce9d","chunk-ad1e":"eba9db26","chunk-f364":"1122502b","chunk-f625":"904137fd","chunk-176e":"f64cb745","chunk-04b0":"90c6d24c",oAJy:"2d5429b2","chunk-16d0":"fef0ce65","chunk-e660":"feca27c4"}[e]+".js"}(e);var f=new Error;o=function(n){h.onerror=h.onload=null,clearTimeout(d);var c=u[e];if(0!==c){if(c){var t=n&&("load"===n.type?"missing":n.type),r=n&&n.target&&n.target.src;f.message="Loading chunk "+e+" failed.\n("+t+": "+r+")",f.name="ChunkLoadError",f.type=t,f.request=r,c[1](f)}u[e]=void 0}};var d=setTimeout(function(){o({type:"timeout",target:h})},12e4);h.onerror=h.onload=o,document.head.appendChild(h)}return Promise.all(n)},a.m=e,a.c=t,a.d=function(e,n,c){a.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:c})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,n){if(1&n&&(e=a(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var c=Object.create(null);if(a.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var t in e)a.d(c,t,function(n){return e[n]}.bind(null,t));return c},a.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(n,"a",n),n},a.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},a.p="",a.oe=function(e){throw console.error(e),e};var h=window.webpackJsonp=window.webpackJsonp||[],f=h.push.bind(h);h.push=n,h=h.slice();for(var d=0;d<h.length;d++)n(h[d]);var i=f;c()}([]);
|
||||
//# sourceMappingURL=runtime.ba96836e.js.map
|
File diff suppressed because one or more lines are too long
|
@ -61,7 +61,7 @@ test "Sends test email with given address" do
|
|||
test "Sends confirmation emails" do
|
||||
local_user1 =
|
||||
insert(:user, %{
|
||||
confirmation_pending: true,
|
||||
is_confirmed: false,
|
||||
confirmation_token: "mytoken",
|
||||
deactivated: false,
|
||||
email: "local1@pleroma.com",
|
||||
|
@ -70,7 +70,7 @@ test "Sends confirmation emails" do
|
|||
|
||||
local_user2 =
|
||||
insert(:user, %{
|
||||
confirmation_pending: true,
|
||||
is_confirmed: false,
|
||||
confirmation_token: "mytoken",
|
||||
deactivated: false,
|
||||
email: "local2@pleroma.com",
|
||||
|
@ -88,7 +88,7 @@ test "Sends confirmation emails" do
|
|||
test "Does not send confirmation email to inappropriate users" do
|
||||
# confirmed user
|
||||
insert(:user, %{
|
||||
confirmation_pending: false,
|
||||
is_confirmed: true,
|
||||
confirmation_token: "mytoken",
|
||||
deactivated: false,
|
||||
email: "confirmed@pleroma.com",
|
||||
|
|
|
@ -238,7 +238,7 @@ test "All statuses set" do
|
|||
assert message =~ ~r/Admin status .* true/
|
||||
|
||||
assert_received {:mix_shell, :info, [message]}
|
||||
assert message =~ ~r/Confirmation pending .* false/
|
||||
assert message =~ ~r/Confirmation status.* true/
|
||||
|
||||
assert_received {:mix_shell, :info, [message]}
|
||||
assert message =~ ~r/Locked status .* true/
|
||||
|
@ -250,7 +250,7 @@ test "All statuses set" do
|
|||
assert user.is_moderator
|
||||
assert user.is_locked
|
||||
assert user.is_admin
|
||||
refute user.confirmation_pending
|
||||
assert user.is_confirmed
|
||||
end
|
||||
|
||||
test "All statuses unset" do
|
||||
|
@ -259,7 +259,7 @@ test "All statuses unset" do
|
|||
is_locked: true,
|
||||
is_moderator: true,
|
||||
is_admin: true,
|
||||
confirmation_pending: true
|
||||
is_confirmed: false
|
||||
)
|
||||
|
||||
Mix.Tasks.Pleroma.User.run([
|
||||
|
@ -275,7 +275,7 @@ test "All statuses unset" do
|
|||
assert message =~ ~r/Admin status .* false/
|
||||
|
||||
assert_received {:mix_shell, :info, [message]}
|
||||
assert message =~ ~r/Confirmation pending .* true/
|
||||
assert message =~ ~r/Confirmation status.* false/
|
||||
|
||||
assert_received {:mix_shell, :info, [message]}
|
||||
assert message =~ ~r/Locked status .* false/
|
||||
|
@ -287,7 +287,7 @@ test "All statuses unset" do
|
|||
refute user.is_moderator
|
||||
refute user.is_locked
|
||||
refute user.is_admin
|
||||
assert user.confirmation_pending
|
||||
refute user.is_confirmed
|
||||
end
|
||||
|
||||
test "no user to set status" do
|
||||
|
@ -436,13 +436,6 @@ test "invite is revoked" do
|
|||
assert_received {:mix_shell, :info, [message]}
|
||||
assert message =~ "Invite for token #{invite.token} was revoked."
|
||||
end
|
||||
|
||||
test "it prints an error message when invite is not exist" do
|
||||
Mix.Tasks.Pleroma.User.run(["revoke_invite", "foo"])
|
||||
|
||||
assert_received {:mix_shell, :error, [message]}
|
||||
assert message =~ "No invite found"
|
||||
end
|
||||
end
|
||||
|
||||
describe "running delete_activities" do
|
||||
|
@ -464,27 +457,27 @@ test "it prints an error message when user is not exist" do
|
|||
|
||||
describe "running confirm" do
|
||||
test "user is confirmed" do
|
||||
%{id: id, nickname: nickname} = insert(:user, confirmation_pending: false)
|
||||
%{id: id, nickname: nickname} = insert(:user, is_confirmed: true)
|
||||
|
||||
assert :ok = Mix.Tasks.Pleroma.User.run(["confirm", nickname])
|
||||
assert_received {:mix_shell, :info, [message]}
|
||||
assert message == "#{nickname} doesn't need confirmation."
|
||||
|
||||
user = Repo.get(User, id)
|
||||
refute user.confirmation_pending
|
||||
assert user.is_confirmed
|
||||
refute user.confirmation_token
|
||||
end
|
||||
|
||||
test "user is not confirmed" do
|
||||
%{id: id, nickname: nickname} =
|
||||
insert(:user, confirmation_pending: true, confirmation_token: "some token")
|
||||
insert(:user, is_confirmed: false, confirmation_token: "some token")
|
||||
|
||||
assert :ok = Mix.Tasks.Pleroma.User.run(["confirm", nickname])
|
||||
assert_received {:mix_shell, :info, [message]}
|
||||
assert message == "#{nickname} doesn't need confirmation."
|
||||
|
||||
user = Repo.get(User, id)
|
||||
refute user.confirmation_pending
|
||||
assert user.is_confirmed
|
||||
refute user.confirmation_token
|
||||
end
|
||||
|
||||
|
@ -579,29 +572,29 @@ test "it prints an error message when user is not exist" do
|
|||
|
||||
describe "bulk confirm and unconfirm" do
|
||||
test "confirm all" do
|
||||
user1 = insert(:user, confirmation_pending: true)
|
||||
user2 = insert(:user, confirmation_pending: true)
|
||||
user1 = insert(:user, is_confirmed: false)
|
||||
user2 = insert(:user, is_confirmed: false)
|
||||
|
||||
assert user1.confirmation_pending
|
||||
assert user2.confirmation_pending
|
||||
refute user1.is_confirmed
|
||||
refute user2.is_confirmed
|
||||
|
||||
Mix.Tasks.Pleroma.User.run(["confirm_all"])
|
||||
|
||||
user1 = User.get_cached_by_nickname(user1.nickname)
|
||||
user2 = User.get_cached_by_nickname(user2.nickname)
|
||||
|
||||
refute user1.confirmation_pending
|
||||
refute user2.confirmation_pending
|
||||
assert user1.is_confirmed
|
||||
assert user2.is_confirmed
|
||||
end
|
||||
|
||||
test "unconfirm all" do
|
||||
user1 = insert(:user, confirmation_pending: false)
|
||||
user2 = insert(:user, confirmation_pending: false)
|
||||
admin = insert(:user, is_admin: true, confirmation_pending: false)
|
||||
mod = insert(:user, is_moderator: true, confirmation_pending: false)
|
||||
user1 = insert(:user, is_confirmed: true)
|
||||
user2 = insert(:user, is_confirmed: true)
|
||||
admin = insert(:user, is_admin: true, is_confirmed: true)
|
||||
mod = insert(:user, is_moderator: true, is_confirmed: true)
|
||||
|
||||
refute user1.confirmation_pending
|
||||
refute user2.confirmation_pending
|
||||
assert user1.is_confirmed
|
||||
assert user2.is_confirmed
|
||||
|
||||
Mix.Tasks.Pleroma.User.run(["unconfirm_all"])
|
||||
|
||||
|
@ -610,10 +603,10 @@ test "unconfirm all" do
|
|||
admin = User.get_cached_by_nickname(admin.nickname)
|
||||
mod = User.get_cached_by_nickname(mod.nickname)
|
||||
|
||||
assert user1.confirmation_pending
|
||||
assert user2.confirmation_pending
|
||||
refute admin.confirmation_pending
|
||||
refute mod.confirmation_pending
|
||||
refute user1.is_confirmed
|
||||
refute user2.is_confirmed
|
||||
assert admin.is_confirmed
|
||||
assert mod.is_confirmed
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -14,12 +14,12 @@ defmodule Pleroma.Repo.Migrations.ConfirmLoggedInUsersTest do
|
|||
|
||||
test "up/0 confirms unconfirmed but previously-logged-in users", %{migration: migration} do
|
||||
insert_list(25, :oauth_token)
|
||||
Repo.update_all(User, set: [confirmation_pending: true])
|
||||
insert_list(5, :user, confirmation_pending: true)
|
||||
Repo.update_all(User, set: [is_confirmed: false])
|
||||
insert_list(5, :user, is_confirmed: false)
|
||||
|
||||
count =
|
||||
User
|
||||
|> where(confirmation_pending: true)
|
||||
|> where(is_confirmed: false)
|
||||
|> Repo.aggregate(:count)
|
||||
|
||||
assert count == 30
|
||||
|
@ -28,7 +28,7 @@ test "up/0 confirms unconfirmed but previously-logged-in users", %{migration: mi
|
|||
|
||||
count =
|
||||
User
|
||||
|> where(confirmation_pending: true)
|
||||
|> where(is_confirmed: false)
|
||||
|> Repo.aggregate(:count)
|
||||
|
||||
assert count == 5
|
||||
|
|
|
@ -640,7 +640,7 @@ test "it creates a confirmed user" do
|
|||
|
||||
{:ok, user} = Repo.insert(changeset)
|
||||
|
||||
refute user.confirmation_pending
|
||||
assert user.is_confirmed
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -661,17 +661,17 @@ test "it creates unconfirmed user" do
|
|||
|
||||
{:ok, user} = Repo.insert(changeset)
|
||||
|
||||
assert user.confirmation_pending
|
||||
refute user.is_confirmed
|
||||
assert user.confirmation_token
|
||||
end
|
||||
|
||||
test "it creates confirmed user if :confirmed option is given" do
|
||||
changeset = User.register_changeset(%User{}, @full_user_data, need_confirmation: false)
|
||||
changeset = User.register_changeset(%User{}, @full_user_data, confirmed: true)
|
||||
assert changeset.valid?
|
||||
|
||||
{:ok, user} = Repo.insert(changeset)
|
||||
|
||||
refute user.confirmation_pending
|
||||
assert user.is_confirmed
|
||||
refute user.confirmation_token
|
||||
end
|
||||
end
|
||||
|
@ -1443,17 +1443,17 @@ test "approving an approved user does not trigger post-register actions" do
|
|||
|
||||
describe "confirm" do
|
||||
test "confirms a user" do
|
||||
user = insert(:user, confirmation_pending: true)
|
||||
assert true == user.confirmation_pending
|
||||
user = insert(:user, is_confirmed: false)
|
||||
refute user.is_confirmed
|
||||
{:ok, user} = User.confirm(user)
|
||||
assert false == user.confirmation_pending
|
||||
assert user.is_confirmed
|
||||
end
|
||||
|
||||
test "confirms a list of users" do
|
||||
unconfirmed_users = [
|
||||
insert(:user, confirmation_pending: true),
|
||||
insert(:user, confirmation_pending: true),
|
||||
insert(:user, confirmation_pending: true)
|
||||
insert(:user, is_confirmed: false),
|
||||
insert(:user, is_confirmed: false),
|
||||
insert(:user, is_confirmed: false)
|
||||
]
|
||||
|
||||
{:ok, users} = User.confirm(unconfirmed_users)
|
||||
|
@ -1461,13 +1461,13 @@ test "confirms a list of users" do
|
|||
assert Enum.count(users) == 3
|
||||
|
||||
Enum.each(users, fn user ->
|
||||
assert false == user.confirmation_pending
|
||||
assert user.is_confirmed
|
||||
end)
|
||||
end
|
||||
|
||||
test "sends approval emails when `approval_pending: true`" do
|
||||
admin = insert(:user, is_admin: true)
|
||||
user = insert(:user, confirmation_pending: true, approval_pending: true)
|
||||
user = insert(:user, is_confirmed: false, approval_pending: true)
|
||||
User.confirm(user)
|
||||
|
||||
ObanHelpers.perform_all()
|
||||
|
@ -1494,7 +1494,7 @@ test "sends approval emails when `approval_pending: true`" do
|
|||
end
|
||||
|
||||
test "confirming a confirmed user does not trigger post-register actions" do
|
||||
user = insert(:user, confirmation_pending: false, approval_pending: true)
|
||||
user = insert(:user, is_confirmed: true, approval_pending: true)
|
||||
User.confirm(user)
|
||||
|
||||
ObanHelpers.perform_all()
|
||||
|
@ -1565,7 +1565,7 @@ test "it deactivates a user, all follow relationships and all activities", %{use
|
|||
|
||||
describe "delete/1 when confirmation is pending" do
|
||||
setup do
|
||||
user = insert(:user, confirmation_pending: true)
|
||||
user = insert(:user, is_confirmed: false)
|
||||
{:ok, user: user}
|
||||
end
|
||||
|
||||
|
@ -1616,7 +1616,7 @@ test "delete/1 purges a user when they wouldn't be fully deleted" do
|
|||
follower_count: 9,
|
||||
following_count: 9001,
|
||||
is_locked: true,
|
||||
confirmation_pending: true,
|
||||
is_confirmed: false,
|
||||
password_reset_pending: true,
|
||||
approval_pending: true,
|
||||
registration_reason: "ahhhhh",
|
||||
|
@ -1658,7 +1658,7 @@ test "delete/1 purges a user when they wouldn't be fully deleted" do
|
|||
follower_count: 0,
|
||||
following_count: 0,
|
||||
is_locked: false,
|
||||
confirmation_pending: false,
|
||||
is_confirmed: true,
|
||||
password_reset_pending: false,
|
||||
approval_pending: false,
|
||||
registration_reason: nil,
|
||||
|
@ -1729,13 +1729,13 @@ test "User.delete() plugs any possible zombie objects" do
|
|||
|
||||
test "return confirmation_pending for unconfirm user" do
|
||||
Pleroma.Config.put([:instance, :account_activation_required], true)
|
||||
user = insert(:user, confirmation_pending: true)
|
||||
user = insert(:user, is_confirmed: false)
|
||||
assert User.account_status(user) == :confirmation_pending
|
||||
end
|
||||
|
||||
test "return active for confirmed user" do
|
||||
Pleroma.Config.put([:instance, :account_activation_required], true)
|
||||
user = insert(:user, confirmation_pending: false)
|
||||
user = insert(:user, is_confirmed: true)
|
||||
assert User.account_status(user) == :active
|
||||
end
|
||||
|
||||
|
@ -1750,7 +1750,7 @@ test "returns :password_reset_pending for user with reset password" do
|
|||
end
|
||||
|
||||
test "returns :deactivated for deactivated user" do
|
||||
user = insert(:user, local: true, confirmation_pending: false, deactivated: true)
|
||||
user = insert(:user, local: true, is_confirmed: true, deactivated: true)
|
||||
assert User.account_status(user) == :deactivated
|
||||
end
|
||||
|
||||
|
@ -1758,7 +1758,7 @@ test "returns :approval_pending for unapproved user" do
|
|||
user = insert(:user, local: true, approval_pending: true)
|
||||
assert User.account_status(user) == :approval_pending
|
||||
|
||||
user = insert(:user, local: true, confirmation_pending: true, approval_pending: true)
|
||||
user = insert(:user, local: true, is_confirmed: false, approval_pending: true)
|
||||
assert User.account_status(user) == :approval_pending
|
||||
end
|
||||
end
|
||||
|
@ -1815,7 +1815,7 @@ test "returns true when the account is itself" do
|
|||
test "returns false when the account is unconfirmed and confirmation is required" do
|
||||
Pleroma.Config.put([:instance, :account_activation_required], true)
|
||||
|
||||
user = insert(:user, local: true, confirmation_pending: true)
|
||||
user = insert(:user, local: true, is_confirmed: false)
|
||||
other_user = insert(:user, local: true)
|
||||
|
||||
refute User.visible_for(user, other_user) == :visible
|
||||
|
@ -1824,14 +1824,14 @@ test "returns false when the account is unconfirmed and confirmation is required
|
|||
test "returns true when the account is unconfirmed and confirmation is required but the account is remote" do
|
||||
Pleroma.Config.put([:instance, :account_activation_required], true)
|
||||
|
||||
user = insert(:user, local: false, confirmation_pending: true)
|
||||
user = insert(:user, local: false, is_confirmed: false)
|
||||
other_user = insert(:user, local: true)
|
||||
|
||||
assert User.visible_for(user, other_user) == :visible
|
||||
end
|
||||
|
||||
test "returns true when the account is unconfirmed and confirmation is not required" do
|
||||
user = insert(:user, local: true, confirmation_pending: true)
|
||||
user = insert(:user, local: true, is_confirmed: false)
|
||||
other_user = insert(:user, local: true)
|
||||
|
||||
assert User.visible_for(user, other_user) == :visible
|
||||
|
@ -1840,7 +1840,7 @@ test "returns true when the account is unconfirmed and confirmation is not requi
|
|||
test "returns true when the account is unconfirmed and being viewed by a privileged account (confirmation required)" do
|
||||
Pleroma.Config.put([:instance, :account_activation_required], true)
|
||||
|
||||
user = insert(:user, local: true, confirmation_pending: true)
|
||||
user = insert(:user, local: true, is_confirmed: false)
|
||||
other_user = insert(:user, local: true, is_admin: true)
|
||||
|
||||
assert User.visible_for(user, other_user) == :visible
|
||||
|
|
|
@ -159,7 +159,7 @@ test "creates a notification", %{emoji_react: emoji_react, poster: poster} do
|
|||
|
||||
describe "delete users with confirmation pending" do
|
||||
setup do
|
||||
user = insert(:user, confirmation_pending: true)
|
||||
user = insert(:user, is_confirmed: false)
|
||||
{:ok, delete_user_data, _meta} = Builder.delete(user, user.ap_id)
|
||||
{:ok, delete_user, _meta} = ActivityPub.persist(delete_user_data, local: true)
|
||||
{:ok, delete: delete_user, user: user}
|
||||
|
|
|
@ -891,10 +891,10 @@ test "GET /instances/:instance/statuses", %{conn: conn} do
|
|||
|
||||
describe "PATCH /confirm_email" do
|
||||
test "it confirms emails of two users", %{conn: conn, admin: admin} do
|
||||
[first_user, second_user] = insert_pair(:user, confirmation_pending: true)
|
||||
[first_user, second_user] = insert_pair(:user, is_confirmed: false)
|
||||
|
||||
assert first_user.confirmation_pending == true
|
||||
assert second_user.confirmation_pending == true
|
||||
refute first_user.is_confirmed
|
||||
refute second_user.is_confirmed
|
||||
|
||||
ret_conn =
|
||||
patch(conn, "/api/pleroma/admin/users/confirm_email", %{
|
||||
|
@ -906,8 +906,11 @@ test "it confirms emails of two users", %{conn: conn, admin: admin} do
|
|||
|
||||
assert ret_conn.status == 200
|
||||
|
||||
assert first_user.confirmation_pending == true
|
||||
assert second_user.confirmation_pending == true
|
||||
first_user = User.get_by_id(first_user.id)
|
||||
second_user = User.get_by_id(second_user.id)
|
||||
|
||||
assert first_user.is_confirmed
|
||||
assert second_user.is_confirmed
|
||||
|
||||
log_entry = Repo.one(ModerationLog)
|
||||
|
||||
|
@ -920,7 +923,7 @@ test "it confirms emails of two users", %{conn: conn, admin: admin} do
|
|||
|
||||
describe "PATCH /resend_confirmation_email" do
|
||||
test "it resend emails for two users", %{conn: conn, admin: admin} do
|
||||
[first_user, second_user] = insert_pair(:user, confirmation_pending: true)
|
||||
[first_user, second_user] = insert_pair(:user, is_confirmed: false)
|
||||
|
||||
ret_conn =
|
||||
patch(conn, "/api/pleroma/admin/users/resend_confirmation_email", %{
|
||||
|
|
|
@ -48,7 +48,7 @@ test "shows activity", %{conn: conn} do
|
|||
assert account["id"] == actor.id
|
||||
assert account["nickname"] == actor.nickname
|
||||
assert account["deactivated"] == actor.deactivated
|
||||
assert account["confirmation_pending"] == actor.confirmation_pending
|
||||
assert account["is_confirmed"] == actor.is_confirmed
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -635,11 +635,11 @@ test "only local users with no query", %{conn: conn, admin: old_admin} do
|
|||
end
|
||||
|
||||
test "only unconfirmed users", %{conn: conn} do
|
||||
sad_user = insert(:user, nickname: "sadboy", confirmation_pending: true)
|
||||
old_user = insert(:user, nickname: "oldboy", confirmation_pending: true)
|
||||
sad_user = insert(:user, nickname: "sadboy", is_confirmed: false)
|
||||
old_user = insert(:user, nickname: "oldboy", is_confirmed: false)
|
||||
|
||||
insert(:user, nickname: "happyboy", approval_pending: false)
|
||||
insert(:user, confirmation_pending: false)
|
||||
insert(:user, is_confirmed: true)
|
||||
|
||||
result =
|
||||
conn
|
||||
|
@ -649,7 +649,7 @@ test "only unconfirmed users", %{conn: conn} do
|
|||
users =
|
||||
Enum.map([old_user, sad_user], fn user ->
|
||||
user_response(user, %{
|
||||
"confirmation_pending" => true,
|
||||
"is_confirmed" => false,
|
||||
"approval_pending" => false
|
||||
})
|
||||
end)
|
||||
|
@ -960,7 +960,7 @@ defp user_response(user, attrs \\ %{}) do
|
|||
"tags" => [],
|
||||
"avatar" => User.avatar_url(user) |> MediaProxy.url(),
|
||||
"display_name" => HTML.strip_tags(user.name || user.nickname),
|
||||
"confirmation_pending" => false,
|
||||
"is_confirmed" => true,
|
||||
"approval_pending" => false,
|
||||
"url" => user.ap_id,
|
||||
"registration_reason" => nil,
|
||||
|
|
|
@ -193,7 +193,7 @@ test "it returns unapproved user" do
|
|||
end
|
||||
|
||||
test "it returns unconfirmed user" do
|
||||
unconfirmed = insert(:user, confirmation_pending: true)
|
||||
unconfirmed = insert(:user, is_confirmed: false)
|
||||
insert(:user)
|
||||
insert(:user)
|
||||
|
||||
|
|
|
@ -1027,7 +1027,7 @@ test "registers and logs in without :account_activation_required / :account_appr
|
|||
user = Repo.preload(token_from_db, :user).user
|
||||
|
||||
assert user
|
||||
refute user.confirmation_pending
|
||||
assert user.is_confirmed
|
||||
refute user.approval_pending
|
||||
end
|
||||
|
||||
|
@ -1088,7 +1088,7 @@ test "registers but does not log in with :account_activation_required", %{conn:
|
|||
refute response["token_type"]
|
||||
|
||||
user = Repo.get_by(User, email: "lain@example.org")
|
||||
assert user.confirmation_pending
|
||||
refute user.is_confirmed
|
||||
end
|
||||
|
||||
test "registers but does not log in with :account_approval_required", %{conn: conn} do
|
||||
|
|
|
@ -79,7 +79,7 @@ test "Represent a user account" do
|
|||
also_known_as: ["https://shitposter.zone/users/shp"],
|
||||
background_image: "https://example.com/images/asuka_hospital.png",
|
||||
favicon: nil,
|
||||
confirmation_pending: false,
|
||||
is_confirmed: true,
|
||||
tags: [],
|
||||
is_admin: false,
|
||||
is_moderator: false,
|
||||
|
@ -178,7 +178,7 @@ test "Represent a Service(bot) account" do
|
|||
also_known_as: [],
|
||||
background_image: nil,
|
||||
favicon: nil,
|
||||
confirmation_pending: false,
|
||||
is_confirmed: true,
|
||||
tags: [],
|
||||
is_admin: false,
|
||||
is_moderator: false,
|
||||
|
|
|
@ -928,7 +928,7 @@ test "rejects token exchange for valid credentials belonging to unconfirmed user
|
|||
|
||||
{:ok, user} =
|
||||
insert(:user, password_hash: Pleroma.Password.Pbkdf2.hash_pwd_salt(password))
|
||||
|> User.confirmation_changeset(need_confirmation: true)
|
||||
|> User.confirmation_changeset(set_confirmation: false)
|
||||
|> User.update_and_set_cache()
|
||||
|
||||
refute Pleroma.User.account_status(user) == :active
|
||||
|
@ -1013,7 +1013,7 @@ test "rejects token exchange for user with confirmation_pending set to true" do
|
|||
user =
|
||||
insert(:user,
|
||||
password_hash: Pleroma.Password.Pbkdf2.hash_pwd_salt(password),
|
||||
confirmation_pending: true
|
||||
is_confirmed: false
|
||||
)
|
||||
|
||||
app = insert(:oauth_app, scopes: ["read", "write"])
|
||||
|
|
|
@ -17,10 +17,10 @@ defmodule Pleroma.Web.PleromaAPI.AccountControllerTest do
|
|||
setup do
|
||||
{:ok, user} =
|
||||
insert(:user)
|
||||
|> User.confirmation_changeset(need_confirmation: true)
|
||||
|> User.confirmation_changeset(set_confirmation: false)
|
||||
|> User.update_and_set_cache()
|
||||
|
||||
assert user.confirmation_pending
|
||||
refute user.is_confirmed
|
||||
|
||||
[user: user]
|
||||
end
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue