X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/7058d836f75c845b7790c7ab6eb2f75844ce0c1c..747d6f1d11037d79946396270f59fc9aa11cc629:/app/controllers/user_controller.rb diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 196d5cea6..7ebe6b6b6 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -16,6 +16,7 @@ class UserController < ApplicationController @user.visible = true @user.data_public = true @user.description = "" if @user.description.nil? + @user.creation_ip = request.remote_ip if @user.save flash[:notice] = "User was successfully created. Check your email for a confirmation note, and you\'ll be mapping in no time :-)
Please note that you won't be able to login until you've received and confirmed your email address." @@ -116,6 +117,15 @@ class UserController < ApplicationController end def login + if session[:user] + # The user is logged in already, if the referer param exists, redirect them to that + if params[:referer] + redirect_to params[:referer] + else + redirect_to :controller => 'site', :action => 'index' + end + return + end @title = 'login' if params[:user] email_or_display_name = params[:user][:email]