discourse/app/controllers
David Taylor 0d0d78841b
FIX: Remove `plugin.enabled?` checks at initialization time (#6166)
Checking `plugin.enabled?` while initializing plugins causes issues in two ways:
  - An application restart is required for changes to take effect. A load-balanced multi-server environment could behave very weirdly if containers restart at different times.
  - In a multisite environment, it takes the `enabled?` setting from the default site. Changes on that site affect all other sites in the cluster.

Instead, `plugin.enabled?` should be checked at runtime, in the context of a request. This commit removes `plugin.enabled?` from many `instance.rb` methods.

I have added a working `plugin.enabled?` implementation for methods that actually affect security/functionality:
  - `post_custom_fields_whitelist`
  - `whitelist_staff_user_custom_field`
  - `add_permitted_post_create_param`
2018-07-25 16:44:09 +01:00
..
admin FIX: Translation for default (light) color scheme was missing 2018-07-25 11:28:14 +02:00
users FEATURE: List, revoke and reconnect associated accounts. Phase 1 (#6099) 2018-07-23 16:51:57 +01:00
about_controller.rb Refactor requires login logic, reduce duplicate code 2018-02-01 15:17:59 +11:00
application_controller.rb FEATURE: Groundwork for user-selectable theme components 2018-07-12 14:18:21 +10:00
badges_controller.rb PERF: N+1 queries on badges page. 2018-03-19 14:36:09 +08:00
categories_controller.rb FEATURE: navigate to first post and auto bump category settings 2018-07-16 18:10:35 +10:00
category_hashtags_controller.rb Refactor requires login logic, reduce duplicate code 2018-02-01 15:17:59 +11:00
clicks_controller.rb Make rubocop happy again. 2018-06-07 13:28:18 +08:00
composer_controller.rb Refactor requires login logic, reduce duplicate code 2018-02-01 15:17:59 +11:00
composer_messages_controller.rb Refactor requires login logic, reduce duplicate code 2018-02-01 15:17:59 +11:00
directory_items_controller.rb make 🤖 rubocop happy 2018-05-16 16:35:04 +02:00
draft_controller.rb Refactor requires login logic, reduce duplicate code 2018-02-01 15:17:59 +11:00
email_controller.rb FIX: stop adding email to unsubscribe url 2018-05-22 09:07:03 +10:00
embed_controller.rb Make rubocop happy again. 2018-06-07 13:28:18 +08:00
exceptions_controller.rb Make rubocop happy again. 2018-06-07 13:28:18 +08:00
export_csv_controller.rb Make rubocop happy again. 2018-06-07 13:28:18 +08:00
extra_locales_controller.rb simplify production switch and serve extra locales from actual site 2018-01-10 08:19:51 +11:00
finish_installation_controller.rb Make rubocop happy again. 2018-06-07 13:28:18 +08:00
forums_controller.rb PERF: add frozen strings 2018-01-15 12:44:54 +11:00
groups_controller.rb FIX: raise invalid params for bad callback 2018-06-29 10:43:33 +10:00
highlight_js_controller.rb Fix all the errors to get our tests green on Rails 5.1. 2017-09-25 13:48:58 +08:00
inline_onebox_controller.rb Refactor requires login logic, reduce duplicate code 2018-02-01 15:17:59 +11:00
invites_controller.rb FIX: do not use scheduler for uploading csv file for invite 2018-07-04 13:28:11 +05:30
list_controller.rb FIX: if exclude_category_ids is specified pass it through 2018-07-23 17:23:00 +10:00
metadata_controller.rb FIX: start_url was wrong in non-subfolder 2018-06-15 14:29:33 -03:00
notifications_controller.rb Make rubocop happy again. 2018-06-07 13:28:18 +08:00
offline_controller.rb FIX: offline controller regression 2017-10-31 15:44:50 +11:00
onebox_controller.rb FIX: include title in local onebox when linking to a different topic 2018-02-19 22:40:14 +01:00
permalinks_controller.rb Fix all the errors to get our tests green on Rails 5.1. 2017-09-25 13:48:58 +08:00
post_action_users_controller.rb UX: cap likes 2 (#5237) 2017-11-15 11:28:54 +11:00
post_actions_controller.rb FIX: Properly display error when post action fails to create. 2018-06-20 21:20:23 +08:00
posts_controller.rb FIX: Remove `plugin.enabled?` checks at initialization time (#6166) 2018-07-25 16:44:09 +01:00
push_notification_controller.rb Feature: Push notifications for Android (#5792) 2018-05-04 15:31:48 -07:00
queued_posts_controller.rb FIX: allow staff to remove tags from queued topics 2018-06-26 17:08:40 +05:30
qunit_controller.rb DEV: remove qunit rails fork and add a couple of async tests 2018-04-23 16:42:40 +10:00
robots_txt_controller.rb FEATURE: block top level /my/ routes 2018-06-12 19:47:45 +10:00
safe_mode_controller.rb Allow staff members to enable safe mode, even if disabled 2018-04-25 11:49:57 -04:00
search_controller.rb FEATURE: support search click through tracking for user, category and tags 2017-12-01 12:04:55 +05:30
session_controller.rb FEATURE: Second factor backup 2018-06-28 10:12:32 +02:00
similar_topics_controller.rb display 'similar to' earlier when composing a post 2017-09-16 01:03:29 +02:00
site_controller.rb FEATURE: selectable avatars 2018-07-18 12:57:43 +02:00
static_controller.rb FIX: add check for missing assets file in development 2018-06-11 11:18:34 -07:00
steps_controller.rb Refactor requires login logic, reduce duplicate code 2018-02-01 15:17:59 +11:00
stylesheets_controller.rb FEATURE: Groundwork for user-selectable theme components 2018-07-12 14:18:21 +10:00
tag_groups_controller.rb Make rubocop happy again. 2018-06-07 13:28:18 +08:00
tags_controller.rb Make rubocop happy again. 2018-06-07 13:28:18 +08:00
themes_controller.rb FEATURE: Groundwork for user-selectable theme components 2018-07-12 14:18:21 +10:00
topics_controller.rb Remove unnecessary complex method. 2018-07-13 15:34:28 +08:00
uploads_controller.rb Remove use of `rescue nil`. 2018-04-02 13:52:51 +08:00
user_actions_controller.rb FIX: Remove mentions filters from user and groups 2017-12-07 16:29:02 -05:00
user_api_keys_controller.rb Refactor requires login logic, reduce duplicate code 2018-02-01 15:17:59 +11:00
user_avatars_controller.rb FEATURE: limit assets less that non asset paths 2018-03-06 15:20:39 +11:00
user_badges_controller.rb Make rubocop happy again. 2018-06-07 13:28:18 +08:00
users_controller.rb FEATURE: List, revoke and reconnect associated accounts. Phase 1 (#6099) 2018-07-23 16:51:57 +01:00
users_email_controller.rb FEATURE: Second factor backup 2018-06-28 10:12:32 +02:00
webhooks_controller.rb Make rubocop happy again. 2018-06-07 13:28:18 +08:00
wizard_controller.rb Refactor requires login logic, reduce duplicate code 2018-02-01 15:17:59 +11:00