mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 07:11:34 +08:00
FEATURE: anonymized site statistics
This commit is contained in:
@ -3,7 +3,7 @@ require_dependency 'site_serializer'
|
||||
class SiteController < ApplicationController
|
||||
layout false
|
||||
skip_before_filter :preload_json, :check_xhr
|
||||
skip_before_filter :redirect_to_login_if_required, only: ['basic_info']
|
||||
skip_before_filter :redirect_to_login_if_required, only: ['basic_info', 'statistics']
|
||||
|
||||
def site
|
||||
render json: Site.json_for(guardian)
|
||||
@ -42,4 +42,9 @@ class SiteController < ApplicationController
|
||||
# this info is always available cause it can be scraped from a 404 page
|
||||
render json: results
|
||||
end
|
||||
|
||||
def statistics
|
||||
return redirect_to path('/') unless SiteSetting.share_anonymized_statistics?
|
||||
render json: About.fetch_cached_stats
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user