diff options
author | francis <francis> | 2007-11-07 10:26:29 +0000 |
---|---|---|
committer | francis <francis> | 2007-11-07 10:26:29 +0000 |
commit | 43026e0bf80aa1a1e97639269c3adb56f45cef54 (patch) | |
tree | 7c8849cfdbfb33ebd83c9650cd76921cf633d169 /app/controllers/user_controller.rb | |
parent | 3c1a4bae631663f7660f947c59d898f076f6e0b8 (diff) |
Make login have signin and signup on same page, side by side.
Diffstat (limited to 'app/controllers/user_controller.rb')
-rw-r--r-- | app/controllers/user_controller.rb | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 95f44e40f..79311753e 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.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_controller.rb,v 1.13 2007-11-06 18:09:36 francis Exp $ +# $Id: user_controller.rb,v 1.14 2007-11-07 10:26:29 francis Exp $ class UserController < ApplicationController # XXX See controllers/application.rb simplify_url_part for reverse of expression in SQL below @@ -33,8 +33,12 @@ class UserController < ApplicationController render :action => 'sign' return else - @user = User.authenticate(params[:user][:email], params[:user][:password]) - if @user + @user = User.authenticate_from_form(params[:user]) + if @user.errors.size > 0 + # Failed to authenticate + render :action => 'signin' + return + else # Successful login if @user.email_confirmed session[:user] = @user.id @@ -43,12 +47,6 @@ class UserController < ApplicationController send_confirmation_mail end return - else - # Failed to authenticate - flash[:error] = "Email or password not correct, please try again" - @user = User.new(params[:user]) - render :action => 'signin' - return end end end |