myexperiment-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myexperiment-hackers] [3537] trunk/app/controllers/users_controller.rb:


From: noreply
Subject: [myexperiment-hackers] [3537] trunk/app/controllers/users_controller.rb: changed spam page to show all entries when a range is not specified
Date: Thu, 9 May 2013 11:27:37 +0000 (UTC)

Revision
3537
Author
dgc
Date
2013-05-09 11:27:36 +0000 (Thu, 09 May 2013)

Log Message

changed spam page to show all entries when a range is not specified

Modified Paths

Diff

Modified: trunk/app/controllers/users_controller.rb (3536 => 3537)


--- trunk/app/controllers/users_controller.rb	2013-05-08 18:51:04 UTC (rev 3536)
+++ trunk/app/controllers/users_controller.rb	2013-05-09 11:27:36 UTC (rev 3537)
@@ -597,88 +597,92 @@
     @to   = params[:to].to_i
 
     if @to > 0
+      users = User.users_to_check.find(:all, :conditions => ["id >= ? AND id <= ?", @from, @to])
+    else
+      users = User.users_to_check.find(:all)
+    end
 
-      users = User.find(:all, :conditions => ["activated_at IS NOT NULL AND id >= ? AND id <= ? AND (account_status IS NULL OR (account_status != 'sleep' AND account_status != 'suspect' AND account_status != 'whitelist'))", @from, @to])
+    @userlist = users.map do |user|
 
-      @userlist = users.map do |user|
+      strings = []
 
-        strings = []
+      add(strings, :label => "email",        :string => user.email)
+      add(strings, :label => "openid",       :string => user.openid_url)
+      add(strings, :label => "created at",   :string => user.created_at)
+      add(strings, :label => "last login",   :string => user.last_seen_at ? user.last_seen_at : "never logged back in")
+      add(strings, :label => "name",         :string => user.name)
+      add(strings, :label => "public email", :string => user.profile.email)
+      add(strings, :label => "website",      :string => user.profile.website, :escape => :website)
+      add(strings, :label => "description",  :string => user.profile.body_html, :escape => :false)
+      add(strings, :label => "field / ind",  :string => user.profile.field_or_industry)
+      add(strings, :label => "occ / roles",  :string => user.profile.occupation_or_roles)
+      add(strings, :label => "city",         :string => user.profile.location_city)
+      add(strings, :label => "country",      :string => user.profile.location_country)
+      add(strings, :label => "interests",    :string => user.profile.interests)
+      add(strings, :label => "contact",      :string => user.profile.contact_details)
+      add(strings, :label => "tags",         :string => user.tags.map do |tag| tag.name end.join(", "))
 
-        add(strings, :label => "email",        :string => user.email)
-        add(strings, :label => "openid",       :string => user.openid_url)
-        add(strings, :label => "created at",   :string => user.created_at)
-        add(strings, :label => "last login",   :string => user.last_seen_at ? user.last_seen_at : "never logged back in")
-        add(strings, :label => "name",         :string => user.name)
-        add(strings, :label => "public email", :string => user.profile.email)
-        add(strings, :label => "website",      :string => user.profile.website, :escape => :website)
-        add(strings, :label => "description",  :string => user.profile.body_html, :escape => :false)
-        add(strings, :label => "field / ind",  :string => user.profile.field_or_industry)
-        add(strings, :label => "occ / roles",  :string => user.profile.occupation_or_roles)
-        add(strings, :label => "city",         :string => user.profile.location_city)
-        add(strings, :label => "country",      :string => user.profile.location_country)
-        add(strings, :label => "interests",    :string => user.profile.interests)
-        add(strings, :label => "contact",      :string => user.profile.contact_details)
-        add(strings, :label => "tags",         :string => user.tags.map do |tag| tag.name end.join(", "))
+      user.networks_owned.each do |network|
 
-        user.networks_owned.each do |network|
+        add(strings, :label  => "group title",
+                     :link   => polymorphic_path(network),
+                     :string => network.title) 
 
-          add(strings, :label  => "group title",
-                       :link   => polymorphic_path(network),
-                       :string => network.title) 
+        add(strings, :label  => "group description",
+                     :link   => polymorphic_path(network),
+                     :string => network.description_html,
+                     :escape => :false) 
+      end
 
-          add(strings, :label  => "group description",
-                       :link   => polymorphic_path(network),
-                       :string => network.description_html,
-                       :escape => :false) 
-        end
+      user.packs.each do |pack|
 
-        user.packs.each do |pack|
+        add(strings, :label  => "pack title",
+                     :link   => polymorphic_path(pack),
+                     :string => pack.title) 
 
-          add(strings, :label  => "pack title",
-                       :link   => polymorphic_path(pack),
-                       :string => pack.title) 
+        add(strings, :label  => "pack description",
+                     :link   => polymorphic_path(pack),
+                     :string => pack.description_html,
+                     :escape => :false) 
+      end
 
-          add(strings, :label  => "pack description",
-                       :link   => polymorphic_path(pack),
-                       :string => pack.description_html,
-                       :escape => :false) 
-        end
+      user.workflows.each do |workflow|
 
-        user.workflows.each do |workflow|
+        add(strings, :label  => "workflow title",
+                     :link   => polymorphic_path(workflow),
+                     :string => workflow.title) 
 
-          add(strings, :label  => "workflow title",
-                       :link   => polymorphic_path(workflow),
-                       :string => workflow.title) 
+        add(strings, :label  => "workflow description",
+                     :link   => polymorphic_path(workflow),
+                     :string => workflow.body_html,
+                     :escape => :false) 
+      end
 
-          add(strings, :label  => "workflow description",
-                       :link   => polymorphic_path(workflow),
-                       :string => workflow.body_html,
-                       :escape => :false) 
-        end
+      user.blobs.each do |blob|
 
-        user.blobs.each do |blob|
+        add(strings, :label  => "file title",
+                     :link   => polymorphic_path(blob),
+                     :string => blob.title) 
 
-          add(strings, :label  => "file title",
-                       :link   => polymorphic_path(blob),
-                       :string => blob.title) 
+        add(strings, :label  => "file description",
+                     :link   => polymorphic_path(blob),
+                     :string => blob.body_html,
+                     :escape => :false) 
+      end
 
-          add(strings, :label  => "file description",
-                       :link   => polymorphic_path(blob),
-                       :string => blob.body_html,
-                       :escape => :false) 
-        end
+      user.comments.each do |comment|
 
-        user.comments.each do |comment|
+        commentable = comment.commentable
+        commentable = commentable.context if commentable.kind_of?(Activity)
 
-          add(strings, :label  => "comment",
-                       :link   => polymorphic_path(comment.commentable),
-                       :string => comment.comment,
-                       :escape => :white_list) 
-        end
+        add(strings, :label  => "comment",
+                     :link   => polymorphic_path(commentable),
+                     :string => comment.comment,
+                     :escape => :white_list) 
+      end
 
-        { :ob => user, :strings => strings }
+      { :ob => user, :strings => strings }
 
-      end
     end
   end
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]