Use cached db lookups.

This commit is contained in:
Martin Edenhofer 2013-01-04 23:31:13 +01:00
parent ae20f34944
commit 6f03f17a7a
2 changed files with 2 additions and 2 deletions

View file

@ -71,7 +71,7 @@ class ApplicationController < ActionController::Base
# check http basic auth
authenticate_with_http_basic do |user, password|
puts 'http basic auth check'
userdata = User.where( :login => user ).first
userdata = User.lookup( :login => user )
message = ''
if !userdata
message = 'authentication failed, user'

View file

@ -434,7 +434,7 @@ class ClientState
return if !session_data
return if !session_data[:user]
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
# set cache key