Skip to content

Commit

Permalink
fixed login error
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismatthieu committed Jun 4, 2011
1 parent ee31b99 commit 2c956b9
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions app/controllers/accounts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ def login

if @u and @p.user.is_admin
# @u = User.find_by_login(params[:login])
# @u = User.find(:first, :conditions => ['login LIKE ?', params[:login]])
@u = User.find(:first, :conditions => ['login ILIKE ?', params[:login]])
if request.url.index('localhost')
@u = User.find(:first, :conditions => ['login LIKE ?', params[:login]])
else
@u = User.find(:first, :conditions => ['login ILIKE ?', params[:login]])
end


flash[:notice] = "Hello #{@u.f rescue ''}"
Expand All @@ -31,7 +34,7 @@ def login
# self.user = User.authenticate(params[:login], params[:password])
redirect_back_or_default(home_path) and return if @u
@user = User.new
#return unless request.post?
return unless request.post?


#plays double duty login/forgot (due to the ajax nature of the login/forgot form)
Expand Down Expand Up @@ -119,7 +122,7 @@ def signup

redirect_back_or_default(home_path) and return if @u
@user = User.new
#return unless request.post?
return unless request.post?

#COMMENTED OUT TO DEAL WITH QRZ.COM BLOCKING OUR REQUESTS
@callelements = Array.new
Expand Down

0 comments on commit 2c956b9

Please sign in to comment.