X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/072b0717e4d7fd69e1d28c5c4c3805c7fb4f563e..d77e5f9d4d18f2eac88d0db69a1f460323618119:/app/controllers/user_controller.rb
diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb
index 459058ee5..0042be316 100644
--- a/app/controllers/user_controller.rb
+++ b/app/controllers/user_controller.rb
@@ -1,17 +1,19 @@
class UserController < ApplicationController
layout 'site'
- before_filter :authorize, :only => [:preferences, :api_details, :api_gpx_files]
+ before_filter :authorize, :only => [:api_details, :api_gpx_files]
before_filter :authorize_web, :only => [:account, :go_public, :view, :diary, :make_friend]
before_filter :require_user, :only => [:set_home, :account, :go_public, :make_friend]
+ filter_parameter_logging :password, :pass_crypt, :pass_crypt_confirmation
+
def save
@title = 'create account'
@user = User.new(params[:user])
@user.set_defaults
if @user.save
- flash[:notice] = 'User was successfully created. Check your email for a confirmation note, and you\'ll be mapping in no time :-)'
+ 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."
Notifier::deliver_signup_confirm(@user)
redirect_to :action => 'login'
else
@@ -116,6 +118,8 @@ class UserController < ApplicationController
redirect_to :controller => 'site', :action => 'index'
end
return
+ elsif User.authenticate(email, pass, false)
+ flash[:notice] = "Sorry, your account is not active yet.
Please click on the link in the account confirmation email to activate your account."
else
flash[:notice] = "Sorry, couldn't log in with those details."
end
@@ -154,21 +158,8 @@ class UserController < ApplicationController
end
end
- def preferences
- @title = 'preferences'
- if request.get?
- render_text @user.preferences
- elsif request.post? or request.put?
- @user.preferences = request.raw_post
- @user.save!
- render :nothing => true
- else
- render :status => 400, :nothing => true
- end
- end
-
def api_details
- render :text => @user.to_xml.to_s
+ render :text => @user.to_xml.to_s, :content_type => "text/xml"
end
def api_gpx_files
@@ -176,7 +167,7 @@ class UserController < ApplicationController
@user.traces.each do |trace|
doc.root << trace.to_xml_node() if trace.public? or trace.user == @user
end
- render :text => doc.to_s
+ render :text => doc.to_s, :content_type => "text/xml"
end
def view
@@ -184,11 +175,6 @@ class UserController < ApplicationController
@title = @this_user.display_name
end
- def diary
- @this_user = User.find_by_display_name(params[:display_name])
- @title = @this_user.display_name + "'s diary"
- end
-
def make_friend
if params[:display_name]