license updated

This commit is contained in:
Yan
2017-12-22 16:33:12 +06:30
parent 3be8a56ac6
commit da4af7bfc5
8 changed files with 250 additions and 260 deletions

View File

@@ -1,6 +1,6 @@
class InstallController < BaseController
skip_before_action :verify_authenticity_token
before_action :check_license
# before_action :check_license
def index
end
@@ -17,20 +17,20 @@ class InstallController < BaseController
db_schema = params[:db_schema]
db_user = params[:db_user]
db_password = params[:db_password]
phrase = license_key
phrase = license_key
# Check Exists IV
if flag == "<%= ENV['AES_IV'] %>"
# Export for Key
aes = MyAesCrypt.new
aes_key, aes_iv = aes.export_key(phrase)
else
aes_key = ENV["AES_KEY"]
aes_iv = ENV["AES_IV"]
end
# if flag == "<%= ENV['AES_IV'] %>"
# # Export for Key
# aes = MyAesCrypt.new
# aes_key, aes_iv = aes.export_key(phrase)
# 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)
response = @license.license_activate(restaurant, license_key, db_host, db_schema, db_user, db_password)
if response[:status]
redirect_to root_url, notice: response["message"]
else
@@ -38,7 +38,7 @@ class InstallController < BaseController
end
end
def check_license
def check_license
if License.check_license_file
redirect_to root_url
end