<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -59,7 +59,12 @@ class User &lt; ActiveRecord::Base
   
   # Authenticates a user by their login name and unencrypted password.  Returns the user or nil.
   def self.authenticate(login, password)
-    u = find_in_state :first, :active, :conditions =&gt; {:login =&gt; login} # need to get the salt
+    if Tog::Config[&quot;plugins.tog_user.email_as_login&quot;]
+      login_column = :email
+    else
+      login_column = :login
+    end
+    u = find_in_state :first, :active, :conditions =&gt; { login_column =&gt; login} # need to get the salt
     u &amp;&amp; u.authenticated?(password) ? u : nil
   end
 </diff>
      <filename>app/models/user.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>dd1cc4b209d9a868c92f81444f60f2b952ab2023</id>
    </parent>
  </parents>
  <author>
    <name>Gaizka Villate</name>
    <email>gaizkav@gmail.com</email>
  </author>
  <url>http://github.com/tog/tog_user/commit/f87e637a4eb390038e765d8d6eec3ab330d1ba73</url>
  <id>f87e637a4eb390038e765d8d6eec3ab330d1ba73</id>
  <committed-date>2009-06-10T15:47:11-07:00</committed-date>
  <authored-date>2009-06-09T14:52:19-07:00</authored-date>
  <message>Fix User.authenticate when Tog::Config[&quot;plugins.tog_user.email_as_login&quot;] is set

Signed-off-by: tog - extensible open source social network platform &lt;tog@linkingpaths.com&gt;</message>
  <tree>27cf5e96489bd67cdf5690ffa3f03c0d64ea1f6b</tree>
  <committer>
    <name>tog - extensible open source social network platform</name>
    <email>tog@linkingpaths.com</email>
  </committer>
</commit>
