2013-03-28 08:01:13 -05:00
|
|
|
class HomePageConstraint
|
|
|
|
def initialize(filter)
|
|
|
|
@filter = filter
|
|
|
|
end
|
|
|
|
|
|
|
|
def matches?(request)
|
2016-10-18 10:44:25 -05:00
|
|
|
return @filter == 'finish_installation' if SiteSetting.has_login_hint?
|
|
|
|
|
2013-10-08 23:10:37 -05:00
|
|
|
provider = Discourse.current_user_provider.new(request.env)
|
|
|
|
homepage = provider.current_user ? SiteSetting.homepage : SiteSetting.anonymous_homepage
|
2013-03-28 08:01:13 -05:00
|
|
|
homepage == @filter
|
2017-01-05 23:18:04 -06:00
|
|
|
rescue Discourse::InvalidAccess
|
|
|
|
false
|
2013-03-28 08:01:13 -05:00
|
|
|
end
|
2013-10-08 23:10:37 -05:00
|
|
|
end
|