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

@@ -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