Refactored login module. Implemented standard sessions controller.
This commit is contained in:
parent
b1a700ab5d
commit
e40f865c45
13 changed files with 89 additions and 332 deletions
|
|
@ -176,6 +176,15 @@ class User < ActiveRecord::Base
|
|||
self.groups.find(:all, :conditions => {:type => ""})
|
||||
end
|
||||
|
||||
def self.authenticate(nick, password)
|
||||
user = find_by_nick(nick)
|
||||
if user && user.has_password(password)
|
||||
user
|
||||
else
|
||||
nil
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
# == Schema Information
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue