]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/trace_controller.rb
Merge oauth branch at r17138 to trunk.
[rails.git] / app / controllers / trace_controller.rb
index f06a162fbc00b850d03b971cc7a59ae9ad60ec62..10aecd4adc7733e8c2309253bbbed6d5ad2f4b02 100644 (file)
@@ -45,15 +45,15 @@ class TraceController < ApplicationController
     # 4 - user's traces, not logged in as that user = all user's public traces
     if target_user.nil? # all traces
       if @user
-        conditions = ["(gpx_files.visibility <> 'private' OR gpx_files.user_id = ?)", @user.id] #1
+        conditions = ["(gpx_files.visibility in ('public', 'identifiable') OR gpx_files.user_id = ?)", @user.id] #1
       else
-        conditions  = ["gpx_files.visibility <> 'private'"] #2
+        conditions  = ["gpx_files.visibility in ('public', 'identifiable')"] #2
       end
     else
       if @user and @user == target_user
         conditions = ["gpx_files.user_id = ?", @user.id] #3 (check vs user id, so no join + can't pick up non-public traces by changing name)
       else
-        conditions = ["gpx_files.public <> 'private' AND gpx_files.user_id = ?", target_user.id] #4
+        conditions = ["gpx_files.visibility in ('public', 'identifiable') AND gpx_files.user_id = ?", target_user.id] #4
       end
     end
     
@@ -207,7 +207,7 @@ class TraceController < ApplicationController
   end
 
   def georss
-    conditions = ["gpx_files.visibility <> 'private'"]
+    conditions = ["gpx_files.visibility in ('public', 'identifiable')"]
 
     if params[:display_name]
       conditions[0] += " AND users.display_name = ?"