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