Refactored login module. Implemented standard sessions controller.

This commit is contained in:
benni 2011-05-11 13:38:46 +02:00
parent b1a700ab5d
commit e40f865c45
13 changed files with 89 additions and 332 deletions

View file

@ -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