Thanks Brett
Is there an easy way to override methods in plugins/hobo? Not sure I
have it right:
I created a file called hobo_user.rb and put it in my lib folder, code
below.
I put a a line in my environment.rb
require 'hobo_user'
Many thanks
Adam
................................................
module Hobo
module User
module ClassMethods
# Authenticates a user by their login name and unencrypted
password. Returns the user or nil.
def authenticate(login, password)
u = find(:first, :conditions => ["#...@login_attribute} = ?",
login]) # need to get the salt
RAILS_DEFAULT_LOGGER.debug "CUSTOM HOBO USER AUTH"
if u && u.authenticated?(password)
if u.respond_to?(:last_login_at) || u.respond_to?
(:login_count)
u.last_login_at = Time.now if u.respond_to?
(:last_login_at)
u.login_count = (u.login_count.to_i + 1) if u.respond_to?
(:login_count)
u.save
end
u
else
nil
end
end
end
end
end
On Mar 23, 6:03 pm, Brett Nelson <[email protected]> wrote:
> authenticate in vendor/plugins/hobo/hobo/lib/hobo/user.rb
>
> Brett
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Hobo
Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/hobousers?hl=en
-~----------~----~----~----~------~----~------~--~---