diff --git a/config/initializers/action_controller.rb b/config/initializers/action_controller.rb index 87a7cbe5..091abd33 100644 --- a/config/initializers/action_controller.rb +++ b/config/initializers/action_controller.rb @@ -4,8 +4,8 @@ class ActionController::Base private def lookup_domain - if request.subdomain.present? && request.subdomain != "www" - from = request.subdomain.downcase + "." + request.domain.downcase + if request.subdomains.last && request.subdomains.last != "www" && ENV["SERVER_CODE"] = "cloud" + from = request.host @license = cache_license(ENV["SX_PROVISION_URL"], from) # request.subdomain.downcase if (!@license.nil?) logger.info "Location - " + @license.dbschema @@ -20,11 +20,11 @@ class ActionController::Base end else # check for license file - # if check_license - # current_license(ENV["SX_PROVISION_URL"]) - # else - # redirect_to activate_path - # end + if check_license + current_license(ENV["SX_PROVISION_URL"]) + else + redirect_to activate_path + end end end