X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/f6695c9079f4eeeecaa796c879868f797f97cd55..ff97501ed01488f8ff8e9d2e7b93b4f295f71725:/app/controllers/user_controller.rb?ds=sidebyside diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 197b28914..2ff9646e6 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -81,7 +81,7 @@ class UserController < ApplicationController @user.terms_agreed = Time.now.getutc @user.terms_seen = true - if @user.auth_uid.nil? || @user.auth_uid.empty? + if @user.auth_uid.blank? @user.auth_provider = nil @user.auth_uid = nil end @@ -194,7 +194,7 @@ class UserController < ApplicationController redirect_to :action => "lost_password" end else - render :text => "", :status => :bad_request + head :bad_request end end @@ -375,7 +375,7 @@ class UserController < ApplicationController if @this_user.visible? render :action => :api_read, :content_type => "text/xml" else - render :text => "", :status => :gone + head :gone end end @@ -389,7 +389,7 @@ class UserController < ApplicationController @user.traces.reload.each do |trace| doc.root << trace.to_xml_node end - render :text => doc.to_s, :content_type => "text/xml" + render :xml => doc.to_s end def view @@ -437,7 +437,7 @@ class UserController < ApplicationController if @friend if request.post? if @user.is_friends_with?(@friend) - Friend.delete_all "user_id = #{@user.id} AND friend_user_id = #{@friend.id}" + Friend.where(:user_id => @user.id, :friend_user_id => @friend.id).delete_all flash[:notice] = t "user.remove_friend.success", :name => @friend.display_name else flash[:error] = t "user.remove_friend.not_a_friend", :name => @friend.display_name @@ -752,9 +752,7 @@ class UserController < ApplicationController ## # require that the user in the URL is the logged in user def require_self - if params[:display_name] != @user.display_name - render :text => "", :status => :forbidden - end + head :forbidden if params[:display_name] != @user.display_name end ##