update license and login dashboard

This commit is contained in:
Aung Myo
2018-04-04 09:43:02 +06:30
parent b0d7c3b1b8
commit 17562f6fcf
4 changed files with 19 additions and 9 deletions

View File

@@ -140,20 +140,30 @@ class License
@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
rescue SocketError => e
Rails.logger.debug "In SocketError No Internet connection ! "
return true
rescue HTTParty::Error
Rails.logger.debug "Server Error HTTParty"
return true
rescue Net::OpenTimeout
Rails.logger.debug "connection Timeout"
return true
rescue OpenURI::HTTPError
Rails.logger.debug "Can't connect server"
return true
end
return false
end
# Check Expired before 30 days
def check_expiring(renewal_date_str)
if !renewal_date_str.empty?