about summary refs log tree commit diff
path: root/app/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/admin/pubsubhubbub_controller.rb11
-rw-r--r--app/controllers/application_controller.rb4
2 files changed, 15 insertions, 0 deletions
diff --git a/app/controllers/admin/pubsubhubbub_controller.rb b/app/controllers/admin/pubsubhubbub_controller.rb
new file mode 100644
index 000000000..fae05bf9d
--- /dev/null
+++ b/app/controllers/admin/pubsubhubbub_controller.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+class Admin::PubsubhubbubController < ApplicationController
+  before_action :require_admin!
+
+  layout 'public'
+
+  def index
+    @subscriptions = Subscription.includes(:account).paginate(page: params[:page], per_page: 40)
+  end
+end
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 847763c65..b03a2cdea 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -31,6 +31,10 @@ class ApplicationController < ActionController::Base
     I18n.locale = I18n.default_locale
   end
 
+  def require_admin!
+    redirect_to root_path unless current_user&.admin?
+  end
+
   protected
 
   def not_found