]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/user_controller.rb
Link to a user's details from their diary page.
[rails.git] / app / controllers / user_controller.rb
index f01157bc011fd3afa5ee9313faadef422172c7c0..80402f6776e7b873901da2583b29e47b990c829c 100644 (file)
@@ -5,6 +5,8 @@ class UserController < ApplicationController
   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])
@@ -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.<br>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
@@ -163,12 +167,12 @@ class UserController < ApplicationController
       @user.save!
       render :nothing => true
     else
-      render :status => 400, :nothing => true
+      render :nothing => true, :status => :method_not_allowed
     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 +180,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 +188,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]