@@ -16,6+16,7 @@ class UserController < ApplicationController
@user.visible = true
@user.data_public = true
@user.description = "" if @user.description.nil?
@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 :-)<br>Please note that you won't be able to login until you've received and confirmed your email address."
if @user.save
flash[:notice] = "User was successfully created. Check your email for a confirmation note, and you\'ll be mapping in no time :-)<br>Please note that you won't be able to login until you've received and confirmed your email address."
@@ -76,7+77,7 @@ class UserController < ApplicationController
def lost_password
@title = 'lost password'
if params[:user] and params[:user][:email]
def lost_password
@title = 'lost password'
if params[:user] and params[:user][:email]
- user = User.find_by_email(params[:user][:email], :conditions => "visible = 1")
+ user = User.find_by_email(params[:user][:email], :conditions => {:visible => true})
if user
token = user.tokens.create
if user
token = user.tokens.create
@@ -116,6+117,14 @@ class UserController < ApplicationController
end
def login
end
def login
+ if session[:user]
+ # The user is logged in already, if the referer param exists, redirect them to that