Merge branch 'adminbsb_material_ui'

This commit is contained in:
Aung Myo
2018-03-05 17:02:09 +06:30
2 changed files with 29 additions and 12 deletions

View File

@@ -70,13 +70,11 @@ class License
# For Local System # For Local System
def detail_with_local_file() def detail_with_local_file()
renewal_date_str = read_license("renewable_date") renewal_date_str = read_license("renewable_date")
if check_expiring(renewal_date_str) if check_expiring(renewal_date_str)
# return for all ok # return for all ok
return 1 return 1
else else
has_license = verify_license() has_license = verify_license()
if has_license if has_license
# return for expiring # return for expiring
return 2 return 2
@@ -137,16 +135,20 @@ class License
api_token = read_license_no_decrypt("api_token") api_token = read_license_no_decrypt("api_token")
@params = { query: {lookup_type: "application", api_token: api_token} } @params = { query: {lookup_type: "application", api_token: api_token} }
response = self.class.get("/verify", @params) response = self.class.get("/verify", @params)
@varified = response.parsed_response
Rails.logger.debug "License Remote Response - " + response.parsed_response.to_s rescue SocketError => e
if (@varified["status"]) Rails.logger.debug "In Socket errror"
if (!check_expired(@varified["renewable_date"])) return true
return true rescue => e
@varified = response.parsed_response
Rails.logger.debug "License Remote Response - " + response.parsed_response.to_s
if (@varified["status"])
if (!check_expired(@varified["renewable_date"]))
return true
end
else
delete_license_file
end end
else
delete_license_file
end
return false return false
end end

15
config/license.yml Normal file
View File

@@ -0,0 +1,15 @@
iv_key: f3ICP0M2HJLIeXURn3yv5A==
shop_name: sx_license_test3
email: aungmyo.zaw@code2lab.com
telephone: 0099404923
fax: 49494949432
address: Yangon
dbhost: m4ZCds3ANyqjqCgZVSTfRQ==
dbschema: +mvY73HAjWqMrby9Zu+tBg==
dbusername: UO2rBxhoSfDEKutK2OEL4A==
dbpassword: sVpy+Lj6i3MpT+CjoJrDOw==
api_token: srTutEOCzphDFOXQqVWnZwQDTXiHdzwzY
app_token: pSzbojYfXLNpSLmhdNTfLCtxfzeUahO
plan_sku: +53eC6oiOsBRxtBgVjyULw==
renewable_date: hon6p5jvfirTFniaFrH0qw==
plan_name: eaMIWzHlTnljCEkE2oxoHg==