On Sep 14, 2011, at 1:18 PM, Jim Harvey wrote:

> This is a bit of a follow-up to the last question I posted regarding case 
> sensitive searching using Postgres. The problem I have now is that users log 
> in with their email address, which is always converted to lowercase when an 
> account is created. However, some users might use capital letters when they 
> attempt to log in. They SHOULD be to do that. However, right now we have to 
> specify on the log in page that they use lowercase only, which, to me, seems 
> unprofessional. 
> 
> So, where can I convert their input to lowercase so that the email matches 
> when they attempt to log in? I don't want to completely overwrite hobo's 
> login action in the controller and the options I can pass to hobo_login do 
> not help in this situation. Has anyone else run into this problem? Please let 
> me know if I'm missing something. Thanks!

The quickest solution I can think of would be to add a before_filter in your 
UsersController:

class UsersController < ApplicationController

  hobo_user_controller

  auto_actions :all

  before_filter :normalize_login, :only => [:login, :forgot_password]

  protected

  def normalize_login
    params[:login].downcase!
    params[:email_address].downcase!
  end

end

You didn't ask about the forgot password part, but an identical argument 
applies to that situation...

--Matt Jones

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

Reply via email to