diff --git a/app/controllers/concerns/multi_tenancy.rb b/app/controllers/concerns/multi_tenancy.rb index b7579fe0..27e3670f 100644 --- a/app/controllers/concerns/multi_tenancy.rb +++ b/app/controllers/concerns/multi_tenancy.rb @@ -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) diff --git a/config/initializers/action_controller.rb b/config/initializers/action_controller.rb index e88e2d7d..d63c9325 100644 --- a/config/initializers/action_controller.rb +++ b/config/initializers/action_controller.rb @@ -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