update base controllers
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
class BaseCrmController < ApplicationController
|
||||
include LoginVerification
|
||||
layout "CRM"
|
||||
|
||||
#before_action :check_installation
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
class BaseInventoryController < ApplicationController
|
||||
include LoginVerification
|
||||
layout "inventory"
|
||||
|
||||
#before_action :check_installation
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
class BaseOqsController < ApplicationController
|
||||
include LoginVerification
|
||||
layout "OQS"
|
||||
|
||||
#before_action :check_installation
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
class BaseOrigamiController < ApplicationController
|
||||
include LoginVerification
|
||||
layout "origami"
|
||||
|
||||
# before_action :checkin_process
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
class BaseReportController < ApplicationController
|
||||
include LoginVerification
|
||||
layout "application"
|
||||
|
||||
#before_action :check_installation
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
class BaseWaiterController < ApplicationController
|
||||
include LoginVerification
|
||||
layout "waiter"
|
||||
|
||||
#before_action :check_installation
|
||||
|
||||
@@ -13,7 +13,7 @@ module LicenseVerification
|
||||
if (!@license.nil?)
|
||||
# logger.info "Location - " + @license.name
|
||||
ActiveRecord::Base.establish_connection(website_connection(@license))
|
||||
authenticate_session_token
|
||||
# authenticate_session_token
|
||||
# logger.info "Connecting to - " + @license.subdomain + " - "+ @license.dbhost + "@" + @license.dbschema
|
||||
else
|
||||
# reconnect_default_db
|
||||
@@ -40,6 +40,7 @@ module LicenseVerification
|
||||
@user = Employee.authenticate_by_token(token)
|
||||
if !@user
|
||||
flash[:notice] = 'Invalid Access!'
|
||||
redirect_to root_path
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -2,7 +2,7 @@ module LoginVerification
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
included do
|
||||
before_action :authenticate
|
||||
before_action :authenticate_session_token
|
||||
helper_method :current_company,:current_login_employee
|
||||
end
|
||||
|
||||
@@ -25,6 +25,7 @@ module LoginVerification
|
||||
#Maybe log - login?
|
||||
else
|
||||
flash[:notice] = 'Invalid Access!'
|
||||
# return false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
class HomeController < ApplicationController
|
||||
include LoginVerification
|
||||
# layout "application", except: [:index, :show]
|
||||
# skip_before_action only: [:index, :show, :create, :update, :destroy]
|
||||
|
||||
def index
|
||||
# @employees = Employee.all_emp_except_waiter.order("name asc")
|
||||
@employees = Employee.all.order("name asc")
|
||||
@login_form = LoginForm.new()
|
||||
@login_form = LoginForm.new()
|
||||
render "layouts/login_dashboard", layout: false
|
||||
end
|
||||
|
||||
@@ -56,7 +57,7 @@ class HomeController < ApplicationController
|
||||
render :index
|
||||
end
|
||||
else
|
||||
redirect_to origami_root_path, :notice => "Username and Password doesn't match!"
|
||||
redirect_to root_path, :notice => "Username and Password doesn't match!"
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
class PrintSettingsController < ApplicationController
|
||||
include LoginVerification
|
||||
load_and_authorize_resource except: [:create]
|
||||
before_action :set_print_setting, only: [:show, :edit, :update, :destroy]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user