Skip to content

Instantly share code, notes, and snippets.

@stevenabrooks
Created June 30, 2014 20:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stevenabrooks/6df607535258ea58c451 to your computer and use it in GitHub Desktop.
Save stevenabrooks/6df607535258ea58c451 to your computer and use it in GitHub Desktop.
I added the params[:origin] to the email_preferences if there was no user, let me know what you think
def sign_in
params[:return_to] ||= "back"
save_return_point
if request.post? and perform_login and params[:origin] != 'email_preferences'
#report_from_server :category => 'login', # User logged in
# :action => 'success',
# :label => "user_id=[#{current_user.id}]"
redirect_to_return_point
elsif request.post? and perform_login and params[:origin] == 'email_preferences'
redirect_to :action => 'email_preferences'
else
if params[:ajax] || params[:dialog] || @dialog
@dialog = true
render :template => "/user/login_2014_dialog", :layout => false
else
render :template => "/user/login_2014", :layout => "app"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment