fix license

This commit is contained in:
Thein Lin Kyaw
2020-01-29 23:18:15 +06:30
parent be65bcb876
commit 6b5fd4d388

View File

@@ -223,19 +223,23 @@ class License
if File.exist?("config/license.yml") if File.exist?("config/license.yml")
if license = YAML.load(File.read("config/license.yml")) if license = YAML.load(File.read("config/license.yml"))
if license[lookup]
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
end end
end end
end
# read line by key for license file without decrypt # read line by key for license file without decrypt
def read_license_no_decrypt(key) def read_license_no_decrypt(key)
if File.exist?("config/license.yml") if File.exist?("config/license.yml")
if license = YAML.load_file("config/license.yml") if license = YAML.load_file("config/license.yml")
if license[lookup]
decrypted_line = license[lookup][key] decrypted_line = license[lookup][key]
end end
end end
end end
end
# Update license file for line # Update license file for line
def update_license(content, new_content) def update_license(content, new_content)