discourse/app/controllers/admin
riking 1833b43ae2 FEATURE: Badge query validation, preview results, and EXPLAIN
Upon saving a badge or requesting a badge result preview,
BadgeGranter.contract_checks! will examine the provided badge SQL for
some contractual obligations - namely, the returned columns and use of
trigger parameters.

Saving the badge is wrapped in a transaction to make this easier, by
raising ActiveRecord::Rollback on a detected violation.

On the client, a modal view is added for the badge query sample run
results, named admin-badge-preview.
The preview action is moved up to the route.
The save action, on failure, triggers a 'saveError' action (also in the
route).

The preview action gains a new parameter, 'explain', which will give the
output of an EXPLAIN query for the badge sql, which can be used by forum
admins to estimate the cost of their badge queries.
The preview link is replaced by two links, one which omits (false) and
includes (true) the EXPLAIN query.

The Badge.save() method is amended to propogate errors.

Badge::Trigger gets some utility methods for use in the
BadgeGranter.contract_checks! method.

Additionally, extra checks outside of BadgeGranter.contract_checks! are
added in the preview() method, to cover cases of null granted_at
columns.

An uninitialized variable path is removed in the backfill() method.

TODO - it would be nice to be able to get the actual names of all
columns the provided query returns, so we could give more errors
2014-08-31 11:25:44 -07:00
..
admin_controller.rb :s/moderator?/staff/g ... our naming was kind of crazy, renamed moderator? to staff 2013-05-02 17:22:27 +10:00
api_controller.rb Perform the where(...).first to find_by(...) refactoring. 2014-05-06 14:41:59 +01:00
backups_controller.rb FEATURE: backup without uploads 2014-08-20 18:53:58 +02:00
badges_controller.rb FEATURE: Badge query validation, preview results, and EXPLAIN 2014-08-31 11:25:44 -07:00
color_schemes_controller.rb Theming: a UI to choose some base colors that are applied to all the site css. CSS compiled outside of asset pipeline. 2014-05-14 10:18:12 -04:00
dashboard_controller.rb Dashboard calculations are done with an async job now 2013-08-02 18:32:33 -04:00
diagnostics_controller.rb do a full GC prior to getting stats 2014-02-14 16:10:26 +11:00
email_controller.rb Not initializing variable for looping if unused in loop 2014-08-15 03:24:55 +05:30
export_csv_controller.rb FEATURE: export user list 2014-08-15 01:46:57 +05:30
flags_controller.rb FIX: disagree flag should unhide hidden post 2014-08-11 10:48:00 +02:00
groups_controller.rb FIX: #2664 it should be validates not validate 2014-08-18 14:40:54 +10:00
impersonate_controller.rb fix horribly broken invite code, could lead to inviting the wrong person to a conversation 2013-06-19 10:31:19 +10:00
reports_controller.rb Code to support EmberJS + Discourse Tutorial feature: Admin Reports 2013-02-27 22:40:36 -05:00
screened_emails_controller.rb FEATURE: admins can clear screend emails if needed 2014-06-02 16:53:00 +10:00
screened_ip_addresses_controller.rb A form to add ip addresses to be blocked or whitelisted 2013-10-24 17:19:10 -04:00
screened_urls_controller.rb Should have put order on the screened urls results 2013-11-04 16:31:31 -05:00
site_content_types_controller.rb Work in Progress: Content Editing in Admin Section 2013-04-04 17:26:22 -04:00
site_contents_controller.rb Support for custom Privacy Policies 2013-06-26 10:59:36 -04:00
site_customizations_controller.rb add query parameter to temporarily disable customization 2013-11-12 18:14:22 +01:00
site_settings_controller.rb Add ability to run validation on site settings. notification_email and other email address settings are now validated. 2014-06-09 16:59:20 -04:00
staff_action_logs_controller.rb FIX: moderators should not be able to see site setting changes in the staff action logs. Fixes #2027 2014-02-28 16:30:54 -05:00
users_controller.rb FIX: Display proper error message when changing a trust level fails 2014-07-29 15:54:20 -04:00
versions_controller.rb Add version checking that shows on the admin dashboard 2013-02-19 15:20:49 -05:00