Permalink
Browse files

reverting adult cookie for guests

Signed-off-by: shalott <shalott@gmail.com>
  • Loading branch information...
1 parent 7355eb3 commit a814d5abc09ddb4bb259e892807c731426ba1251 @shalott shalott committed Jun 9, 2012
@@ -57,6 +57,10 @@ def logged_in?
def logged_in_as_admin?
current_admin.nil? ? false : true
end
+
+ def guest?
+ !(logged_in? || logged_in_as_admin?)
+ end
public
@@ -28,9 +28,7 @@ def manage
def show
if params[:view_adult]
session[:adult] = true
- cookies[:adult] = 1
- elsif !(logged_in? || logged_in_as_admin?) || (@work.adult? && !see_adult?)
- # squid caching: guests see the adult page unless they are using params[:view_adult]
+ elsif @work.adult? && !see_adult?
render "works/_adult", :layout => "application" and return
end
@@ -205,9 +205,7 @@ def show
# Users must explicitly okay viewing of adult content
if params[:view_adult]
session[:adult] = true
- cookies[:adult] = 1
- elsif !(logged_in? || logged_in_as_admin?) || (@work.adult? && !see_adult?)
- # squid caching: guests see the adult page unless they are using params[:view_adult]
+ elsif @work.adult? && !see_adult?
render "_adult", :layout => "application" and return
end

0 comments on commit a814d5a

Please sign in to comment.