move check license to action controler

This commit is contained in:
Yan
2018-04-19 16:40:59 +06:30
parent f8a247c61a
commit 1187ddba37
2 changed files with 15 additions and 17 deletions

View File

@@ -53,16 +53,4 @@ module LoginVerification
def render_unauthorized
redirect_to root_path
end
private
def check_license
License.check_license_file
end
def check_installation
if current_company.nil?
redirect_to install_path
end
end
end

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
@@ -50,6 +50,16 @@ class ActionController::Base
end
end
def check_license
License.check_license_file
end
def check_installation
if current_company.nil?
redirect_to install_path
end
end
def website_connection(license)
default_connection.dup.update(:host => license.dbhost, :database => license.dbschema.to_s.downcase,
:username => license.dbusername, :password => license.dbpassword)