check subdomain
This commit is contained in:
@@ -39,16 +39,18 @@ class InstallController < BaseController
|
||||
end
|
||||
|
||||
def lookup_domain
|
||||
if (ENV["SERVER_MODE"] == "application") ||
|
||||
(request.subdomain.present? && request.subdomain != "www" && ENV["SERVER_MODE"] != "cloud")
|
||||
if ENV["SERVER_MODE"] == "application"
|
||||
if check_license(request.host)
|
||||
redirect_to root_url
|
||||
else
|
||||
not_found unless check_subdomain(request.host)
|
||||
redirect_to root_url and return
|
||||
end
|
||||
elsif request.subdomains.last && request.subdomains.last != "www"
|
||||
if check_license(request.host)
|
||||
redirect_to root_url and return
|
||||
elsif check_subdomain(request.host)
|
||||
return
|
||||
end
|
||||
else
|
||||
not_found
|
||||
end
|
||||
not_found
|
||||
end
|
||||
|
||||
# def current_license(url, key)
|
||||
|
||||
@@ -199,7 +199,7 @@ class License
|
||||
aes = MyAesCrypt.new
|
||||
aes_key, aes_iv = aes.export_key(lookup)
|
||||
|
||||
params = { query: { lookup_type: self.server_mode, lookup: lookup, iv_key: aes_iv} }
|
||||
params = { query: { lookup_type: "cloud", lookup: lookup, iv_key: aes_iv} }
|
||||
response = self.class.get("/subdomain", params)
|
||||
response.parsed_response["status"]
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user