]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/user_controller.rb
Remove require_user for the api_details method as that uses HTTP authentication.
[rails.git] / app / controllers / user_controller.rb
index 459058ee5bc4c0a1970bd849cd6a02126eb2675b..5eba0e8373a0392b2078d104adb5998a98ad78d7 100644 (file)
@@ -11,7 +11,7 @@ class UserController < ApplicationController
     @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 :-)<br>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 +116,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 +165,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 +178,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 +186,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]