update license
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
class ActionController::Base
|
||||
before_action :lookup_domain if Rails.env.production?
|
||||
before_action :lookup_domain
|
||||
before_action :set_locale
|
||||
|
||||
helper_method :current_license,
|
||||
@@ -25,12 +25,10 @@ class ActionController::Base
|
||||
end
|
||||
elsif ENV["SERVER_MODE"] == "application" || request.subdomains.last && request.subdomains.last != "www"
|
||||
# check for license file
|
||||
if !check_license
|
||||
if ENV["SERVER_MODE"] == "application" || check_subdomain
|
||||
redirect_to activate_path
|
||||
else
|
||||
not_found
|
||||
end
|
||||
if !current_license.exists?
|
||||
redirect_to activate_path
|
||||
elsif current_license.expired?
|
||||
redirect_to review_license_path
|
||||
end
|
||||
else
|
||||
not_found
|
||||
@@ -53,15 +51,6 @@ class ActionController::Base
|
||||
current_license.check_license_subdomain
|
||||
end
|
||||
|
||||
def check_license
|
||||
if License.check_license_file(request.host)
|
||||
if current_license.expired?
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
def check_installation
|
||||
if current_company.nil?
|
||||
redirect_to install_path
|
||||
@@ -117,7 +106,7 @@ class ActionController::API
|
||||
not_found
|
||||
end
|
||||
elsif ENV["SERVER_MODE"] == "application" || (request.subdomains.last && request.subdomains.last != "www")
|
||||
not_found unless check_license
|
||||
not_found unless current_license.exists? && !current_license.expired?
|
||||
else
|
||||
not_found
|
||||
end
|
||||
@@ -135,15 +124,6 @@ class ActionController::API
|
||||
end
|
||||
end
|
||||
|
||||
def check_license
|
||||
if License.check_license_file(request.host)
|
||||
if current_license.expired?
|
||||
return false
|
||||
end
|
||||
return true
|
||||
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)
|
||||
|
||||
@@ -22,15 +22,17 @@ scope "(:locale)", locale: /en|mm/ do
|
||||
get 'get_key' => 'sym_control#get_key'
|
||||
|
||||
#--------- Login/Authentication ------------#
|
||||
get 'auth/:emp_id' => 'home#show', as: :emp_login
|
||||
patch "auth/:emp_id" => 'home#update', as: :emp_login_update
|
||||
get 'login' => 'sessions#index'
|
||||
get 'auth/:emp_id' => 'sessions#show', as: :emp_login
|
||||
patch "auth/:emp_id" => 'sessions#update', as: :emp_login_update
|
||||
|
||||
post 'login' => 'home#create'
|
||||
delete 'logout' => 'home#destroy'
|
||||
get 'dashboard' => 'home#dashboard'
|
||||
post 'login' => 'sessions#create'
|
||||
delete 'logout' => 'sessions#destroy'
|
||||
|
||||
get 'expire' => 'renew_license#expire'
|
||||
post 'renew' => 'renew_license#renew'
|
||||
get 'review_license' => 'review_license#index'
|
||||
post 'review_license' => 'review_license#create'
|
||||
|
||||
get 'dashboard' => 'dashboard#index'
|
||||
|
||||
namespace :induties do
|
||||
# resources :assign_in_duties
|
||||
|
||||
Reference in New Issue
Block a user