Commit 90ad01d1 authored by Rob Colbert's avatar Rob Colbert

gabctl accounts delete|suspend separated

`gabctl accounts suspend` does not remove user (can be undone).
`gabctl accounts delete` does remove user (cannot be undone).
parent 040f7c51
...@@ -170,7 +170,7 @@ module GabSocial ...@@ -170,7 +170,7 @@ module GabSocial
desc 'delete USERNAME', 'Delete a user' desc 'delete USERNAME', 'Delete a user'
long_desc <<-LONG_DESC long_desc <<-LONG_DESC
Remove a user account with a given USERNAME. Suspend the account matching USERNAME and remove the associated user (can't be undone).
def delete(username) def delete(username)
account = Account.find_local(username) account = Account.find_local(username)
...@@ -180,7 +180,7 @@ module GabSocial ...@@ -180,7 +180,7 @@ module GabSocial
exit(1) exit(1)
end end
say("Deleting user with #{account.statuses_count} statuses, this might take a while...") say("Suspending account, removing #{account.statuses_count} statuses and user..."), including_user: true), including_user: true)
say('OK', :green) say('OK', :green)
end end
...@@ -439,6 +439,23 @@ module GabSocial ...@@ -439,6 +439,23 @@ module GabSocial
end end
end end
desc 'suspend USERNAME', 'Suspend a user'
long_desc <<-LONG_DESC
Suspend the user account with the given USERNAME (can be undone).
def suspend(username)
account = Account.find_local(username)
if account.nil?
say('No user with such username', :red)
say("Suspending user and removing #{account.statuses_count} statuses..."), including_user: false)
say('OK', :green)
option :number, type: :numeric, aliases: [:n] option :number, type: :numeric, aliases: [:n]
option :all, type: :boolean option :all, type: :boolean
desc 'approve [USERNAME]', 'Approve pending accounts' desc 'approve [USERNAME]', 'Approve pending accounts'
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment