update multi_tenancy/license
This commit is contained in:
@@ -219,26 +219,22 @@ class License
|
||||
|
||||
# read line by key for license file
|
||||
def read_license(key_name)
|
||||
decrypted_line = ""
|
||||
key, iv = get_redis_key()
|
||||
|
||||
if File.exist?("config/license.yml")
|
||||
if license = YAML.load(File.read("config/license.yml"))
|
||||
decrypted_line = AESCrypt.decrypt_data(decode_str(license[lookup][key_name]), decode_str(key), decode_str(iv), ENV['CIPHER_TYPE'])
|
||||
AESCrypt.decrypt_data(decode_str(license[lookup][key_name]), decode_str(key), decode_str(iv), ENV['CIPHER_TYPE'])
|
||||
end
|
||||
end
|
||||
return decrypted_line
|
||||
end
|
||||
|
||||
# read line by key for license file without decrypt
|
||||
def read_license_no_decrypt(key)
|
||||
decrypted_line = ""
|
||||
if File.exist?("config/license.yml")
|
||||
if license = YAML.load_file("config/license.yml")
|
||||
decrypted_line = license[lookup][key]
|
||||
end
|
||||
end
|
||||
return decrypted_line
|
||||
end
|
||||
|
||||
# Update license file for line
|
||||
@@ -255,11 +251,6 @@ class License
|
||||
|
||||
# To write changes to the file, use:
|
||||
File.open("config/license.yml", "w") {|file| file.write(license.to_yaml) }
|
||||
|
||||
# File.open("config/license.yml").each do |line|
|
||||
# new_file_str = line.gsub(content, crypted_str)
|
||||
# f.put
|
||||
# end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -306,6 +297,7 @@ class License
|
||||
redis = Redis.new
|
||||
cache_shop = redis.get(cache_key)
|
||||
|
||||
puts Marshal.load(cache_shop)
|
||||
if !cache_shop.nil?
|
||||
@shop = Marshal.load(cache_shop)
|
||||
key = @shop["key"]
|
||||
|
||||
Reference in New Issue
Block a user