Use cached db lookups.
This commit is contained in:
parent
ae20f34944
commit
6f03f17a7a
2 changed files with 2 additions and 2 deletions
|
@ -71,7 +71,7 @@ class ApplicationController < ActionController::Base
|
||||||
# check http basic auth
|
# check http basic auth
|
||||||
authenticate_with_http_basic do |user, password|
|
authenticate_with_http_basic do |user, password|
|
||||||
puts 'http basic auth check'
|
puts 'http basic auth check'
|
||||||
userdata = User.where( :login => user ).first
|
userdata = User.lookup( :login => user )
|
||||||
message = ''
|
message = ''
|
||||||
if !userdata
|
if !userdata
|
||||||
message = 'authentication failed, user'
|
message = 'authentication failed, user'
|
||||||
|
|
|
@ -434,7 +434,7 @@ class ClientState
|
||||||
return if !session_data
|
return if !session_data
|
||||||
return if !session_data[:user]
|
return if !session_data[:user]
|
||||||
return if !session_data[:user][:id]
|
return if !session_data[:user][:id]
|
||||||
user = User.where( :id => session_data[:user][:id] ).first
|
user = User.lookup( :id => session_data[:user][:id] )
|
||||||
return if !user
|
return if !user
|
||||||
|
|
||||||
# set cache key
|
# set cache key
|
||||||
|
|
Loading…
Reference in a new issue