X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fuser.ex;h=1f930479d7aa718b948e8f5eed931b6d7db1cc3f;hb=2791ce9a1ff2365ac7256f5e1dc2324dee2f82c9;hp=7e3a342f137e24cbcc0d74da557da1f75bec9392;hpb=501ce34d7fbb74f91e8afcaa491625c5a0152597;p=akkoma diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index 7e3a342f1..1f930479d 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -1,3 +1,7 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2018 Pleroma Authors +# SPDX-License-Identifier: AGPL-3.0-only + defmodule Pleroma.User do use Ecto.Schema @@ -38,7 +42,10 @@ defmodule Pleroma.User do timestamps() end - def auth_active?(%User{} = user), do: user.info && !user.info.confirmation_pending + def auth_active?(%User{} = user) do + (user.info && !user.info.confirmation_pending) || + !Pleroma.Config.get([:instance, :account_activation_required]) + end def superuser?(%User{} = user), do: user.info && User.Info.superuser?(user.info) @@ -220,7 +227,8 @@ defmodule Pleroma.User do end def try_send_confirmation_email(%User{} = user) do - if user.info.confirmation_pending do + if user.info.confirmation_pending && + Pleroma.Config.get([:instance, :account_activation_required]) do user |> Pleroma.UserEmail.account_confirmation_email() |> Pleroma.Mailer.deliver() @@ -396,10 +404,6 @@ defmodule Pleroma.User do end end - def get_by_confirmation_token(token) do - Repo.one(from(u in User, where: fragment("? ->> 'confirmation_token' = ?", u.info, ^token))) - end - def get_followers_query(%User{id: id, follower_address: follower_address}) do from( u in User,