add action base and update base ctrls
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
class ApplicationController < ActionController::Base
|
||||
include LicenseVerification
|
||||
include LoginVerification
|
||||
|
||||
#before_action :check_installation
|
||||
protect_from_forgery with: :exception
|
||||
|
||||
# lookup domain for db from provision
|
||||
before_action :set_locale
|
||||
# before_action :set_locale
|
||||
|
||||
helper_method :current_company,:current_login_employee,:current_user
|
||||
# alias_method :current_user, :current_login_employee,:current_user
|
||||
@@ -13,16 +13,6 @@ class ApplicationController < ActionController::Base
|
||||
#all token authentication must be done here
|
||||
#response format must be set to JSON
|
||||
|
||||
#change locallization
|
||||
def set_locale
|
||||
I18n.locale = params[:locale] || I18n.default_locale
|
||||
end
|
||||
|
||||
# RESTful url for localize
|
||||
def default_url_options
|
||||
{ locale: I18n.locale }
|
||||
end
|
||||
|
||||
rescue_from CanCan::AccessDenied do |exception|
|
||||
flash[:warning] = exception.message
|
||||
redirect_to root_path
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
class BaseCrmController < ApplicationController
|
||||
class BaseCrmController < ActionController::Base
|
||||
include LoginVerification
|
||||
layout "CRM"
|
||||
|
||||
#before_action :check_installation
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
class BaseInventoryController < ApplicationController
|
||||
class BaseInventoryController < ActionController::Base
|
||||
include LoginVerification
|
||||
layout "inventory"
|
||||
|
||||
#before_action :check_installation
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
class BaseOqsController < ApplicationController
|
||||
class BaseOqsController < ActionController::Base
|
||||
include LoginVerification
|
||||
layout "OQS"
|
||||
|
||||
#before_action :check_installation
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
class BaseOrigamiController < ApplicationController
|
||||
class BaseOrigamiController < ActionController::Base
|
||||
include LoginVerification
|
||||
layout "origami"
|
||||
|
||||
# before_action :checkin_process
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
class BaseReportController < ApplicationController
|
||||
layout "application"
|
||||
class BaseReportController < ActionController::Base
|
||||
include LoginVerification
|
||||
layout "application"
|
||||
|
||||
#before_action :check_installation
|
||||
protect_from_forgery with: :exception
|
||||
#before_action :check_installation
|
||||
protect_from_forgery with: :exception
|
||||
|
||||
rescue_from CanCan::AccessDenied do |exception|
|
||||
rescue_from CanCan::AccessDenied do |exception|
|
||||
flash[:warning] = exception.message
|
||||
redirect_to root_path
|
||||
end
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
class BaseWaiterController < ApplicationController
|
||||
class BaseWaiterController < ActionController::Base
|
||||
include LoginVerification
|
||||
layout "waiter"
|
||||
|
||||
#before_action :check_installation
|
||||
|
||||
@@ -2,7 +2,7 @@ module LoginVerification
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
included do
|
||||
before_action :authenticate_session_token
|
||||
before_action :authenticate
|
||||
helper_method :current_company,:current_login_employee
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user