From 557a248f2a6b74d141aa1b45d90672006fd04bcd Mon Sep 17 00:00:00 2001
From: KeyserSosa
Date: Fri, 25 Jul 2008 14:58:15 -0700
Subject: [PATCH] hide tracking pixel and add 403 to comment pages on private
reddits
---
r2/r2/controllers/front.py | 5 ++++-
r2/r2/templates/redditfooter.html | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/r2/r2/controllers/front.py b/r2/r2/controllers/front.py
index 2f1ca53f4..11016e5af 100644
--- a/r2/r2/controllers/front.py
+++ b/r2/r2/controllers/front.py
@@ -117,11 +117,14 @@ class FrontController(RedditController):
num_comments = VMenu('controller', NumCommentsMenu))
def GET_comments(self, article, comment, context, sort, num_comments):
"""Comment page for a given 'article'."""
- if comment and comment.link_id != article._id:
+ if comment and comment.link_id != article._id:
return self.abort404()
if not c.default_sr and c.site._id != article.sr_id:
return self.abort404()
+
+ if not article.subreddit_slow.can_view(c.user):
+ abort(403, 'forbidden')
#check for 304
self.check_modified(article, 'comments')
diff --git a/r2/r2/templates/redditfooter.html b/r2/r2/templates/redditfooter.html
index b9d20b6b2..b7326b89d 100644
--- a/r2/r2/templates/redditfooter.html
+++ b/r2/r2/templates/redditfooter.html
@@ -44,7 +44,7 @@
dict(year=2008)}
%if g.tracker_url:
-
+
%endif