From 4ce8fe48bc5544ad00001353b1d7d95ac44a21a2 Mon Sep 17 00:00:00 2001 From: Yan Date: Fri, 10 Nov 2017 14:15:05 +0630 Subject: [PATCH] license for master --- app/controllers/application_controller.rb | 6 +++--- app/models/license.rb | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index ce00dda9..896d0b5b 100755 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -38,13 +38,13 @@ class ApplicationController < ActionController::Base end end - def current_license(url, key) - @license = License.new(url, key) + def current_license(url, subdomain) + @license = License.new(url, subdomain) ##creating md5 hash md5_hostname = Digest::MD5.new md5key = md5_hostname.update(request.host) - if (@license.detail_with_local_cache(key, md5key.to_s) == true) + if (@license.detail_with_local_cache(subdomain, md5key.to_s) == true) #if (@license.detail == true) return @license diff --git a/app/models/license.rb b/app/models/license.rb index b2682213..2a8fca4e 100755 --- a/app/models/license.rb +++ b/app/models/license.rb @@ -50,7 +50,7 @@ class License if cache_license.nil? ##change the d/e key # @options = { query: {device: "SXlite", lookup: lookup, skey: @secret, token: SECRETS_CONFIG['provision_key']} } - @params = { query: { device: "SXlite", token: SECRETS_CONFIG['provision_key']} } + @params = { query: { lookup_type: "cloud", lookup: lookup, encrypted_key: SECRETS_CONFIG['provision_key']} } response = self.class.get("/request_license", @params) @license = response.parsed_response