Moved to User.authenticate() for http basic auth.

This commit is contained in:
Martin Edenhofer 2013-01-24 09:19:00 +01:00
parent 0dc3cc0d00
commit 1f0a671c5c

View file

@ -69,14 +69,15 @@ class ApplicationController < ActionController::Base
# puts params.inspect
# check http basic auth
authenticate_with_http_basic do |user, password|
authenticate_with_http_basic do |username, password|
puts 'http basic auth check'
userdata = User.lookup( :login => user )
userdata = User.lookup( :login => username )
message = ''
if !userdata
message = 'authentication failed, user'
else
if password != userdata.password
success = User.authenticate( username, password )
if !success
message = 'authentication failed, pw'
end
end