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