mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-14 05:05:55 +08:00
25 lines
536 B
Ruby
25 lines
536 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
|