Add site setting tos_accept_required. If enabled, users must check a box saying that they've read and accept the terms of service.

This commit is contained in:
Neil Lalonde
2014-02-07 16:04:00 -05:00
parent d769938660
commit e0df404d7e
8 changed files with 40 additions and 6 deletions

View File

@@ -211,8 +211,10 @@ class ApplicationController < ActionController::Base
def custom_html_json
MultiJson.dump({
top: SiteContent.content_for(:top),
bottom: SiteContent.content_for(:bottom),
})
bottom: SiteContent.content_for(:bottom)
}.merge(
(SiteSetting.tos_accept_required && !current_user) ? {tos_signup_form_message: SiteContent.content_for(:tos_signup_form_message)} : {}
))
end
def render_json_error(obj)