about summary refs log tree commit diff
path: root/app/controllers/admin/accounts_controller.rb
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2018-12-16 15:26:50 +0100
committerGitHub <noreply@github.com>2018-12-16 15:26:50 +0100
commit396c5dea87f259255f3676bb7b30f5cfdfec9d4e (patch)
tree33c64f250983b0d8c07bad2a0ec970539e78b1d6 /app/controllers/admin/accounts_controller.rb
parentf0505a5b2e727da73c8aa651b804508a8187a3c4 (diff)
parent7238e4ea5f4f619396f73009032844d95bdf809c (diff)
Merge pull request #856 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/controllers/admin/accounts_controller.rb')
-rw-r--r--app/controllers/admin/accounts_controller.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/app/controllers/admin/accounts_controller.rb b/app/controllers/admin/accounts_controller.rb
index f155543ce..771302db8 100644
--- a/app/controllers/admin/accounts_controller.rb
+++ b/app/controllers/admin/accounts_controller.rb
@@ -2,7 +2,7 @@
 
 module Admin
   class AccountsController < BaseController
-    before_action :set_account, only: [:show, :subscribe, :unsubscribe, :redownload, :remove_avatar, :enable, :disable, :memorialize]
+    before_action :set_account, only: [:show, :subscribe, :unsubscribe, :redownload, :remove_avatar, :remove_header, :enable, :disable, :memorialize]
     before_action :require_remote_account!, only: [:subscribe, :unsubscribe, :redownload]
     before_action :require_local_account!, only: [:enable, :disable, :memorialize]
 
@@ -71,6 +71,17 @@ module Admin
       redirect_to admin_account_path(@account.id)
     end
 
+    def remove_header
+      authorize @account, :remove_header?
+
+      @account.header = nil
+      @account.save!
+
+      log_action :remove_header, @account.user
+
+      redirect_to admin_account_path(@account.id)
+    end
+
     private
 
     def set_account