scinote-web/app/utilities/subdomain.rb
2016-12-01 14:20:43 +01:00

23 lines
No EOL
485 B
Ruby

class UserSubdomain
def self.matches?(request)
if ENV['USER_SUBDOMAIN']
return (request.subdomain.present? && request.subdomain == ENV['USER_SUBDOMAIN'])
else
return true
end
end
end
class WopiSubdomain
def self.matches?(request)
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
end
end