From aa8c2621fc68b1a69612cf7ca3906b607a6a0285 Mon Sep 17 00:00:00 2001 From: Yan Date: Tue, 23 Jan 2018 14:40:32 +0630 Subject: [PATCH] add response in license --- app/controllers/application_controller.rb | 12 ++++++------ app/controllers/install_controller.rb | 2 +- app/models/license.rb | 2 ++ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 7fafd6bd..0966a573 100755 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -36,13 +36,13 @@ class ApplicationController < ActionController::Base # redirect_to root_url(:host => request.domain) + "store_error" render :json => [{ status: false, message: 'Invalid Access!'}] end - else + 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 diff --git a/app/controllers/install_controller.rb b/app/controllers/install_controller.rb index fac74926..353509c3 100755 --- a/app/controllers/install_controller.rb +++ b/app/controllers/install_controller.rb @@ -30,7 +30,7 @@ class InstallController < BaseController # end @license = License.new(ENV["SX_PROVISION_URL"]) - response = @license.license_activate(restaurant, license_key, db_host, db_schema, db_user, db_password) + response = @license.license_activate(restaurant, license_key, db_host, db_schema, db_user, db_password) if response[:status] redirect_to root_url, notice: response["message"] else diff --git a/app/models/license.rb b/app/models/license.rb index 869abe59..7732d764 100755 --- a/app/models/license.rb +++ b/app/models/license.rb @@ -405,6 +405,8 @@ class License else response = { "status": false, "message": "Activation is success but Symmetric Sql not found. \n Please contact code2lab call center!"} end + else + response = { "status": false, "message": "Activation is success but Cannot create Sym Tables. \n Please contact code2lab call center!"} end else response = { "status": false, "message": "Activation is success but Symmetric not running. \n Please contact code2lab call center!"}