license test

This commit is contained in:
Yan
2018-02-21 10:12:05 +06:30
parent 867148a038
commit cd95d1d5c9
5 changed files with 29 additions and 13 deletions

View File

@@ -27,8 +27,9 @@ class ApplicationController < ActionController::Base
from = request.subdomain.downcase + "." + request.domain.downcase
@license = cache_license(ENV["SX_PROVISION_URL"], from) # request.subdomain.downcase
if (!@license.nil?)
# logger.info "Location - " + @license.name
# logger.info "Location - " + @license.name
ActiveRecord::Base.establish_connection(website_connection(@license))
authentication
# logger.info "Connecting to - " + @license.subdomain + " - "+ @license.dbhost + "@" + @license.dbschema
else
# reconnect_default_db
@@ -38,11 +39,11 @@ class ApplicationController < 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