From 805bbc8a33712a6237252f3ac4744a5e8a38eaf7 Mon Sep 17 00:00:00 2001 From: evazion Date: Sun, 27 Dec 2020 23:55:25 -0600 Subject: [PATCH] users: add config option to disable verification of new accounts. Fixes #4618. --- app/logical/user_verifier.rb | 1 + config/danbooru_default_config.rb | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/app/logical/user_verifier.rb b/app/logical/user_verifier.rb index e225924ae..df0d43c93 100644 --- a/app/logical/user_verifier.rb +++ b/app/logical/user_verifier.rb @@ -9,6 +9,7 @@ class UserVerifier end def requires_verification? + return false if !Danbooru.config.new_user_verification? return false if is_local_ip? # we check for IP bans first to make sure we bump the IP ban hit count diff --git a/config/danbooru_default_config.rb b/config/danbooru_default_config.rb index 08f6c29ee..947dc75c1 100644 --- a/config/danbooru_default_config.rb +++ b/config/danbooru_default_config.rb @@ -69,6 +69,19 @@ module Danbooru "#{source_code_url}/issues" end + # If true, new accounts will require email verification if they seem + # suspicious (they were created using a proxy, multiple accounts were + # created by the same IP, etc). + # + # This doesn't apply to personal or development installs running on + # localhost or the local network. + # + # Disable this if you're running a public booru and you don't want email + # verification for new accounts. + def new_user_verification? + true + end + # An array of regexes containing disallowed usernames. def user_name_blacklist []