mark: A photo of Mark kneeling on top of the Taal Volcano in the Philippines. It was a long hike. (Default)
Mark Smith ([staff profile] mark) wrote in [site community profile] changelog2009-09-13 05:08 am

[dw-free] Network view in S2 should pay attention to cap, not paid status

[commit: http://hg.dwscoalition.org/dw-free/rev/a10b619f0170]

http://bugs.dwscoalition.org/show_bug.cgi?id=1783

Use can_use_network_page method instead of checking paid status to determine
if a user can use the network page.

Patch by [personal profile] foxfirefey.

Files modified:
  • cgi-bin/LJ/S2.pm
  • cgi-bin/LJ/User.pm
--------------------------------------------------------------------------------
diff -r 4bd1a2a86d99 -r a10b619f0170 cgi-bin/LJ/S2.pm
--- a/cgi-bin/LJ/S2.pm	Sun Sep 13 05:04:35 2009 +0000
+++ b/cgi-bin/LJ/S2.pm	Sun Sep 13 05:08:31 2009 +0000
@@ -2079,7 +2079,7 @@ sub Page
 
     # Identity (type I) accounts only have read views
     $p->{views_order} = [ 'read', 'userinfo' ] if $u->is_identity;
-    $p->{views_order} = [ 'recent', 'archive', 'read', 'network', 'tags', 'memories', 'userinfo' ] if $u->is_paid;
+    $p->{views_order} = [ 'recent', 'archive', 'read', 'network', 'tags', 'memories', 'userinfo' ] if $u->can_use_network_page;
 
     return $p;
 }
diff -r 4bd1a2a86d99 -r a10b619f0170 cgi-bin/LJ/User.pm
--- a/cgi-bin/LJ/User.pm	Sun Sep 13 05:04:35 2009 +0000
+++ b/cgi-bin/LJ/User.pm	Sun Sep 13 05:08:31 2009 +0000
@@ -1802,6 +1802,12 @@ sub can_use_google_analytics {
     return $_[0]->get_cap( 'google_analytics' ) ? 1 : 0;
 }
 
+
+sub can_use_network_page {
+    return $_[0]->get_cap( 'friendsfriendsview' ) ? 1 : 0;
+}
+
+
 # Check if the user can use *any* page statistic module for their own journal.
 sub can_use_page_statistics {
     return $_[0]->can_use_google_analytics;
--------------------------------------------------------------------------------