update action controller
This commit is contained in:
@@ -13,7 +13,7 @@ module MultiTenancy
|
|||||||
end
|
end
|
||||||
|
|
||||||
def find_tenant_by_subdomain_or_frist
|
def find_tenant_by_subdomain_or_frist
|
||||||
if request.subdomains.last && request.subdomains.last != 'www'
|
if request.subdomains.last && request.subdomains.last != "www"
|
||||||
set_current_tenant(Shop.find_by(subdomain: request.subdomains.last))
|
set_current_tenant(Shop.find_by(subdomain: request.subdomains.last))
|
||||||
elsif ENV["SERVER_MODE"] == "application"
|
elsif ENV["SERVER_MODE"] == "application"
|
||||||
set_current_tenant(Shop.first)
|
set_current_tenant(Shop.first)
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ class ActionController::Base
|
|||||||
end
|
end
|
||||||
elsif request.subdomain.present? && request.subdomain != "www" || ENV["SERVER_MODE"] == "application"
|
elsif request.subdomain.present? && request.subdomain != "www" || ENV["SERVER_MODE"] == "application"
|
||||||
# check for license file
|
# check for license file
|
||||||
if check_license
|
if check_license(request.host)
|
||||||
current_license(ENV["SX_PROVISION_URL"])
|
current_license(ENV["SX_PROVISION_URL"], request.host)
|
||||||
else
|
else
|
||||||
redirect_to activate_path
|
redirect_to activate_path
|
||||||
end
|
end
|
||||||
@@ -37,8 +37,8 @@ class ActionController::Base
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def current_license(url)
|
def current_license(url, lookup)
|
||||||
@license = License.new(url)
|
@license = License.new(url, lookup)
|
||||||
flag = @license.detail_with_local_file()
|
flag = @license.detail_with_local_file()
|
||||||
if (flag == 0)
|
if (flag == 0)
|
||||||
flash[:notice] = 'Expired or No License!'
|
flash[:notice] = 'Expired or No License!'
|
||||||
@@ -59,8 +59,8 @@ class ActionController::Base
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def check_license
|
def check_license(lookup)
|
||||||
License.check_license_file
|
License.check_license_file(lookup)
|
||||||
end
|
end
|
||||||
|
|
||||||
def check_installation
|
def check_installation
|
||||||
|
|||||||
Reference in New Issue
Block a user