Permalink
Browse files

Add admin url for possible spam tracks and spam listeners.

  • Loading branch information...
1 parent 61aac2d commit 2c5bb082550a0854d7bb50462c210d7878d39ea7 @sudara committed Jun 3, 2009
@@ -270,6 +270,7 @@ def register_listen
:listener => current_user || nil,
:track_owner => @asset.user,
:source => @referer,
+ :user_agent => @agent,
:ip => request.remote_ip
) unless bot?
end
@@ -289,7 +290,7 @@ def set_user_agent
def prevent_abuse
if bot?
- Rails.logger.error "#{@asset.filename} #{@agent} #{request.remote_ip} #{@referer} #{current_user || nil}"
+ Rails.logger.error "BOT LISTEN ATTEMPT FAIL: #{@asset.filename} #{@agent} #{request.remote_ip} #{@referer} User:#{current_user || 0}"
render(:text => "Denied due to abuse", :status => 403)
end
end
View
@@ -91,6 +91,18 @@ def self.last_30_days_chart
)
end
+ def self.count_by_ip
+ Listen.count(:all, :group => :ip, :conditions => ['created_at > ?',60.days.ago], :order => 'count_all DESC', :limit => 25)
+ end
+
+ def self.count_by_track
+ Listen.count(:all, :group => :asset, :conditions => ['created_at > ?',60.days.ago], :order => 'count_all DESC', :limit => 25)
+ end
+
+ def self.find_user_by_ip(ip)
+ Listen.find(:first, :conditions => ['ip = ? AND listener_id IS NOT NULL',ip]).listener rescue nil
+ end
+
protected
# iterate through the months
View
@@ -1,8 +1,7 @@
ActionController::Routing::Routes.draw do |map|
map.resources :groups
-
map.resources :posts
-
+ map.admin 'secretz', :controller => 'secretz'
# manual, ghetto, overriding links
map.rpm_challenge 'rpmchallenge', :controller => 'pages', :action => 'rpm_challenge'
@@ -720,11 +720,11 @@ h1 span#channel_name
:text-align left
:background-color =!silver
:width 100%
-.static_content#stats
+.static_content#stats, .static_content.stats
:padding 0
:margin 0
:width auto
-#statstable
+#statstable, .statstable
:width 100%
thead tr
:background transparent url(../images/backgrounds/user_bar.png) repeat-x scroll left top
@@ -17,7 +17,7 @@
"",
"Googlebot/2.1 (+http://www.google.com/bot.html)",
"you're momma's so bot..."
- "Baiduspider+(+http://www.baidu.jp/spider/) ",
+ "Baiduspider+(+http://www.baidu.jp/spider/)",
"baidu/Nutch-1.0 "
]

0 comments on commit 2c5bb08

Please sign in to comment.