licensing

This commit is contained in:
Yan
2017-11-14 16:06:17 +06:30
66 changed files with 985 additions and 398 deletions

View File

@@ -39,7 +39,16 @@ class ApplicationController < ActionController::Base
end
def cache_license()
@license = License.new(url, subdomain)
##creating md5 hash
md5_hostname = Digest::MD5.new
md5key = md5_hostname.update(request.host)
if (@license.detail_with_local_cache(subdomain, md5key.to_s) == true)
return @license
else
return nil
end
end
def current_license(url, key)
@@ -50,8 +59,6 @@ class ApplicationController < ActionController::Base
key, iv = AESEncDec.export_key(passphrase)
if (@license.detail_with_local_file(key, key, iv) == true)
#if (@license.detail == true)
return @license
else
return nil
@@ -100,7 +107,9 @@ class ApplicationController < ActionController::Base
private
def check_license
if License.check_license_file
# if !License.check_license_valid
# redirect_to install_path
# end
else
redirect_to install_path
end