aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/user.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/user.rb')
-rw-r--r--app/models/user.rb16
1 files changed, 15 insertions, 1 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 781482dcf..98a27b83b 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -4,7 +4,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: user.rb,v 1.7 2007-09-17 10:13:24 francis Exp $
+# $Id: user.rb,v 1.8 2007-10-03 17:13:50 francis Exp $
require 'digest/sha1'
@@ -49,6 +49,20 @@ class User < ActiveRecord::Base
private
+ # XXX - wanted to override initialize to return existing model if
+ # authentication succeeds, but couldn't get it to work. This would move
+ # some code from controllers/application.rb
+ #def initialize(params = {})
+ # raise params.to_yaml
+ # if not params[:email].empty? and not params[:password].empty?
+ # user = self.authenticate(params[:email], params[:password])
+ # if user
+ # return user
+ # end
+ # end
+ # super
+ #end
+
def self.encrypted_password(password, salt)
string_to_hash = password + salt # XXX need to add a secret here too?
Digest::SHA1.hexdigest(string_to_hash)