about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-05-03 10:16:49 +0200
committerClaire <claire.github-309c@sitedethib.com>2022-05-03 10:16:49 +0200
commit3869daef0937cf98f6a79f5c4543ee11724f37e8 (patch)
treed4b9c43975058d6e23eff874a9813a67125bbec3 /lib
parentcb9a919ff28294a2f1cf3642a165ad433cbf856b (diff)
parent7e244879feaa8de9894e1147ff49a7e762fe462a (diff)
Merge branch 'main' into glitch-soc/merge-upstream
Conflicts:
- `package.json`:
  Not really a conflict, upstream updated a dependency textually adjacent to a
  glitch-soc-only one.
  Updated the dependency as upstream did.
Diffstat (limited to 'lib')
-rw-r--r--lib/mastodon/settings_cli.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/mastodon/settings_cli.rb b/lib/mastodon/settings_cli.rb
index 061650a80..488c655de 100644
--- a/lib/mastodon/settings_cli.rb
+++ b/lib/mastodon/settings_cli.rb
@@ -16,6 +16,20 @@ module Mastodon
       say('OK', :green)
     end
 
+    desc 'approved', 'Open approval-based registrations'
+    option :require_reason, type: :boolean, aliases: [:require_invite_text]
+    long_desc <<~LONG_DESC
+      Set registrations to require review from staff.
+
+      With --require-reason, require users to enter a reason when registering,
+      otherwise this field is optional.
+    LONG_DESC
+    def approved
+      Setting.registrations_mode = 'approved'
+      Setting.require_invite_text = options[:require_reason] unless options[:require_reason].nil?
+      say('OK', :green)
+    end
+
     desc 'close', 'Close registrations'
     def close
       Setting.registrations_mode = 'none'