diff --git a/app/controllers/accounts_controller.rb b/app/controllers/accounts_controller.rb index dfbe5bffcf3967f2e3b8b72e687ed9b4def7b3ec..a3410c1efec3cb712aeb4ab76ffa499facc7bbdd 100644 --- a/app/controllers/accounts_controller.rb +++ b/app/controllers/accounts_controller.rb @@ -89,8 +89,8 @@ class AccountsController < ApplicationController end end - def set_account - @account = Account.find_local!(params[:username]) + def username_param + params[:username] end def older_url diff --git a/app/controllers/admin/accounts_controller.rb b/app/controllers/admin/accounts_controller.rb index 562fba9960dd21d8e9ceeb7cee72302a847bf8a7..e160c603a82c973f8a349f045a04964c2464bffa 100644 --- a/app/controllers/admin/accounts_controller.rb +++ b/app/controllers/admin/accounts_controller.rb @@ -2,9 +2,9 @@ module Admin class AccountsController < BaseController - before_action :set_account, only: [:show, :subscribe, :unsubscribe, :redownload, :remove_avatar, :remove_header, :enable, :unsilence, :unsuspend, :memorialize] + before_action :set_account, only: [:show, :subscribe, :unsubscribe, :redownload, :remove_avatar, :remove_header, :enable, :unsilence, :unsuspend, :memorialize, :approve, :reject] before_action :require_remote_account!, only: [:subscribe, :unsubscribe, :redownload] - before_action :require_local_account!, only: [:enable, :memorialize] + before_action :require_local_account!, only: [:enable, :memorialize, :approve, :reject] def index authorize :account, :index? @@ -45,6 +45,18 @@ module Admin redirect_to admin_account_path(@account.id) end + def approve + authorize @account.user, :approve? + @account.user.approve! + redirect_to admin_accounts_path(pending: '1') + end + + def reject + authorize @account.user, :reject? + SuspendAccountService.new.call(@account, including_user: true, destroy: true) + redirect_to admin_accounts_path(pending: '1') + end + def unsilence authorize @account, :unsilence? @account.unsilence! @@ -114,6 +126,7 @@ module Admin :remote, :by_domain, :active, + :pending, :silenced, :suspended, :username, diff --git a/app/controllers/admin/dashboard_controller.rb b/app/controllers/admin/dashboard_controller.rb index bb923c18594c78fee477a00eee9238466e715a4e..22bbcec19e7829c14bd8ce23376aab6b4a501678 100644 --- a/app/controllers/admin/dashboard_controller.rb +++ b/app/controllers/admin/dashboard_controller.rb @@ -10,7 +10,7 @@ module Admin @interactions_week = Redis.current.get("activity:interactions:#{current_week}") || 0 @relay_enabled = Relay.enabled.exists? @single_user_mode = Rails.configuration.x.single_user_mode - @registrations_enabled = Setting.open_registrations + @registrations_enabled = Setting.registrations_mode != 'none' @deletions_enabled = Setting.open_deletion @invites_enabled = Setting.min_invite_role == 'user' @search_enabled = Chewy.enabled? diff --git a/app/controllers/admin/settings_controller.rb b/app/controllers/admin/settings_controller.rb index 4a049fc235638a649dad3f4045e6c2a521f36b84..a763597f20ede0eba90e7fc3f209c6e23ac92850 100644 --- a/app/controllers/admin/settings_controller.rb +++ b/app/controllers/admin/settings_controller.rb @@ -10,7 +10,7 @@ module Admin site_description site_extended_description site_terms - open_registrations + registrations_mode closed_registrations_message open_deletion timeline_preview @@ -30,7 +30,6 @@ module Admin ).freeze BOOLEAN_SETTINGS = %w( - open_registrations open_deletion timeline_preview show_staff_badge diff --git a/app/controllers/api/base_controller.rb b/app/controllers/api/base_controller.rb index a1dd30918f34550758f1b5c3d7d38c1bfd0a1b8d..3a92ee4e4d7a6ebaa57a2f43178541151b86bc6b 100644 --- a/app/controllers/api/base_controller.rb +++ b/app/controllers/api/base_controller.rb @@ -73,7 +73,9 @@ class Api::BaseController < ApplicationController elsif current_user.disabled? render json: { error: 'Your login is currently disabled' }, status: 403 elsif !current_user.confirmed? - render json: { error: 'Email confirmation is not completed' }, status: 403 + render json: { error: 'Your login is missing a confirmed e-mail address' }, status: 403 + elsif !current_user.approved? + render json: { error: 'Your login is currently pending approval' }, status: 403 else set_user_activity end diff --git a/app/controllers/api/v1/accounts_controller.rb b/app/controllers/api/v1/accounts_controller.rb index 2ccbc3cbbdf50e1d64cd6292a3bdb133b29759c5..b0c62778e6563abe7894ff52e9493a1a377a89ab 100644 --- a/app/controllers/api/v1/accounts_controller.rb +++ b/app/controllers/api/v1/accounts_controller.rb @@ -80,6 +80,10 @@ class Api::V1::AccountsController < Api::BaseController end def check_enabled_registrations - forbidden if single_user_mode? || !Setting.open_registrations + forbidden if single_user_mode? || !allowed_registrations? + end + + def allowed_registrations? + Setting.registrations_mode != 'none' end end diff --git a/app/controllers/auth/registrations_controller.rb b/app/controllers/auth/registrations_controller.rb index ad7b1859f682476826100adec33ac552c89ab8dc..16a3ec67adf95fbc445cce7e709e381340cfb8fb 100644 --- a/app/controllers/auth/registrations_controller.rb +++ b/app/controllers/auth/registrations_controller.rb @@ -65,7 +65,7 @@ class Auth::RegistrationsController < Devise::RegistrationsController end def allowed_registrations? - Setting.open_registrations || @invite&.valid_for_use? + Setting.registrations_mode != 'none' || @invite&.valid_for_use? end def invite_code diff --git a/app/controllers/concerns/account_controller_concern.rb b/app/controllers/concerns/account_controller_concern.rb index 6c27ef330b90b8a40499d1a84ba5edb4373f82ed..8817fd7de4616dce601f89d2138c07a35f74c256 100644 --- a/app/controllers/concerns/account_controller_concern.rb +++ b/app/controllers/concerns/account_controller_concern.rb @@ -7,16 +7,18 @@ module AccountControllerConcern included do layout 'public' + before_action :set_account + before_action :check_account_approval + before_action :check_account_suspension before_action :set_instance_presenter before_action :set_link_headers - before_action :check_account_suspension end private def set_account - @account = Account.find_local!(params[:account_username]) + @account = Account.find_local!(username_param) end def set_instance_presenter @@ -33,6 +35,10 @@ module AccountControllerConcern ) end + def username_param + params[:account_username] + end + def webfinger_account_link [ webfinger_account_url, @@ -58,6 +64,10 @@ module AccountControllerConcern webfinger_url(resource: @account.to_webfinger_s) end + def check_account_approval + not_found if @account.user_pending? + end + def check_account_suspension gone if @account.suspended? end diff --git a/app/helpers/admin/filter_helper.rb b/app/helpers/admin/filter_helper.rb index 275b5f2fe0ddeddfa79544175440443704ee4cb0..8f78bf5f846de0acb5ff92095a7260a5f1dc8324 100644 --- a/app/helpers/admin/filter_helper.rb +++ b/app/helpers/admin/filter_helper.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Admin::FilterHelper - ACCOUNT_FILTERS = %i(local remote by_domain active silenced suspended username display_name email ip staff).freeze + ACCOUNT_FILTERS = %i(local remote by_domain active pending silenced suspended username display_name email ip staff).freeze REPORT_FILTERS = %i(resolved account_id target_account_id).freeze INVITE_FILTER = %i(available expired).freeze CUSTOM_EMOJI_FILTERS = %i(local remote by_domain shortcode).freeze diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 5097a0953e84bf1a5d966ccb08ec96d7293588f1..b42b1bbdf76c6f1d5739feffa4fa812c4f7d4cfe 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -20,7 +20,23 @@ module ApplicationHelper end def open_registrations? - Setting.open_registrations + Setting.registrations_mode == 'open' + end + + def approved_registrations? + Setting.registrations_mode == 'approved' + end + + def closed_registrations? + Setting.registrations_mode == 'none' + end + + def available_sign_up_path + if closed_registrations? + 'https://joinmastodon.org/#getting-started' + else + new_user_registration_path + end end def open_deletion? diff --git a/app/helpers/home_helper.rb b/app/helpers/home_helper.rb index 1f648649fe349ddafe217ea13a74ea70d6a036ac..df60b7dd7ac32e8c6dc373644d0556ee90d7a336 100644 --- a/app/helpers/home_helper.rb +++ b/app/helpers/home_helper.rb @@ -64,4 +64,14 @@ module HomeHelper content_tag(:div, &block) end end + + def sign_up_message + if closed_registrations? + t('auth.registration_closed', instance: site_hostname) + elsif open_registrations? + t('auth.register') + elsif approved_registrations? + t('auth.apply_for_account') + end + end end diff --git a/app/javascript/styles/mastodon/admin.scss b/app/javascript/styles/mastodon/admin.scss index 6d785707c975b4b2631492eca86afb9bbda754da..f6bfe44cf8f19fd9db6cc5463078fa66b90e07d2 100644 --- a/app/javascript/styles/mastodon/admin.scss +++ b/app/javascript/styles/mastodon/admin.scss @@ -689,3 +689,11 @@ a.name-tag, overflow: hidden; text-overflow: ellipsis; } + +.ellipsized-ip { + display: inline-block; + max-width: 120px; + overflow: hidden; + text-overflow: ellipsis; + vertical-align: middle; +} diff --git a/app/mailers/admin_mailer.rb b/app/mailers/admin_mailer.rb index a30468eb8b5778033359db79360fe84b5713d1ba..ecbbe745b49163eaf6819f4053b218e03f6ec63e 100644 --- a/app/mailers/admin_mailer.rb +++ b/app/mailers/admin_mailer.rb @@ -14,4 +14,14 @@ class AdminMailer < ApplicationMailer mail to: @me.user_email, subject: I18n.t('admin_mailer.new_report.subject', instance: @instance, id: @report.id) end end + + def new_pending_account(recipient, account) + @account = account + @me = recipient + @instance = Rails.configuration.x.local_domain + + locale_for_account(@me) do + mail to: @me.user_email, subject: I18n.t('admin_mailer.new_pending_account.subject', instance: @instance, username: @account.username) + end + end end diff --git a/app/models/account.rb b/app/models/account.rb index d6d718354b8cfdaa2c35517f7dc9a1334cd9cdef..c2a0709f99bb323387533c880cbf7a6468bd0115 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -104,6 +104,8 @@ class Account < ApplicationRecord :current_sign_in_ip, :current_sign_in_at, :confirmed?, + :approved?, + :pending?, :admin?, :moderator?, :staff?, diff --git a/app/models/account_filter.rb b/app/models/account_filter.rb index b10f50db778b100e1aa477dcd6ac8ad01c7b4a7e..d2503100cfc187bfb58414d991729d114df3f6d7 100644 --- a/app/models/account_filter.rb +++ b/app/models/account_filter.rb @@ -22,7 +22,7 @@ class AccountFilter def set_defaults! params['local'] = '1' if params['remote'].blank? - params['active'] = '1' if params['suspended'].blank? && params['silenced'].blank? + params['active'] = '1' if params['suspended'].blank? && params['silenced'].blank? && params['pending'].blank? end def scope_for(key, value) @@ -35,6 +35,8 @@ class AccountFilter Account.where(domain: value) when 'active' Account.without_suspended + when 'pending' + accounts_with_users.merge User.pending when 'silenced' Account.silenced when 'suspended' diff --git a/app/models/form/admin_settings.rb b/app/models/form/admin_settings.rb index eca71bf6214f466efb2782c5b12a04fd19a985f0..a21394a52a81a78aec2420d26d785ad6cef98c5a 100644 --- a/app/models/form/admin_settings.rb +++ b/app/models/form/admin_settings.rb @@ -18,8 +18,8 @@ class Form::AdminSettings :site_extended_description=, :site_terms, :site_terms=, - :open_registrations, - :open_registrations=, + :registrations_mode, + :registrations_mode=, :closed_registrations_message, :closed_registrations_message=, :open_deletion, diff --git a/app/models/user.rb b/app/models/user.rb index a9d6adf706b1f9939c94215ff0d12654696a22ad..9d0d49676bead52ba6ef0fc14cc6157c7dd5fd80 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -37,6 +37,7 @@ # remember_token :string # chosen_languages :string is an Array # created_by_application_id :bigint(8) +# approved :boolean default(TRUE), not null # class User < ApplicationRecord @@ -79,6 +80,8 @@ class User < ApplicationRecord validates :agreement, acceptance: { allow_nil: false, accept: [true, 'true', '1'] }, on: :create scope :recent, -> { order(id: :desc) } + scope :pending, -> { where(approved: false) } + scope :approved, -> { where(approved: true) } scope :confirmed, -> { where.not(confirmed_at: nil) } scope :enabled, -> { where(disabled: false) } scope :inactive, -> { where(arel_table[:current_sign_in_at].lt(ACTIVE_DURATION.ago)) } @@ -87,6 +90,7 @@ class User < ApplicationRecord scope :emailable, -> { confirmed.enabled.joins(:account).merge(Account.searchable) } before_validation :sanitize_languages + before_create :set_approved # This avoids a deprecation warning from Rails 5.1 # It seems possible that a future release of devise-two-factor will @@ -124,7 +128,11 @@ class User < ApplicationRecord super - prepare_new_user! if new_user + if new_user && approved? + prepare_new_user! + elsif new_user + notify_staff_about_pending_account! + end end def confirm! @@ -133,7 +141,26 @@ class User < ApplicationRecord skip_confirmation! save! - prepare_new_user! if new_user + prepare_new_user! if new_user && approved? + end + + def pending? + !approved? + end + + def active_for_authentication? + super && approved? + end + + def inactive_message + !approved? ? :pending : super + end + + def approve! + return if approved? + + update!(approved: true) + prepare_new_user! end def update_tracked_fields!(request) @@ -236,6 +263,10 @@ class User < ApplicationRecord private + def set_approved + self.approved = Setting.registrations_mode == 'open' || invited? + end + def sanitize_languages return if chosen_languages.nil? chosen_languages.reject!(&:blank?) @@ -253,6 +284,13 @@ class User < ApplicationRecord regenerate_feed! if needs_feed_update? end + def notify_staff_about_pending_account! + User.staff.includes(:account).each do |u| + next unless u.allows_report_emails? + AdminMailer.new_pending_account(u.account, self).deliver_later + end + end + def regenerate_feed! return unless Redis.current.setnx("account:#{account_id}:regeneration", true) Redis.current.expire("account:#{account_id}:regeneration", 1.day.seconds) diff --git a/app/policies/user_policy.rb b/app/policies/user_policy.rb index 57af5c61c86b32b7cd32aacdcbde5462de9d4145..d832bff75d4daaea2544b59b45596b7b2a6c0b49 100644 --- a/app/policies/user_policy.rb +++ b/app/policies/user_policy.rb @@ -21,6 +21,14 @@ class UserPolicy < ApplicationPolicy staff? end + def approve? + staff? && !record.approved? + end + + def reject? + staff? && !record.approved? + end + def disable? staff? && !record.admin? end @@ -36,7 +44,7 @@ class UserPolicy < ApplicationPolicy private def promoteable? - !record.staff? || !record.admin? + record.approved? && (!record.staff? || !record.admin?) end def demoteable? diff --git a/app/presenters/instance_presenter.rb b/app/presenters/instance_presenter.rb index cb6005e2153b197b4ffe400ccfddbf1320432e23..941c5e6b21dcef882b848f5b33368beaf69575a1 100644 --- a/app/presenters/instance_presenter.rb +++ b/app/presenters/instance_presenter.rb @@ -2,9 +2,7 @@ class InstancePresenter delegate( - :closed_registrations_message, :site_contact_email, - :open_registrations, :site_title, :site_short_description, :site_description, diff --git a/app/serializers/rest/instance_serializer.rb b/app/serializers/rest/instance_serializer.rb index 216808ffb9c7f5a278eec17e00666482d565ddf4..f6be9dbe8eaab9698b20651b1a5ce5e31b503188 100644 --- a/app/serializers/rest/instance_serializer.rb +++ b/app/serializers/rest/instance_serializer.rb @@ -52,7 +52,7 @@ class REST::InstanceSerializer < ActiveModel::Serializer end def registrations - Setting.open_registrations && !Rails.configuration.x.single_user_mode + Setting.registrations_mode != 'none' && !Rails.configuration.x.single_user_mode end private diff --git a/app/services/app_sign_up_service.rb b/app/services/app_sign_up_service.rb index d621cc462c6460af70157690c1524cb42a0f2735..6dee9cd81568eb1b208183e70a90df3a66701954 100644 --- a/app/services/app_sign_up_service.rb +++ b/app/services/app_sign_up_service.rb @@ -18,6 +18,6 @@ class AppSignUpService < BaseService private def allowed_registrations? - Setting.open_registrations && !Rails.configuration.x.single_user_mode + Setting.registrations_mode != 'none' && !Rails.configuration.x.single_user_mode end end diff --git a/app/views/about/_registration.html.haml b/app/views/about/_registration.html.haml index 715bcd37c670325614aed5e6268bb8fe39d98f5b..9cb4eb2bc31023fc056d1966576d1fb4648c247c 100644 --- a/app/views/about/_registration.html.haml +++ b/app/views/about/_registration.html.haml @@ -3,14 +3,14 @@ .fields-group = f.simple_fields_for :account do |account_fields| - = account_fields.input :username, wrapper: :with_label, autofocus: true, label: false, required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.username'), :autocomplete => 'off', placeholder: t('simple_form.labels.defaults.username') }, append: "@#{site_hostname}", hint: false, disabled: !Setting.open_registrations + = account_fields.input :username, wrapper: :with_label, autofocus: true, label: false, required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.username'), :autocomplete => 'off', placeholder: t('simple_form.labels.defaults.username') }, append: "@#{site_hostname}", hint: false, disabled: closed_registrations? - = f.input :email, placeholder: t('simple_form.labels.defaults.email'), required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.email'), :autocomplete => 'off' }, hint: false, disabled: !Setting.open_registrations - = f.input :password, placeholder: t('simple_form.labels.defaults.password'), required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.password'), :autocomplete => 'off' }, hint: false, disabled: !Setting.open_registrations - = f.input :password_confirmation, placeholder: t('simple_form.labels.defaults.confirm_password'), required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.confirm_password'), :autocomplete => 'off' }, hint: false, disabled: !Setting.open_registrations + = f.input :email, placeholder: t('simple_form.labels.defaults.email'), required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.email'), :autocomplete => 'off' }, hint: false, disabled: closed_registrations? + = f.input :password, placeholder: t('simple_form.labels.defaults.password'), required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.password'), :autocomplete => 'off' }, hint: false, disabled: closed_registrations? + = f.input :password_confirmation, placeholder: t('simple_form.labels.defaults.confirm_password'), required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.confirm_password'), :autocomplete => 'off' }, hint: false, disabled: closed_registrations? .fields-group - = f.input :agreement, as: :boolean, wrapper: :with_label, label: t('auth.checkbox_agreement_html', rules_path: about_more_path, terms_path: terms_path), disabled: !Setting.open_registrations + = f.input :agreement, as: :boolean, wrapper: :with_label, label: t('auth.checkbox_agreement_html', rules_path: about_more_path, terms_path: terms_path), disabled: closed_registrations? .actions - = f.button :button, Setting.open_registrations ? t('auth.register') : t('auth.registration_closed', instance: site_hostname), type: :submit, class: 'button button-primary', disabled: !Setting.open_registrations + = f.button :button, sign_up_message, type: :submit, class: 'button button-primary', disabled: closed_registrations? diff --git a/app/views/admin/accounts/_account.html.haml b/app/views/admin/accounts/_account.html.haml index 1e1bb1812b0436666a3534444ce8aa8aa291d209..eba3ad804123bbd56363a8e980473aec022b811f 100644 --- a/app/views/admin/accounts/_account.html.haml +++ b/app/views/admin/accounts/_account.html.haml @@ -5,7 +5,7 @@ %div{ style: 'margin: -2px 0' }= account_badge(account, all: true) %td - if account.user_current_sign_in_ip - %samp= account.user_current_sign_in_ip + %samp.ellipsized-ip{ title: account.user_current_sign_in_ip }= account.user_current_sign_in_ip - else \- %td @@ -14,5 +14,9 @@ - else \- %td - = table_link_to 'circle', t('admin.accounts.web'), web_path("accounts/#{account.id}") - = table_link_to 'globe', t('admin.accounts.public'), TagManager.instance.url_for(account) + - if account.local? && account.user_pending? + = table_link_to 'check', t('admin.accounts.approve'), approve_admin_account_path(account.id), method: :post, data: { confirm: t('admin.accounts.are_you_sure') } if can?(:approve, account.user) + = table_link_to 'times', t('admin.accounts.reject'), reject_admin_account_path(account.id), method: :post, data: { confirm: t('admin.accounts.are_you_sure') } if can?(:reject, account.user) + - else + = table_link_to 'circle', t('admin.accounts.web'), web_path("accounts/#{account.id}") + = table_link_to 'globe', t('admin.accounts.public'), TagManager.instance.url_for(account) diff --git a/app/views/admin/accounts/index.html.haml b/app/views/admin/accounts/index.html.haml index 345f74f9099902b6bc4b2051cde5cd0fae7662a5..66808add7cd12260af7097a01e998a711aa919a0 100644 --- a/app/views/admin/accounts/index.html.haml +++ b/app/views/admin/accounts/index.html.haml @@ -10,9 +10,10 @@ .filter-subset %strong= t('admin.accounts.moderation.title') %ul - %li= filter_link_to t('admin.accounts.moderation.active'), silenced: nil, suspended: nil - %li= filter_link_to t('admin.accounts.moderation.silenced'), silenced: '1', suspended: nil - %li= filter_link_to t('admin.accounts.moderation.suspended'), suspended: '1', silenced: nil + %li= filter_link_to t('admin.accounts.moderation.pending'), pending: '1', silenced: nil, suspended: nil + %li= filter_link_to t('admin.accounts.moderation.active'), silenced: nil, suspended: nil, pending: nil + %li= filter_link_to t('admin.accounts.moderation.silenced'), silenced: '1', suspended: nil, pending: nil + %li= filter_link_to t('admin.accounts.moderation.suspended'), suspended: '1', silenced: nil, pending: nil .filter-subset %strong= t('admin.accounts.role') %ul diff --git a/app/views/admin/accounts/show.html.haml b/app/views/admin/accounts/show.html.haml index 7ac73bd072542396f264495a4f02c42f34f0de97..7494c9fa2fd6d3a3be53f6e066e1583311f70054 100644 --- a/app/views/admin/accounts/show.html.haml +++ b/app/views/admin/accounts/show.html.haml @@ -37,6 +37,8 @@ %span.red= t('admin.accounts.disabled') - elsif @account.local? && !@account.user&.confirmed? %span.neutral= t('admin.accounts.confirming') + - elsif @account.local? && !@account.user_approved? + %span.neutral= t('admin.accounts.pending') - else %span.neutral= t('admin.accounts.no_limits_imposed') .dashboard__counters__label= t 'admin.accounts.login_status' @@ -95,7 +97,7 @@ %td - if @account.user&.disabled? = table_link_to 'unlock', t('admin.accounts.enable'), enable_admin_account_path(@account.id), method: :post if can?(:enable, @account.user) - - else + - elsif @account.user_approved? = table_link_to 'lock', t('admin.accounts.disable'), new_admin_account_action_path(@account.id, type: 'disable') if can?(:disable, @account.user) %tr @@ -144,26 +146,30 @@ = link_to t('admin.accounts.reset_password'), admin_account_reset_path(@account.id), method: :create, class: 'button' if can?(:reset_password, @account.user) - if @account.user&.otp_required_for_login? = link_to t('admin.accounts.disable_two_factor_authentication'), admin_user_two_factor_authentication_path(@account.user.id), method: :delete, class: 'button' if can?(:disable_2fa, @account.user) - - unless @account.memorial? + - if !@account.memorial? && @account.user_approved? = link_to t('admin.accounts.memorialize'), memorialize_admin_account_path(@account.id), method: :post, data: { confirm: t('admin.accounts.are_you_sure') }, class: 'button button--destructive' if can?(:memorialize, @account) - else = link_to t('admin.accounts.redownload'), redownload_admin_account_path(@account.id), method: :post, class: 'button' if can?(:redownload, @account) %div{ style: 'float: left' } - - if @account.local? + - if @account.local? && @account.user_approved? = link_to t('admin.accounts.warn'), new_admin_account_action_path(@account.id, type: 'none'), class: 'button' if can?(:warn, @account) - if @account.silenced? = link_to t('admin.accounts.undo_silenced'), unsilence_admin_account_path(@account.id), method: :post, class: 'button' if can?(:unsilence, @account) - - else + - elsif !@account.local? || @account.user_approved? = link_to t('admin.accounts.silence'), new_admin_account_action_path(@account.id, type: 'silence'), class: 'button button--destructive' if can?(:silence, @account) - if @account.local? + - if @account.user_pending? + = link_to t('admin.accounts.approve'), approve_admin_account_path(@account.id), method: :post, data: { confirm: t('admin.accounts.are_you_sure') }, class: 'button' if can?(:approve, @account.user) + = link_to t('admin.accounts.reject'), reject_admin_account_path(@account.id), method: :post, data: { confirm: t('admin.accounts.are_you_sure') }, class: 'button button--destructive' if can?(:reject, @account.user) + - unless @account.user_confirmed? = link_to t('admin.accounts.confirm'), admin_account_confirmation_path(@account.id), method: :post, class: 'button' if can?(:confirm, @account.user) - if @account.suspended? = link_to t('admin.accounts.undo_suspension'), unsuspend_admin_account_path(@account.id), method: :post, class: 'button' if can?(:unsuspend, @account) - - else + - elsif !@account.local? || @account.user_approved? = link_to t('admin.accounts.perform_full_suspension'), new_admin_account_action_path(@account.id, type: 'suspend'), class: 'button button--destructive' if can?(:suspend, @account) - unless @account.local? diff --git a/app/views/admin/settings/edit.html.haml b/app/views/admin/settings/edit.html.haml index 7afa9ec3718df12ab521d70a448aeb0067595b01..d9b4bf01b85f021956821fe637e957fc49b4e546 100644 --- a/app/views/admin/settings/edit.html.haml +++ b/app/views/admin/settings/edit.html.haml @@ -6,8 +6,11 @@ .fields-group = f.input :site_title, wrapper: :with_label, label: t('admin.settings.site_title') - .fields-group - = f.input :theme, collection: Themes.instance.names, label_method: lambda { |theme| I18n.t("themes.#{theme}", default: theme) }, wrapper: :with_label, include_blank: false + .fields-row + .fields-row__column.fields-row__column-6.fields-group + = f.input :theme, collection: Themes.instance.names, label_method: lambda { |theme| I18n.t("themes.#{theme}", default: theme) }, wrapper: :with_label, include_blank: false + .fields-row__column.fields-row__column-6.fields-group + = f.input :registrations_mode, collection: %w(open approved none), wrapper: :with_label, label: t('admin.settings.registrations_mode.title'), include_blank: false, label_method: lambda { |mode| I18n.t("admin.settings.registrations_mode.modes.#{mode}") } .fields-row .fields-row__column.fields-row__column-6.fields-group @@ -47,9 +50,6 @@ .fields-group = f.input :show_staff_badge, as: :boolean, wrapper: :with_label, label: t('admin.settings.show_staff_badge.title'), hint: t('admin.settings.show_staff_badge.desc_html') - .fields-group - = f.input :open_registrations, as: :boolean, wrapper: :with_label, label: t('admin.settings.registrations.open.title'), hint: t('admin.settings.registrations.open.desc_html') - .fields-group = f.input :open_deletion, as: :boolean, wrapper: :with_label, label: t('admin.settings.registrations.deletion.title'), hint: t('admin.settings.registrations.deletion.desc_html') diff --git a/app/views/admin_mailer/new_pending_account.text.erb b/app/views/admin_mailer/new_pending_account.text.erb new file mode 100644 index 0000000000000000000000000000000000000000..ed31ae2eb75b9cba604b03315f402c621bec3d48 --- /dev/null +++ b/app/views/admin_mailer/new_pending_account.text.erb @@ -0,0 +1,8 @@ +<%= raw t('application_mailer.salutation', name: display_name(@me)) %> + +<%= raw t('admin_mailer.new_pending_account.body') %> + +<%= raw t('admin.accounts.email') %>: <%= @account.user_email %> +<%= raw t('admin.accounts.most_recent_ip') %>: <%= @account.user_current_sign_in_ip %> + +<%= raw t('application_mailer.view')%> <%= admin_account_url(@account.id) %> diff --git a/app/views/auth/registrations/new.html.haml b/app/views/auth/registrations/new.html.haml index 72ce8e531fc322789a52f3b2dcd1343e83ea9cb0..1caf2b40164a877fc5bac5c555aca6b0bc2f15f9 100644 --- a/app/views/auth/registrations/new.html.haml +++ b/app/views/auth/registrations/new.html.haml @@ -29,6 +29,6 @@ %p.hint= t('auth.agreement_html', rules_path: about_more_path, terms_path: terms_path) .actions - = f.button :button, t('auth.register'), type: :submit + = f.button :button, sign_up_message, type: :submit .form-footer= render 'auth/shared/links' diff --git a/app/views/auth/shared/_links.html.haml b/app/views/auth/shared/_links.html.haml index 516c625a6b564cfe2877e77c377dab80802c1b8d..3c68ccd222086da4f0ffde12cfbc0a7a0fa5a718 100644 --- a/app/views/auth/shared/_links.html.haml +++ b/app/views/auth/shared/_links.html.haml @@ -3,7 +3,7 @@ %li= link_to t('auth.login'), new_session_path(resource_name) - if devise_mapping.registerable? && controller_name != 'registrations' - %li= link_to t('auth.register'), open_registrations? ? new_registration_path(resource_name) : 'https://joinmastodon.org/#getting-started' + %li= link_to t('auth.register'), available_sign_up_path - if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %li= link_to t('auth.forgot_password'), new_password_path(resource_name) diff --git a/app/views/layouts/public.html.haml b/app/views/layouts/public.html.haml index 15d819dfe36e481652f013338667ba6f7606ddcf..2a73973f6457ccad29cff3592dbf524d051fd82d 100644 --- a/app/views/layouts/public.html.haml +++ b/app/views/layouts/public.html.haml @@ -10,8 +10,7 @@ = link_to root_url, class: 'brand' do = image_tag asset_pack_path('logo_full.svg'), alt: 'Mastodon' - - if Setting.profile_directory - = link_to t('directories.directory'), explore_path, class: 'nav-link optional' + = link_to t('directories.directory'), explore_path, class: 'nav-link optional' if Setting.profile_directory = link_to t('about.about_this'), about_more_path, class: 'nav-link optional' = link_to t('about.apps'), 'https://joinmastodon.org/apps', class: 'nav-link optional' .nav-center @@ -20,7 +19,7 @@ = link_to t('settings.back'), root_url, class: 'nav-link nav-button webapp-btn' - else = link_to t('auth.login'), new_user_session_path, class: 'webapp-btn nav-link nav-button' - = link_to t('auth.register'), open_registrations? ? new_user_registration_path : 'https://joinmastodon.org/#getting-started', class: 'webapp-btn nav-link nav-button' + = link_to t('auth.register'), available_sign_up_path, class: 'webapp-btn nav-link nav-button' .container= yield diff --git a/app/views/remote_follow/new.html.haml b/app/views/remote_follow/new.html.haml index c907938429b836346bb2d7da9e5e1a5d7decde4a..4e9601f6aa53b9d2aefea018ad091e68d1695451 100644 --- a/app/views/remote_follow/new.html.haml +++ b/app/views/remote_follow/new.html.haml @@ -17,4 +17,4 @@ %p.hint.subtle-hint = t('remote_follow.reason_html', instance: site_hostname) - = t('remote_follow.no_account_html', sign_up_path: open_registrations? ? new_user_registration_path : 'https://joinmastodon.org/#getting-started') + = t('remote_follow.no_account_html', sign_up_path: available_sign_up_path) diff --git a/app/views/remote_interaction/new.html.haml b/app/views/remote_interaction/new.html.haml index b2b7826c4a327dd56159b93fafa962f5fb377646..c8c08991f059b13075b0b7037b08b676447e3810 100644 --- a/app/views/remote_interaction/new.html.haml +++ b/app/views/remote_interaction/new.html.haml @@ -21,4 +21,4 @@ %p.hint.subtle-hint = t('remote_follow.reason_html', instance: site_hostname) - = t('remote_follow.no_account_html', sign_up_path: open_registrations? ? new_user_registration_path : 'https://joinmastodon.org/#getting-started') + = t('remote_follow.no_account_html', sign_up_path: available_sign_up_path) diff --git a/app/views/user_mailer/confirmation_instructions.html.haml b/app/views/user_mailer/confirmation_instructions.html.haml index f75f7529a8f2286c19862413fe387f1695ec3356..70d0f5a24aafed011d8ad9ea30131442683d6f4f 100644 --- a/app/views/user_mailer/confirmation_instructions.html.haml +++ b/app/views/user_mailer/confirmation_instructions.html.haml @@ -36,7 +36,7 @@ %tbody %tr %td.column-cell.text-center - %p= t 'devise.mailer.confirmation_instructions.explanation', host: site_hostname + %p= t @resource.approved? ? 'devise.mailer.confirmation_instructions.explanation' : 'devise.mailer.confirmation_instructions.explanation_when_pending', host: site_hostname %table.email-table{ cellspacing: 0, cellpadding: 0 } %tbody diff --git a/app/views/user_mailer/confirmation_instructions.text.erb b/app/views/user_mailer/confirmation_instructions.text.erb index 65b4626c669d07a0c3a738ae58d058ea0e8ce83a..aad91cd9d6a341fc64e73009cf61f073cf21b8c1 100644 --- a/app/views/user_mailer/confirmation_instructions.text.erb +++ b/app/views/user_mailer/confirmation_instructions.text.erb @@ -2,7 +2,7 @@ === -<%= t 'devise.mailer.confirmation_instructions.explanation', host: site_hostname %> +<%= t @resource.approved? ? 'devise.mailer.confirmation_instructions.explanation' : 'devise.mailer.confirmation_instructions.explanation_when_pending', host: site_hostname %> => <%= confirmation_url(@resource, confirmation_token: @token, redirect_to_app: @resource.created_by_application ? 'true' : nil) %> diff --git a/config/locales/ar.yml b/config/locales/ar.yml index d3de422a98817159d8d5d25f19fe2017b7b6cfcf..b0b8d8b40df454d5e04c9adc367d92bde5c0c6e9 100644 --- a/config/locales/ar.yml +++ b/config/locales/ar.yml @@ -416,9 +416,6 @@ ar: min_invite_role: disabled: لا Ø£Øد title: المستخدÙمون Ø§Ù„Ù…ØµØ±Ø Ù„Ù‡Ù… لإرسال الدعوات - open: - desc_html: Ø§Ù„Ø³Ù…Ø§Ø Ù„Ù„Ø¬Ù…ÙŠØ¹ بإنشاء Øساب - title: ÙØªØ Ø§Ù„ØªØ³Ø¬ÙŠÙ„ show_known_fediverse_at_about_page: desc_html: عند التثبت ØŒ سو٠تظهر toots من جميع fediverse المعروÙØ© على عرض مسبق. وإلا Ùإنه سيعرض Ùقط toots المØلية. title: إظهار الÙيديÙرس الموØَّد ÙÙŠ خيط المÙعايَنة diff --git a/config/locales/ca.yml b/config/locales/ca.yml index f4ce50e0cd6cdbdde293c45bb05a16d514943328..417ba95f75a0897b1c12d17d3a09a14b719d430c 100644 --- a/config/locales/ca.yml +++ b/config/locales/ca.yml @@ -399,9 +399,6 @@ ca: min_invite_role: disabled: Ningú title: Permet les invitacions de - open: - desc_html: Permet que qualsevol pugui crear un compte - title: Registre obert show_known_fediverse_at_about_page: desc_html: Quan s'activa, mostrarà tots els toots de tot el fedivers conegut en vista prèvia. En cas contrari, només es mostraran toots locals. title: Mostra el fedivers conegut en vista prèvia de la lÃnia de temps diff --git a/config/locales/co.yml b/config/locales/co.yml index 772479e6ac5ba844c75c8123b349907dc61d9cbd..77c3efeda748f047e49fb9ae4e32736ecf8152d0 100644 --- a/config/locales/co.yml +++ b/config/locales/co.yml @@ -400,9 +400,6 @@ co: min_invite_role: disabled: Nisunu title: Auturizà l’invitazione da - open: - desc_html: Auturizà tuttu u mondu à creà un contu quì - title: Apre l’arregistramenti show_known_fediverse_at_about_page: desc_html: Quandu ghjè selezziunatu, statuti di tuttu l’istanze cunnisciute saranu affissati indè a vista di e linee. Altrimente soli i statuti lucali saranu mustrati. title: Vedde tuttu u fediverse cunnisciutu nant’a vista di e linee diff --git a/config/locales/cs.yml b/config/locales/cs.yml index 2b2f512a32f860e332138e9c34a6aa960f8d8255..6f55531943f00b5b50da7f40e2fb7f9bfc8df80d 100644 --- a/config/locales/cs.yml +++ b/config/locales/cs.yml @@ -406,9 +406,6 @@ cs: min_invite_role: disabled: Nikdo title: Povolit pozvánky od - open: - desc_html: Dovolit každému vytvoÅ™it si úÄet - title: ZpÅ™Ãstupnit registraci show_known_fediverse_at_about_page: desc_html: Je-li toto zapnuto, zobrazà se v náhledu tooty ze vÅ¡ech známých serverů na fediverse. Jinak budou zobrazeny pouze mÃstnà tooty. title: Zobrazit celou známou fediverse na náhledu Äasové osy diff --git a/config/locales/cy.yml b/config/locales/cy.yml index b3746e4e01cd6ffda614ac0b4c71aa251e9b32a8..b6f94606d0a8be0d73276b7548eca07f86747c5b 100644 --- a/config/locales/cy.yml +++ b/config/locales/cy.yml @@ -423,9 +423,6 @@ cy: min_invite_role: disabled: Neb title: Caniatau gwahoddiadau gan - open: - desc_html: Caniatau i unrhywun greu cyfrif - title: Agor cofrestru show_known_fediverse_at_about_page: desc_html: Wedi'i ddewis, bydd yn dangos rhagolwg o dŵtiau o'r holl ffedysawd. Fel arall bydd ond yn dangos tŵtiau lleol. title: Dangos ffedysawd hysbys ar ragolwg y ffrwd diff --git a/config/locales/da.yml b/config/locales/da.yml index f4d884554815d366e2f381a0131b7f89645eb0b0..a44a345d7aeb543042ea3fa205edaf6aae0b82b2 100644 --- a/config/locales/da.yml +++ b/config/locales/da.yml @@ -360,9 +360,6 @@ da: min_invite_role: disabled: Ingen title: Tillad invitationer af - open: - desc_html: Tillad alle at oprette en konto - title: Ã…ben registrering show_known_fediverse_at_about_page: desc_html: NÃ¥r slÃ¥et til, vil det vise trut fra hele det kendte fedivers pÃ¥ forhÃ¥ndsvisning. Ellers vil det kun vise lokale trut. title: Vis kendte fedivers pÃ¥ tidslinje forhÃ¥ndsvisning diff --git a/config/locales/de.yml b/config/locales/de.yml index 150ead7f7943432cebe0f5a389a4f0af724d49ea..ae2948fb5e309d2e755e975a714ebac4f65c8b0f 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -399,9 +399,6 @@ de: min_invite_role: disabled: Niemand title: Einladungen erlauben von - open: - desc_html: Allen erlauben, ein Konto zu erstellen - title: Registrierung öffnen show_known_fediverse_at_about_page: desc_html: Wenn aktiviert, wird es alle Beiträge aus dem bereits bekannten Teil des Fediversums auf der Startseite anzeigen. Andernfalls werden lokale Beitrage der Instanz angezeigt. title: Verwende öffentliche Zeitleiste für die Vorschau diff --git a/config/locales/devise.en.yml b/config/locales/devise.en.yml index 726c0504efd52c6873e4cdabf4e52730986195f4..2930733c00cd1d076608e6cadef5c9c976d1b5bf 100644 --- a/config/locales/devise.en.yml +++ b/config/locales/devise.en.yml @@ -12,6 +12,7 @@ en: last_attempt: You have one more attempt before your account is locked. locked: Your account is locked. not_found_in_database: Invalid %{authentication_keys} or password. + pending: Your account is still under review. timeout: Your session expired. Please sign in again to continue. unauthenticated: You need to sign in or sign up before continuing. unconfirmed: You have to confirm your email address before continuing. @@ -20,6 +21,7 @@ en: action: Verify email address action_with_app: Confirm and return to %{app} explanation: You have created an account on %{host} with this email address. You are one click away from activating it. If this wasn't you, please ignore this email. + explanation_when_pending: You applied for an invite to %{host} with this email address. Once you confirm your e-mail address, we will review your application. You can't login until then. If your application is rejected, your data will be removed, so no further action will be required from you. If this wasn't you, please ignore this email. extra_html: Please also check out <a href="%{terms_path}">the rules of the server</a> and <a href="%{policy_path}">our terms of service</a>. subject: 'Mastodon: Confirmation instructions for %{instance}' title: Verify email address @@ -60,6 +62,7 @@ en: signed_up: Welcome! You have signed up successfully. signed_up_but_inactive: You have signed up successfully. However, we could not sign you in because your account is not yet activated. signed_up_but_locked: You have signed up successfully. However, we could not sign you in because your account is locked. + signed_up_but_pending: A message with a confirmation link has been sent to your email address. After you click the link, we will review your application. You will be notified if it is approved. signed_up_but_unconfirmed: A message with a confirmation link has been sent to your email address. Please follow the link to activate your account. Please check your spam folder if you didn't receive this email. update_needs_confirmation: You updated your account successfully, but we need to verify your new email address. Please check your email and follow the confirm link to confirm your new email address. Please check your spam folder if you didn't receive this email. updated: Your account has been updated successfully. diff --git a/config/locales/el.yml b/config/locales/el.yml index 22ec313c05c96cddb4e489dabc545f505fedf004..f5a2c5d4bc02f0a6c03810ced251f519566da173 100644 --- a/config/locales/el.yml +++ b/config/locales/el.yml @@ -400,9 +400,6 @@ el: min_invite_role: disabled: Κανείς title: ΕπÎÏ„Ïεψε Ï€Ïοσκλήσεις από - open: - desc_html: ΕπÎÏ„Ïεψε σε οποιονδήποτε να δημιουÏγήσει λογαÏιασμό - title: Άνοιξε τις εγγÏαφÎÏ‚ show_known_fediverse_at_about_page: desc_html: Όταν αντιστÏαφεί, θα δείχνει τα τουτ από όλο το γνωστό fediverse στην Ï€Ïοεπισκόπηση. ΔιαφοÏετικά θα δείχνει μόνο τοπικά τουτ. title: Εμφάνιση του Î³Î½Ï‰ÏƒÏ„Î¿Ï fediverse στην Ï€Ïοεπισκόπηση Ïοής diff --git a/config/locales/en.yml b/config/locales/en.yml index b026e892f6b8fb4b7e1d494e1e931eb8ffc84f18..d11aa9262848340fc4a2f8433a6a5814a46678e1 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -79,6 +79,7 @@ en: delete: Delete destroyed_msg: Moderation note successfully destroyed! accounts: + approve: Approve are_you_sure: Are you sure? avatar: Avatar by_domain: Domain @@ -124,6 +125,7 @@ en: moderation: active: Active all: All + pending: Pending silenced: Silenced suspended: Suspended title: Moderation @@ -133,6 +135,7 @@ en: no_limits_imposed: No limits imposed not_subscribed: Not subscribed outbox_url: Outbox URL + pending: Pending review perform_full_suspension: Suspend profile_url: Profile URL promote: Promote @@ -140,6 +143,7 @@ en: public: Public push_subscription_expires: PuSH subscription expires redownload: Refresh profile + reject: Reject remove_avatar: Remove avatar remove_header: Remove header resend_confirmation: @@ -411,9 +415,12 @@ en: min_invite_role: disabled: No one title: Allow invitations by - open: - desc_html: Allow anyone to create an account - title: Open registration + registrations_mode: + modes: + approved: Approval required for sign up + none: Nobody can sign up + open: Anyone can sign up + title: Registrations mode show_known_fediverse_at_about_page: desc_html: When toggled, it will show toots from all the known fediverse on preview. Otherwise it will only show local toots. title: Show known fediverse on timeline preview @@ -476,6 +483,9 @@ en: edit_preset: Edit warning preset title: Manage warning presets admin_mailer: + new_pending_account: + body: The details of the new account are below. You can approve or reject this application. + subject: New account up for review on %{instance} (%{username}) new_report: body: "%{reporter} has reported %{target}" body_remote: Someone from %{domain} has reported %{target} @@ -497,6 +507,7 @@ en: your_token: Your access token auth: agreement_html: By clicking "Sign up" below you agree to follow <a href="%{rules_path}">the rules of the server</a> and <a href="%{terms_path}">our terms of service</a>. + apply_for_account: Request an invite change_password: Password checkbox_agreement_html: I agree to the <a href="%{rules_path}" target="_blank">server rules</a> and <a href="%{terms_path}" target="_blank">terms of service</a> confirm_email: Confirm email diff --git a/config/locales/eo.yml b/config/locales/eo.yml index a1ed5eceda02ea5e37b6b4e72798ad0c9bfa11ea..9673963260575bd41cebc86be855e64f7d72f1f8 100644 --- a/config/locales/eo.yml +++ b/config/locales/eo.yml @@ -400,9 +400,6 @@ eo: min_invite_role: disabled: Neniu title: Permesi invitojn de - open: - desc_html: Permesi iun ajn krei konton - title: Malfermi registriÄojn show_known_fediverse_at_about_page: desc_html: Kiam Åaltita, Äi montros mesaÄojn de la tuta konata fediverse antaÅvide. Aliokaze, Äi montros nur lokajn mesaÄojn. title: Montri konatan fediverse en tempolinia antaÅvido diff --git a/config/locales/es.yml b/config/locales/es.yml index 41e5cdd249cbd081153331399aaf508daddfe076..648541eda99c560042de002ba00ec63fd2609016 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -366,9 +366,6 @@ es: min_invite_role: disabled: Nadie title: Permitir invitaciones de - open: - desc_html: Permite a cualquiera a registrar una cuenta - title: Registro abierto show_known_fediverse_at_about_page: desc_html: Cuando esté activado, se mostrarán toots de todo el fediverso conocido en la vista previa. En otro caso, se mostrarán solamente toots locales. title: Mostrar fediverso conocido en la vista previa de la historia diff --git a/config/locales/eu.yml b/config/locales/eu.yml index f7bb8bba29e6184bbea6e258d013a28f5314974c..59cba6287b5c264190d47ad5e617c33649895cce 100644 --- a/config/locales/eu.yml +++ b/config/locales/eu.yml @@ -399,9 +399,6 @@ eu: min_invite_role: disabled: Inor ez title: Baimendu hauen gobidapenak - open: - desc_html: Baimendu edonori kontu bat sortzea - title: Ireki izen ematea show_known_fediverse_at_about_page: desc_html: Txandakatzean, fedibertsu ezagun osoko toot-ak bistaratuko ditu aurrebistan. Bestela, toot lokalak besterik ez ditu erakutsiko. title: Erakutsi fedibertsu ezagun osoko denbora-lerroa aurrebistan diff --git a/config/locales/fa.yml b/config/locales/fa.yml index cd8034ae117c0e07d8371b87e44faa14cda24291..a1c891bc724738c5e9eff30b112e2f5f0d628bc3 100644 --- a/config/locales/fa.yml +++ b/config/locales/fa.yml @@ -400,9 +400,6 @@ fa: min_invite_role: disabled: هیچ کس title: اجازهٔ دعوت به - open: - desc_html: همه بتوانند Øساب باز کنند - title: امکان ثبت نام show_known_fediverse_at_about_page: desc_html: اگر انتخاب شود، بوق‌های همهٔ سرورهای دیگر نیز در پیش‌نمایش این سرور نمایش می‌یابد. وگرنه Ùقط بوق‌های Ù…ØÙ„ÛŒ نشان داده می‌شوند. title: نمایش سرورهای دیگر در پیش‌نمایش این سرور diff --git a/config/locales/fi.yml b/config/locales/fi.yml index 94dfa61b0c8cde5286153f86032f3cc481d2b208..deacd351a29ddd9e3f525935f599923e6d214821 100644 --- a/config/locales/fi.yml +++ b/config/locales/fi.yml @@ -306,9 +306,6 @@ fi: min_invite_role: disabled: Ei kukaan title: Salli kutsut käyttäjältä - open: - desc_html: Salli kenen tahansa luoda tili - title: Avoin rekisteröinti show_known_fediverse_at_about_page: desc_html: Kun tämä on valittu, esikatselussa näytetään tuuttaukset kaikkialta tunnetusta fediversumista. Muutoin näytetään vain paikalliset tuuttaukset. title: Näytä aikajanan esikatselussa koko tunnettu fediversumi diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 4fbc0294549c83f70067aa3646595c7663e602be..1694fda82fb1e8a4e3477215261eecef9d5df6cf 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -400,9 +400,6 @@ fr: min_invite_role: disabled: Personne title: Autoriser les invitations par - open: - desc_html: Autoriser tout le monde à créer un compte - title: Ouvrir les inscriptions show_known_fediverse_at_about_page: desc_html: Lorsque l’option est activée, les pouets provenant de toutes les instances connues sont affichés dans la prévisualisation. Sinon, seuls les pouets locaux sont affichés. title: Afficher le fediverse connu dans la prévisualisation du fil diff --git a/config/locales/gl.yml b/config/locales/gl.yml index f18695046479a555734ee7d9e307b5337d3117c5..2491284261e40387c05191ecd6cd5f63eb0a5e22 100644 --- a/config/locales/gl.yml +++ b/config/locales/gl.yml @@ -400,9 +400,6 @@ gl: min_invite_role: disabled: Ninguén title: Permitir convites por - open: - desc_html: Permitir que calquera poida crear unha conta - title: Abrir rexistro show_known_fediverse_at_about_page: desc_html: Si activado, mostraralle os toots de todo o fediverso coñecido nunha vista previa. Si non só mostrará os toots locais. title: Mostrar vista previa do fediverso na liña temporal diff --git a/config/locales/he.yml b/config/locales/he.yml index 5febebe29a6fdbb258b0e8348eed2b3a03b40ca5..1ddb1361ddf334555b81ee5075b964f567d4c442 100644 --- a/config/locales/he.yml +++ b/config/locales/he.yml @@ -177,8 +177,6 @@ he: closed_message: desc_html: מוצג על הדף הר×שי ×›×שר ההרשמות סגורות<br>× ×™×ª×Ÿ להשתמש בתגיות HTML title: מסר סגירת הרשמות - open: - title: הרשמה פתוחה site_description: desc_html: מוצג כפסקה על הדף הר×שי ומשמש כתגית מט×. × ×™×ª×Ÿ להשתמש בתגיות HTML, ובמיוחד ב־<code> < a> </code> ו־<code> < em> </code> . title: תי×ור ×”×תר diff --git a/config/locales/hu.yml b/config/locales/hu.yml index 56d608819424f55890c29a1c20365b2e3186aa74..44399778c2bdb31267ea65056b4d597bb771ffba 100644 --- a/config/locales/hu.yml +++ b/config/locales/hu.yml @@ -249,9 +249,6 @@ hu: min_invite_role: disabled: Senkinek title: MeghÃvások engedélyezése - open: - desc_html: Bárki létrehozhat felhasználói fiókot - title: Nyitott regisztráció show_staff_badge: desc_html: Stáb-jelvény megjelenÃtése a felhasználó oldalán title: Stáb-jelvény megjelenÃtése diff --git a/config/locales/id.yml b/config/locales/id.yml index 896ea402b70e3958c3489cf025cb9a87e0cb0f5f..a91f459a4f22149799fb8f95203d27f58c9bdb99 100644 --- a/config/locales/id.yml +++ b/config/locales/id.yml @@ -204,8 +204,6 @@ id: closed_message: desc_html: Ditampilkan pada halaman depan saat pendaftaran ditutup<br>Anda bisa menggunakan tag HTML title: Pesan penutupan pendaftaran - open: - title: Pendaftaran terbuka site_description: desc_html: Ditampilkan sebagai sebuah paragraf di halaman depan dan digunakan sebagai tag meta.<br>Anda bisa menggunakan tag HTML, khususnya <code><a></code> dan <code><em></code>. title: Deskripsi situs diff --git a/config/locales/io.yml b/config/locales/io.yml index ec86d1a79bec62edb35553b634c5313dad0a9d34..b926fe641502f4a24fa51b41b6d07db28fa0411f 100644 --- a/config/locales/io.yml +++ b/config/locales/io.yml @@ -104,8 +104,6 @@ io: closed_message: desc_html: Displayed on frontpage when registrations are closed<br>You can use HTML tags title: Closed registration message - open: - title: Open registration site_description: desc_html: Displayed as a paragraph on the frontpage and used as a meta tag.<br>You can use HTML tags, in particular <code><a></code> and <code><em></code>. title: Site description diff --git a/config/locales/it.yml b/config/locales/it.yml index 3a4703ca175f1ae86d66bb41c1a8c578bc2aae0d..1af8bc08c5c29d5bde05f3b1e8bd598a3ae5379a 100644 --- a/config/locales/it.yml +++ b/config/locales/it.yml @@ -389,9 +389,6 @@ it: min_invite_role: disabled: Nessuno title: Permetti inviti da - open: - desc_html: Consenti a chiunque di creare un account - title: Apri registrazioni show_known_fediverse_at_about_page: desc_html: Quando attivato, mostra nell'anteprima i toot da tutte le istanze conosciute. Altrimenti mostra solo i toot locali. title: Mostra la fediverse conosciuta nell'anteprima della timeline diff --git a/config/locales/ja.yml b/config/locales/ja.yml index 2bc6654264caa57e4da17bc5f5e5eb37c3d1bc49..19845caa7eeaf7f2e9e6993a7817e83026dbd73f 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -411,9 +411,6 @@ ja: min_invite_role: disabled: 誰も許å¯ã—ãªã„ title: 招待ã®ä½œæˆã‚’è¨±å¯ - open: - desc_html: 誰ã§ã‚‚自由ã«ã‚¢ã‚«ã‚¦ãƒ³ãƒˆã‚’作æˆã§ãるよã†ã«ã—ã¾ã™ - title: æ–°è¦ç™»éŒ²ã‚’å—ã‘付ã‘ã‚‹ show_known_fediverse_at_about_page: desc_html: ãƒã‚§ãƒƒã‚¯ã‚’入れるã¨ãƒ—レビュー欄ã«æ—¢çŸ¥ã®é€£åˆå…ˆå…¨ã¦ã®ãƒˆã‚¥ãƒ¼ãƒˆã‚’表示ã—ã¾ã™ã€‚外ã™ã¨ãƒãƒ¼ã‚«ãƒ«ã®ãƒˆã‚¥ãƒ¼ãƒˆã ã‘表示ã—ã¾ã™ã€‚ title: タイムラインプレビューã«é€£åˆã‚¿ã‚¤ãƒ ラインを表示ã™ã‚‹ diff --git a/config/locales/ka.yml b/config/locales/ka.yml index 24c6638a320663ab4f626d69f7b2a2d3963815de..5d0bba510a7f5402b003307ad456d7cfb3f89a67 100644 --- a/config/locales/ka.yml +++ b/config/locales/ka.yml @@ -333,9 +333,6 @@ ka: min_invite_role: disabled: áƒáƒ áƒáƒ•áƒ˜áƒœ title: ნებრდáƒáƒ”რთáƒáƒ¡ მáƒáƒ¬áƒ•áƒ”ევებს - open: - desc_html: უფლებრმიეცით ყველáƒáƒ¡, გáƒáƒ®áƒ¡áƒœáƒáƒœ áƒáƒœáƒ’áƒáƒ იში - title: ღირრეგისტრáƒáƒªáƒ˜áƒ show_known_fediverse_at_about_page: desc_html: ჩáƒáƒ თვისáƒáƒ¡, ეს გáƒáƒ›áƒáƒáƒ©áƒ”ნს ტუტებს ყველრცნáƒáƒ‘ილი ფედივერსისგáƒáƒœ პრევიუზე. სხვრშემთხვევáƒáƒ¨áƒ˜, გáƒáƒ›áƒáƒáƒ©áƒ”ნს მხáƒáƒšáƒáƒ“ ლáƒáƒ™áƒáƒšáƒ£áƒ ტუტებს. title: გáƒáƒ›áƒáƒ©áƒœáƒ“ეს ცნáƒáƒ‘ილი ვედივერსი თáƒáƒ˜áƒ›áƒšáƒáƒ˜áƒœ პრევიუში diff --git a/config/locales/kk.yml b/config/locales/kk.yml index f6284d1915d54286f2f581d9a48d231a321ff2c5..4897bc095147f6eacb727a51249178f26b779b3c 100644 --- a/config/locales/kk.yml +++ b/config/locales/kk.yml @@ -400,9 +400,6 @@ kk: min_invite_role: disabled: Ешкім title: Allow шақырулар by - open: - desc_html: Allow anyone to create an аккаунт - title: Ðшық тіркелу show_known_fediverse_at_about_page: desc_html: When toggled, it will show toots from all the known fediverse on preview. Otherwise it will only show жергілікті toots. title: Show known fediverse on timeline превью diff --git a/config/locales/ko.yml b/config/locales/ko.yml index 6574d14ca6a40c00462574c022d51287a85e6a9f..9d480e7bc470053ce529c79aeabda73d3a3a4fbb 100644 --- a/config/locales/ko.yml +++ b/config/locales/ko.yml @@ -402,9 +402,6 @@ ko: min_invite_role: disabled: ì•„ë¬´ë„ ëª» 하게 title: 초대ë§í¬ë¥¼ 만들 수 있는 권한 - open: - desc_html: ê³„ì •ì„ ìƒì„±í• 수 있ë„ë¡ í—ˆìš©í•©ë‹ˆë‹¤ - title: ì‹ ê·œ ê³„ì • 등ë¡ì„ ë°›ìŒ show_known_fediverse_at_about_page: desc_html: 활성화 ë˜ë©´ 프리뷰 페ì´ì§€ì—ì„œ íŽ˜ë””ë²„ìŠ¤ì˜ ëª¨ë“ íˆ¿ì„ í‘œì‹œí•©ë‹ˆë‹¤. 비활성화시 ë¡œì»¬ì— ìžˆëŠ” 툿만 표시 ë©ë‹ˆë‹¤. title: 타임ë¼ì¸ í”„ë¦¬ë·°ì— ì•Œë ¤ì§„ 페디버스 표시하기 diff --git a/config/locales/lt.yml b/config/locales/lt.yml index 1b09c17ece90e7b7f65615aee99f65e485481f12..4f8fd5825b2539e2f59eb6952270066529333bdc 100644 --- a/config/locales/lt.yml +++ b/config/locales/lt.yml @@ -408,9 +408,6 @@ lt: min_invite_role: disabled: Nei vienas title: Leisti pakvietimus - open: - desc_html: Leisti bet kam susikurti paskyrÄ… - title: Atidaryta registracija show_known_fediverse_at_about_page: desc_html: Kai įjungta, rodys įraÅ¡us iÅ¡ visos žinomos fedi-visatos. Kitokiu atvÄ—ju, rodys tik lokalius įraÅ¡us. title: Rodyti žinoma fedi-visatos laiko juosta peržiÅ«roje diff --git a/config/locales/nl.yml b/config/locales/nl.yml index 5a86a2027f4c678c59950414237e1c89fe8cc332..f92ae3bf1707a15c991d60186543f1f0bf3b0729 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -400,9 +400,6 @@ nl: min_invite_role: disabled: Niemand title: Uitnodigingen toestaan door - open: - desc_html: Toestaan dat iedereen een account kan registereren - title: Open registratie show_known_fediverse_at_about_page: desc_html: Wanneer ingeschakeld wordt de globale tijdlijn op de voorpagina getoond en wanneer uitgeschakeld de lokale tijdljn. title: De globale tijdlijn op de voorpagina tonen diff --git a/config/locales/no.yml b/config/locales/no.yml index f6b036b9dfd9cb5d2f755ef8abcb9fb93fe32b18..6ee42a7cac7fee0a430569d73a758033c51cce60 100644 --- a/config/locales/no.yml +++ b/config/locales/no.yml @@ -249,9 +249,6 @@ min_invite_role: disabled: Ingen title: Tillat invitasjoner fra - open: - desc_html: Tillatt alle Ã¥ lage seg en konto - title: Ã…pen registrering show_staff_badge: desc_html: Vis personalemerke pÃ¥ brukersiden title: Vis personalemerke diff --git a/config/locales/oc.yml b/config/locales/oc.yml index 8c690f1446b3c19015a989f5804dfd693e4dcf05..b1d7c46d65257830909108ea295649010cd3d216 100644 --- a/config/locales/oc.yml +++ b/config/locales/oc.yml @@ -400,9 +400,6 @@ oc: min_invite_role: disabled: Degun title: Autorizat amb invitacions - open: - desc_html: Autorizar lo monde a se marcar - title: Inscripcions show_known_fediverse_at_about_page: desc_html: Un còp activat mostrarà los tuts de totes los fediverse dins l’apercebut. Autrament mostrarà pas que los tuts locals. title: Mostrar los fediverse coneguts dins l’apercebut del flux diff --git a/config/locales/pl.yml b/config/locales/pl.yml index ea4da424d41b0eb2fe7446ee17ae07b5a6a4ce2d..6a2b15ba55901d341120689b503323b2ae17f57f 100644 --- a/config/locales/pl.yml +++ b/config/locales/pl.yml @@ -411,9 +411,6 @@ pl: min_invite_role: disabled: Nikt title: Kto może zapraszać użytkowników - open: - desc_html: Pozwól każdemu na zaÅ‚ożenie konta - title: Otwarta rejestracja show_known_fediverse_at_about_page: desc_html: JeÅ›li wÅ‚Ä…czone, podglÄ…d instancji bÄ™dzie wyÅ›wietlaÅ‚ wpisy z caÅ‚ego Fediwersum. W innym przypadku, bÄ™dÄ… wyÅ›wietlane tylko lokalne wpisy. title: Pokazuj wszystkie znane wpisy na podglÄ…dzie instancji diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml index f5f59a4d9ec88a0972636aa64665dc5a0edb5719..ae4b0a271b4f9f86fcf1d582614ae6cf9182b8e4 100644 --- a/config/locales/pt-BR.yml +++ b/config/locales/pt-BR.yml @@ -399,9 +399,6 @@ pt-BR: min_invite_role: disabled: Ninguém title: Permitir convites de - open: - desc_html: Permitir que qualquer um crie uma conta - title: Cadastro aberto show_known_fediverse_at_about_page: desc_html: Quando ligado, vai mostrar toots de todo o fediverso conhecido na prévia da timeline. Senão, mostra somente toots locais. title: Mostrar fediverso conhecido na prévia da timeline diff --git a/config/locales/pt.yml b/config/locales/pt.yml index 0078fd5dc269427d7ca5d12d8f182b144c69567b..c2a7c36f010be92c2a78a219fd8b5721aecf6b66 100644 --- a/config/locales/pt.yml +++ b/config/locales/pt.yml @@ -249,9 +249,6 @@ pt: min_invite_role: disabled: Ninguém title: Permitir convites de - open: - desc_html: Permitir que qualquer um crie uma conta - title: Aceitar novos registos show_staff_badge: desc_html: Mostrar um crachá da equipa na página de utilizador title: Mostrar crachá da equipa diff --git a/config/locales/ru.yml b/config/locales/ru.yml index 8dd6e3688fb5733fc2df239bab55f88abed01144..72513e58c8b30f99d0b4bec0456485b6d19443d7 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -356,9 +356,6 @@ ru: min_invite_role: disabled: Ðикого title: Разрешать Ð¿Ñ€Ð¸Ð³Ð»Ð°ÑˆÐµÐ½Ð¸Ñ Ð¾Ñ‚ - open: - desc_html: ПозволÑет любому Ñоздавать аккаунт - title: Открыть региÑтрацию show_known_fediverse_at_about_page: desc_html: ЕÑли включено, показывает поÑÑ‚Ñ‹ Ñо вÑех извеÑтных узлов в предпроÑмотре ленты. Ð’ противном Ñлучае отображаютÑÑ Ñ‚Ð¾Ð»ÑŒÐºÐ¾ локальные поÑÑ‚Ñ‹. title: Показывать извеÑтные узлы в предпроÑмотре ленты diff --git a/config/locales/sk.yml b/config/locales/sk.yml index 9d888a51552ebe60323dc6ecaa3448032d82c069..565b2e8a8c2ce9b691dd93e60ea50f887fac3bb6 100644 --- a/config/locales/sk.yml +++ b/config/locales/sk.yml @@ -406,9 +406,6 @@ sk: min_invite_role: disabled: Nikto title: PovoliÅ¥ pozvánky od - open: - desc_html: PovoliÅ¥ každému aby si mohli vytvoriÅ¥ úÄet - title: Verejná registrácia show_known_fediverse_at_about_page: desc_html: Pokiaľ je zapnuté, bude v ukážke osi možné nahliadnúť prÃspevky z celého známeho fediversa. Inak budú ukázané iba prÃspevky z miestnej osi. title: Ukáž celé známe fediverse na náhľade osi diff --git a/config/locales/sq.yml b/config/locales/sq.yml index e7f17579519840ac47bdb8724d42f9e436767b40..b29564e74bab01347b366571ec3ef26e773f1c20 100644 --- a/config/locales/sq.yml +++ b/config/locales/sq.yml @@ -397,9 +397,6 @@ sq: min_invite_role: disabled: Asnjë title: Lejo vetëm me ftesa - open: - desc_html: Lejo cilindo të krijojë llogari - title: Hapni regjistrimin show_known_fediverse_at_about_page: desc_html: Kur përdoret, do të shfaqë mesazhe prej krejt fediversit të njohur, si paraparje. Përndryshe do të shfaqë vetëm mesazhe vendore. title: Shfaq te paraparja e rrjedhës kohore fedivers të njohur diff --git a/config/locales/sr-Latn.yml b/config/locales/sr-Latn.yml index 9d848d6edab8b66cf49ba58152e0a0f5c08183f9..a43c639c0e0a0d60035f5ab7e925198ce2a6650b 100644 --- a/config/locales/sr-Latn.yml +++ b/config/locales/sr-Latn.yml @@ -245,9 +245,6 @@ sr-Latn: min_invite_role: disabled: Niko title: Samo preko pozivnice - open: - desc_html: Dozvoli svakome da kreira nalog - title: Otvorena registracija show_staff_badge: desc_html: Prikaži bedž osoblja na korisniÄkoj strani title: Prikaži bedž osoblja diff --git a/config/locales/sr.yml b/config/locales/sr.yml index 4474cd4fc614a6f7e0fab041647c5b8e1d55eef2..5f7533ee15b665410bf50fe5ee676ca6de4311ae 100644 --- a/config/locales/sr.yml +++ b/config/locales/sr.yml @@ -410,9 +410,6 @@ sr: min_invite_role: disabled: Ðико title: Само преко позивнице - open: - desc_html: Дозволи Ñвакоме да креира налог - title: Отворена региÑтрација show_known_fediverse_at_about_page: desc_html: Када Ñе упали, показаће трубе из Ñвих знаних федиверÑа на преглед. У Ñупротном ће Ñамо показати локалне трубе. title: Покажи познате здружене инÑтанце у прегледнику временÑке линије diff --git a/config/locales/sv.yml b/config/locales/sv.yml index 3023fb183824e4217c060cd758f8ebe731880db4..7478bef6c39103f76179e2c03be3fe6abb3f21ff 100644 --- a/config/locales/sv.yml +++ b/config/locales/sv.yml @@ -290,9 +290,6 @@ sv: min_invite_role: disabled: Ingen title: TillÃ¥t inbjudningar av - open: - desc_html: TillÃ¥t alla att skapa ett konto - title: Öppen registrering show_known_fediverse_at_about_page: desc_html: När den växlas, kommer toots frÃ¥n hela fediverse visas pÃ¥ förhandsvisning. Annars visas bara lokala toots. title: Visa det kända fediverse pÃ¥ tidslinjens förhandsgranskning diff --git a/config/locales/th.yml b/config/locales/th.yml index dcf49c24c3cec2576ee292fbcb587e1416663228..5e9be4da700e5056b72e54f6b426461871c6f54a 100644 --- a/config/locales/th.yml +++ b/config/locales/th.yml @@ -113,8 +113,6 @@ th: closed_message: desc_html: Displayed on frontpage when registrations are closed<br> ใช้ HTML tags ได้ title: ปิดข้à¸à¸„วามลงทะเบียน - open: - title: เปิดรับลงทะเบียน site_description: desc_html: Displayed as a paragraph on the frontpage and used as a meta tag.<br> ใช้ HTML tags ได้, in particular <code><a></code> à¹à¸¥à¸° <code><em></code>. title: คำà¸à¸˜à¸´à¸šà¸²à¸¢à¹„ซต์ diff --git a/config/locales/tr.yml b/config/locales/tr.yml index b76d793295ae4b36ec0d620b7e7350652af7eb2e..d5f48ee45f2c851708518b3aefa41da854654a05 100644 --- a/config/locales/tr.yml +++ b/config/locales/tr.yml @@ -207,8 +207,6 @@ tr: closed_message: desc_html: Kayıt alımları kapatıldığında ana sayfada görüntülenecek mesajdır. <br> HTML etiketleri kullanabilirsiniz title: Kayıt alımları kapatılma mesajı - open: - title: Kayıt alımları site_description: desc_html: Ana sayfada paragraf olarak görüntülenecek bilgidir.<br>Özellikle <code><a></code> ve <code><em></code> olmak suretiyle HTML etiketlerini kullanabilirsiniz. title: Site açıklaması diff --git a/config/locales/uk.yml b/config/locales/uk.yml index 5cc9141044f704ddfaf68db5c42979bd22bf7cd6..d8e2aa0660b82b7b9e4ef4946514dad93d54a8b9 100644 --- a/config/locales/uk.yml +++ b/config/locales/uk.yml @@ -320,9 +320,6 @@ uk: min_invite_role: disabled: Ðіхто title: Дозволити Ð·Ð°Ð¿Ñ€Ð¾ÑˆÐµÐ½Ð½Ñ Ð²Ñ–Ð´ - open: - desc_html: Дозволити будь-ком Ñтворювати аккаунт - title: Відкрити реєÑтрацію show_known_fediverse_at_about_page: desc_html: Коли увімкнено, будуть показані поÑти з уÑього відомого федиÑвіту у передпоказі. Інакше будуть показані локальні поÑти. title: Показувати доÑтупний федиÑвіт у передпоказі фіду diff --git a/config/locales/zh-CN.yml b/config/locales/zh-CN.yml index 50527546af7d9a4201fee5948e6e0d15e8e8a60d..f91cef4a422901ee9e61755a48d26ba9c4604db4 100644 --- a/config/locales/zh-CN.yml +++ b/config/locales/zh-CN.yml @@ -340,9 +340,6 @@ zh-CN: min_invite_role: disabled: 没有人 title: å…许å‘é€é‚€è¯·çš„用户组 - open: - desc_html: å…许所有人建立å¸æˆ· - title: 开放注册 show_known_fediverse_at_about_page: desc_html: å¯ç”¨æ¤é€‰é¡¹å°†ä¼šåœ¨é¢„览ä¸æ˜¾ç¤ºæ¥è‡ªå·²çŸ¥å®žä¾‹çš„嘟文,å¦åˆ™åªä¼šæ˜¾ç¤ºæœ¬ç«™æ—¶é—´è½´çš„内容. title: 在时间轴预览ä¸æ˜¾ç¤ºå·²çŸ¥å®žä¾‹ diff --git a/config/locales/zh-HK.yml b/config/locales/zh-HK.yml index 043f2ca5fd368d411311e7bd3924f41e200a9f88..a2cfe56a942129974b076700db82129ec598d631 100644 --- a/config/locales/zh-HK.yml +++ b/config/locales/zh-HK.yml @@ -288,9 +288,6 @@ zh-HK: min_invite_role: disabled: 沒有人 title: å…許發é€é‚€è«‹çš„身份 - open: - desc_html: å…許所有人建立帳戶 - title: 開放註冊 show_known_fediverse_at_about_page: desc_html: 如果開啟,就會在時間軸é è¦½é¡¯ç¤ºè·¨ç«™æ–‡ç« ï¼Œå¦å‰‡å°±åªæœƒé¡¯ç¤ºæœ¬ç«™æ–‡ç« 。 title: 在時間軸é è¦½é¡¯ç¤ºè·¨ç«™æ–‡ç« diff --git a/config/locales/zh-TW.yml b/config/locales/zh-TW.yml index 76a0cbb64dae4c030c19d116608c951a32d5b4b4..4498eff954a21c08fda1334864a0bdc3a553d597 100644 --- a/config/locales/zh-TW.yml +++ b/config/locales/zh-TW.yml @@ -293,9 +293,6 @@ zh-TW: min_invite_role: disabled: 沒有人 title: å…許發é€é‚€è«‹çš„身份 - open: - desc_html: å…許所有人建立帳戶 - title: 開放註冊 show_known_fediverse_at_about_page: desc_html: 如果開啟,就會在時間軸é 覽顯示其他站點嘟文,å¦å‰‡å°±åªæœƒé¡¯ç¤ºæœ¬ç«™é»žå˜Ÿæ–‡ã€‚ title: 在時間軸é 覽顯示其他站點嘟文 diff --git a/config/routes.rb b/config/routes.rb index 227d86c7313e808350d1078a13cfdfa00b71f716..4a75d69523de37c01ea6eb9f17a76c708a4db4ad 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -187,6 +187,8 @@ Rails.application.routes.draw do post :remove_avatar post :remove_header post :memorialize + post :approve + post :reject end resource :change_email, only: [:show, :update] diff --git a/config/settings.yml b/config/settings.yml index 33a03efccb23f054b3218c0437af82d5ca864163..4f05519a555e49a5ca89b233466c0f1a9346d1fe 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -9,7 +9,7 @@ defaults: &defaults site_terms: '' site_contact_username: '' site_contact_email: '' - open_registrations: true + registrations_mode: 'open' profile_directory: true closed_registrations_message: '' open_deletion: true diff --git a/db/migrate/20190307234537_add_approved_to_users.rb b/db/migrate/20190307234537_add_approved_to_users.rb new file mode 100644 index 0000000000000000000000000000000000000000..c57a66dbc3cb2e11503f97e44ef931689357487b --- /dev/null +++ b/db/migrate/20190307234537_add_approved_to_users.rb @@ -0,0 +1,23 @@ +require Rails.root.join('lib', 'mastodon', 'migration_helpers') + +class AddApprovedToUsers < ActiveRecord::Migration[5.2] + include Mastodon::MigrationHelpers + + disable_ddl_transaction! + + def up + safety_assured do + add_column_with_default( + :users, + :approved, + :bool, + allow_null: false, + default: true + ) + end + end + + def down + remove_column :users, :approved + end +end diff --git a/db/schema.rb b/db/schema.rb index 3d5260270932ec60b1ea74d6e96fc92fe84b7fc6..cc46b8f1551152b9275059fa72e9cf13d848bc1a 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2019_03_06_145741) do +ActiveRecord::Schema.define(version: 2019_03_07_234537) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -36,6 +36,19 @@ ActiveRecord::Schema.define(version: 2019_03_06_145741) do t.index ["account_id", "domain"], name: "index_account_domain_blocks_on_account_id_and_domain", unique: true end + create_table "account_identity_proofs", force: :cascade do |t| + t.bigint "account_id" + t.string "provider", null: false + t.string "provider_username", null: false + t.text "token", null: false + t.boolean "proof_valid" + t.boolean "proof_live" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["account_id", "provider", "provider_username"], name: "index_account_proofs_on_account_and_provider_and_username", unique: true + t.index ["account_id"], name: "index_account_identity_proofs_on_account_id" + end + create_table "account_moderation_notes", force: :cascade do |t| t.text "content", null: false t.bigint "account_id", null: false @@ -699,6 +712,7 @@ ActiveRecord::Schema.define(version: 2019_03_06_145741) do t.string "remember_token" t.string "chosen_languages", array: true t.bigint "created_by_application_id" + t.boolean "approved", default: true, null: false t.index ["account_id"], name: "index_users_on_account_id" t.index ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true t.index ["created_by_application_id"], name: "index_users_on_created_by_application_id" diff --git a/db/seeds.rb b/db/seeds.rb index cf62ebf39ad562f88247682f069c37f47bbb724d..9a6e9dd78ed1edf0e061ff29b91670181eb469ab 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -4,5 +4,5 @@ if Rails.env.development? domain = ENV['LOCAL_DOMAIN'] || Rails.configuration.x.local_domain admin = Account.where(username: 'admin').first_or_initialize(username: 'admin') admin.save(validate: false) - User.where(email: "admin@#{domain}").first_or_initialize(email: "admin@#{domain}", password: 'mastodonadmin', password_confirmation: 'mastodonadmin', confirmed_at: Time.now.utc, admin: true, account: admin, agreement: true).save! + User.where(email: "admin@#{domain}").first_or_initialize(email: "admin@#{domain}", password: 'mastodonadmin', password_confirmation: 'mastodonadmin', confirmed_at: Time.now.utc, admin: true, account: admin, agreement: true, approved: true).save! end diff --git a/lib/mastodon/settings_cli.rb b/lib/mastodon/settings_cli.rb index c81cfbe520148ba0a3e91973555511ed5595577d..061650a80bb6f7a6203c5ac1f03fc646dd99e535 100644 --- a/lib/mastodon/settings_cli.rb +++ b/lib/mastodon/settings_cli.rb @@ -12,13 +12,13 @@ module Mastodon desc 'open', 'Open registrations' def open - Setting.open_registrations = true + Setting.registrations_mode = 'open' say('OK', :green) end desc 'close', 'Close registrations' def close - Setting.open_registrations = false + Setting.registrations_mode = 'none' say('OK', :green) end end diff --git a/spec/controllers/accounts_controller_spec.rb b/spec/controllers/accounts_controller_spec.rb index 3ba5d8aec2d92bd6cc4b5fdd7b3edae1616e6348..b728d719f9dea829be2294a2a24d3e7fcbe91f3e 100644 --- a/spec/controllers/accounts_controller_spec.rb +++ b/spec/controllers/accounts_controller_spec.rb @@ -3,7 +3,7 @@ require 'rails_helper' RSpec.describe AccountsController, type: :controller do render_views - let(:alice) { Fabricate(:account, username: 'alice') } + let(:alice) { Fabricate(:account, username: 'alice', user: Fabricate(:user)) } let(:eve) { Fabricate(:user) } describe 'GET #show' do diff --git a/spec/controllers/admin/settings_controller_spec.rb b/spec/controllers/admin/settings_controller_spec.rb index eaf99679a17ad40cea1ebd1ba18343a3092c7fac..34f6bbdae0e830a569ef589f200b4c5bda48f19d 100644 --- a/spec/controllers/admin/settings_controller_spec.rb +++ b/spec/controllers/admin/settings_controller_spec.rb @@ -62,22 +62,6 @@ RSpec.describe Admin::SettingsController, type: :controller do expect(Setting.site_title).to eq 'New title' end end - - context do - around do |example| - open_registrations = Setting.open_registrations - example.run - Setting.open_registrations = open_registrations - end - - it 'typecasts open_registrations to boolean' do - Setting.open_registrations = false - patch :update, params: { form_admin_settings: { open_registrations: '1' } } - - expect(response).to redirect_to(edit_admin_settings_path) - expect(Setting.open_registrations).to eq true - end - end end end end diff --git a/spec/controllers/auth/registrations_controller_spec.rb b/spec/controllers/auth/registrations_controller_spec.rb index eeb01d5ada51a631a58ef0c754408051c71e436e..1095df034e886f360ab1c6ae695a9c9cef58b152 100644 --- a/spec/controllers/auth/registrations_controller_spec.rb +++ b/spec/controllers/auth/registrations_controller_spec.rb @@ -5,14 +5,14 @@ RSpec.describe Auth::RegistrationsController, type: :controller do shared_examples 'checks for enabled registrations' do |path| around do |example| - open_registrations = Setting.open_registrations + registrations_mode = Setting.registrations_mode example.run - Setting.open_registrations = open_registrations + Setting.registrations_mode = registrations_mode end it 'redirects if it is in single user mode while it is open for registration' do Fabricate(:account) - Setting.open_registrations = true + Setting.registrations_mode = 'open' expect(Rails.configuration.x).to receive(:single_user_mode).and_return(true) get path @@ -21,7 +21,7 @@ RSpec.describe Auth::RegistrationsController, type: :controller do end it 'redirects if it is not open for registration while it is not in single user mode' do - Setting.open_registrations = false + Setting.registrations_mode = 'none' expect(Rails.configuration.x).to receive(:single_user_mode).and_return(false) get path @@ -55,13 +55,13 @@ RSpec.describe Auth::RegistrationsController, type: :controller do context do around do |example| - open_registrations = Setting.open_registrations + registrations_mode = Setting.registrations_mode example.run - Setting.open_registrations = open_registrations + Setting.registrations_mode = registrations_mode end it 'returns http success' do - Setting.open_registrations = true + Setting.registrations_mode = 'open' get :new expect(response).to have_http_status(200) end @@ -83,13 +83,13 @@ RSpec.describe Auth::RegistrationsController, type: :controller do context do around do |example| - open_registrations = Setting.open_registrations + registrations_mode = Setting.registrations_mode example.run - Setting.open_registrations = open_registrations + Setting.registrations_mode = registrations_mode end subject do - Setting.open_registrations = true + Setting.registrations_mode = 'open' request.headers["Accept-Language"] = accept_language post :create, params: { user: { account_attributes: { username: 'test' }, email: 'test@example.com', password: '12345678', password_confirmation: '12345678' } } end diff --git a/spec/controllers/concerns/account_controller_concern_spec.rb b/spec/controllers/concerns/account_controller_concern_spec.rb index 93685103fcbbeb3e311f83b14b2db2f0b84a825b..ea2b4a2a1deb1d62da709029b1a6ae95d48bc806 100644 --- a/spec/controllers/concerns/account_controller_concern_spec.rb +++ b/spec/controllers/concerns/account_controller_concern_spec.rb @@ -17,7 +17,15 @@ describe ApplicationController, type: :controller do context 'when account is suspended' do it 'returns http gone' do - account = Fabricate(:account, suspended: true) + account = Fabricate(:account, suspended: true, user: Fabricate(:user)) + get 'success', params: { account_username: account.username } + expect(response).to have_http_status(410) + end + end + + context 'when account is deleted by owner' do + it 'returns http gone' do + account = Fabricate(:account, suspended: true, user: nil) get 'success', params: { account_username: account.username } expect(response).to have_http_status(410) end @@ -25,19 +33,19 @@ describe ApplicationController, type: :controller do context 'when account is not suspended' do it 'assigns @account' do - account = Fabricate(:account) + account = Fabricate(:account, user: Fabricate(:user)) get 'success', params: { account_username: account.username } expect(assigns(:account)).to eq account end it 'sets link headers' do - account = Fabricate(:account, username: 'username') + account = Fabricate(:account, username: 'username', user: Fabricate(:user)) get 'success', params: { account_username: 'username' } expect(response.headers['Link'].to_s).to eq '<http://test.host/.well-known/webfinger?resource=acct%3Ausername%40cb6e6126.ngrok.io>; rel="lrdd"; type="application/xrd+xml", <http://test.host/users/username.atom>; rel="alternate"; type="application/atom+xml", <https://cb6e6126.ngrok.io/users/username>; rel="alternate"; type="application/activity+json"' end it 'returns http success' do - account = Fabricate(:account) + account = Fabricate(:account, user: Fabricate(:user)) get 'success', params: { account_username: account.username } expect(response).to have_http_status(200) end diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index 61780b46b929ef26ad2cb1625e41b5b85104f9ef..f09e32ecc2bd1b69dbfd49da111440f171d52a16 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -69,7 +69,7 @@ describe ApplicationHelper do describe 'open_registrations?' do it 'returns true when open for registrations' do without_partial_double_verification do - expect(Setting).to receive(:open_registrations).and_return(true) + expect(Setting).to receive(:registrations_mode).and_return('open') end expect(helper.open_registrations?).to eq true @@ -77,7 +77,7 @@ describe ApplicationHelper do it 'returns false when closed for registrations' do without_partial_double_verification do - expect(Setting).to receive(:open_registrations).and_return(false) + expect(Setting).to receive(:registrations_mode).and_return('none') end expect(helper.open_registrations?).to eq false diff --git a/spec/presenters/instance_presenter_spec.rb b/spec/presenters/instance_presenter_spec.rb index 0babc1b0c8a36e1e47e034acf05674a11bbf81e4..93a4e88e4136f5ac4801ec68d9505d3038612f1b 100644 --- a/spec/presenters/instance_presenter_spec.rb +++ b/spec/presenters/instance_presenter_spec.rb @@ -31,34 +31,6 @@ describe InstancePresenter do end end - context do - around do |example| - open_registrations = Setting.open_registrations - example.run - Setting.open_registrations = open_registrations - end - - it "delegates open_registrations to Setting" do - Setting.open_registrations = false - - expect(instance_presenter.open_registrations).to eq false - end - end - - context do - around do |example| - closed_registrations_message = Setting.closed_registrations_message - example.run - Setting.closed_registrations_message = closed_registrations_message - end - - it "delegates closed_registrations_message to Setting" do - Setting.closed_registrations_message = "Closed message" - - expect(instance_presenter.closed_registrations_message).to eq "Closed message" - end - end - context do around do |example| site_contact_email = Setting.site_contact_email diff --git a/spec/services/app_sign_up_service_spec.rb b/spec/services/app_sign_up_service_spec.rb index d480df34808ce3c62a48d3109df3cca2e9e5bd18..7948bb53be10e4546129e1bd3fd6674f2f422a66 100644 --- a/spec/services/app_sign_up_service_spec.rb +++ b/spec/services/app_sign_up_service_spec.rb @@ -8,8 +8,10 @@ RSpec.describe AppSignUpService, type: :service do describe '#call' do it 'returns nil when registrations are closed' do - Setting.open_registrations = false + tmp = Setting.registrations_mode + Setting.registrations_mode = 'none' expect(subject.call(app, good_params)).to be_nil + Setting.registrations_mode = tmp end it 'raises an error when params are missing' do