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?

View File

@@ -11,8 +11,8 @@
<link rel="icon" href="favicon.ico" type="image/x-icon">
<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css?family=Roboto:400,700&subset=latin,cyrillic-ext" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" type="text/css">
<!-- <link href="https://fonts.googleapis.com/css?family=Roboto:400,700&subset=latin,cyrillic-ext" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" type="text/css">-->
<%= stylesheet_link_tag 'login', media: 'all', 'data-turbolinks-track': 'reload' %>

View File

@@ -20,11 +20,11 @@ class ActionController::Base
end
else
# check for license file
# if check_license
# current_license(ENV["SX_PROVISION_URL"])
# else
# redirect_to activate_path
# end
if check_license
current_license(ENV["SX_PROVISION_URL"])
else
redirect_to activate_path
end
end
end

View File

@@ -12,7 +12,7 @@
development:
secret_key_base: b61d85f8ed2a1a9e0eeece3443b3e8f838d002cc1d9f32115d8e93db920e2957adfedc57501d44741211538f3108b742cdeada87d5bfae796c53da1f90a3cd61
sx_provision_url: connect.smartsales.dev/api #connect.smartsales.dev/api #connect.smartsales.asia/api #provision.zsai.ws/api
sx_provision_url: connect.smartsales.asia/api #connect.smartsales.dev/api #connect.smartsales.asia/api #provision.zsai.ws/api
server_mode: application
cipher_type: AES-256-CBC
sx_key: Wh@t1$C2L