move check license to action controler
This commit is contained in:
@@ -53,16 +53,4 @@ module LoginVerification
|
|||||||
def render_unauthorized
|
def render_unauthorized
|
||||||
redirect_to root_path
|
redirect_to root_path
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
|
||||||
def check_license
|
|
||||||
License.check_license_file
|
|
||||||
end
|
|
||||||
|
|
||||||
def check_installation
|
|
||||||
if current_company.nil?
|
|
||||||
redirect_to install_path
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -20,11 +20,11 @@ class ActionController::Base
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
#check for license file
|
#check for license file
|
||||||
# if check_license
|
if check_license
|
||||||
# current_license(ENV["SX_PROVISION_URL"])
|
current_license(ENV["SX_PROVISION_URL"])
|
||||||
# else
|
else
|
||||||
# redirect_to activate_path
|
redirect_to activate_path
|
||||||
# end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -50,6 +50,16 @@ class ActionController::Base
|
|||||||
end
|
end
|
||||||
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)
|
def website_connection(license)
|
||||||
default_connection.dup.update(:host => license.dbhost, :database => license.dbschema.to_s.downcase,
|
default_connection.dup.update(:host => license.dbhost, :database => license.dbschema.to_s.downcase,
|
||||||
:username => license.dbusername, :password => license.dbpassword)
|
:username => license.dbusername, :password => license.dbpassword)
|
||||||
|
|||||||
Reference in New Issue
Block a user