This commit is contained in:
Yan
2017-11-28 18:10:17 +06:30
parent f33be9e707
commit b394643991
2 changed files with 13 additions and 6 deletions

View File

@@ -55,10 +55,11 @@ class ApplicationController < ActionController::Base
def cache_license(url, lookup)
flag = ENV["AES_IV"]
@license = License.new(url, lookup)
# Export for Key
@license = License.new(url, lookup)
# Check Exists IV
if flag == "<%= ENV['AES_IV'] %>"
# Export for Key
aes = MyAesCrypt.new
aes_key, aes_iv = aes.export_key(lookup)
else

View File

@@ -13,10 +13,16 @@ class InstallController < BaseController
db_schema = params[:db_schema]
db_user = params[:db_user]
db_password = params[:db_password]
# Export for Key
aes = MyAesCrypt.new
aes_key, aes_iv = aes.export_key(license_key)
# Check Exists IV
if flag == "<%= ENV['AES_IV'] %>"
# Export for Key
aes = MyAesCrypt.new
aes_key, aes_iv = aes.export_key(lookup)
else
aes_key = ENV["AES_KEY"]
aes_iv = ENV["AES_IV"]
end
@license = License.new(ENV["SX_PROVISION_URL"])
response = @license.license_activate(aes_key, aes_iv, license_key, db_host, db_schema, db_user, db_password)