2016-11-30 23:43:33 +08:00
|
|
|
class UserSubdomain
|
|
|
|
def self.matches?(request)
|
2016-12-21 23:52:15 +08:00
|
|
|
if ENV['USER_SUBDOMAIN']
|
|
|
|
return (request.subdomain.present? &&
|
|
|
|
request.subdomain == ENV['USER_SUBDOMAIN'])
|
|
|
|
else
|
|
|
|
return true
|
|
|
|
end
|
2016-11-30 23:43:33 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
class WopiSubdomain
|
|
|
|
def self.matches?(request)
|
2016-12-21 23:52:15 +08:00
|
|
|
if ENV['WOPI_ENABLED'] == 'true'
|
|
|
|
if ENV['WOPI_SUBDOMAIN']
|
|
|
|
return (request.subdomain.present? &&
|
|
|
|
request.subdomain == ENV['WOPI_SUBDOMAIN'])
|
|
|
|
else
|
|
|
|
return true
|
|
|
|
end
|
|
|
|
else
|
|
|
|
return false
|
|
|
|
end
|
2016-11-30 23:43:33 +08:00
|
|
|
end
|
2016-12-21 23:52:15 +08:00
|
|
|
end
|