license updated
This commit is contained in:
@@ -36,20 +36,23 @@ class ApplicationController < ActionController::Base
|
||||
# redirect_to root_url(:host => request.domain) + "store_error"
|
||||
render :json => [{ status: false, message: 'Invalid Access!'}]
|
||||
end
|
||||
else
|
||||
else
|
||||
# check for license file
|
||||
if check_license
|
||||
current_license(ENV["SX_PROVISION_URL"])
|
||||
else
|
||||
redirect_to activate_path
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def current_license(url)
|
||||
@license = License.new(url)
|
||||
if (@license.detail_with_local_file() == 0)
|
||||
puts "Expired or No License!"
|
||||
elsif (@license.detail_with_local_file() == 2)
|
||||
puts "Expiring! pls, license extend..."
|
||||
flag = @license.detail_with_local_file()
|
||||
if (flag == 0)
|
||||
flash[:notice] = 'Expired or No License!'
|
||||
elsif (flag == 2)
|
||||
flash[:notice] = 'Expiring! Please, License extend...'
|
||||
else
|
||||
puts "RUN SAY BYAR"
|
||||
end
|
||||
@@ -108,9 +111,8 @@ class ApplicationController < ActionController::Base
|
||||
def check_license
|
||||
if License.check_license_file
|
||||
return true
|
||||
else
|
||||
redirect_to activate_path
|
||||
end
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user