changelog_bot (changelog_bot) wrote in changelog,
changelog_bot
changelog_bot
changelog

[livejournal] r17157: OPSC-126 permission model bug fix

Committer: aurbanowich
OPSC-126 permission model bug fix

U   trunk/cgi-bin/LJ/User.pm
Modified: trunk/cgi-bin/LJ/User.pm
===================================================================
--- trunk/cgi-bin/LJ/User.pm	2010-08-19 06:30:01 UTC (rev 17156)
+++ trunk/cgi-bin/LJ/User.pm	2010-08-19 08:57:43 UTC (rev 17157)
@@ -1540,8 +1540,10 @@
 sub can_show_location {
     my $u = shift;
     croak "invalid user object passed" unless LJ::isu($u);
-    my $remote = LJ::get_remote();
 
+    my %opts = @_;
+    my $remote = $opts{remote} || LJ::get_remote();
+
     return 0 if $u->underage;
     return 0 if ($u->opt_showlocation eq 'N');
     return 0 if ($u->opt_showlocation eq 'R' && !$remote);
@@ -5284,8 +5286,8 @@
     my ($u, $targetu) = @_;
 
     return 0 unless LJ::is_enabled("schools");
-    return 1 if $u->{'opt_showschools'} eq '' || $u->{'opt_showschools'} eq 'Y';
-    return 1 if $u->{'opt_showschools'} eq 'F' && $u->has_friend($targetu);
+    return 1 if $u->prop('opt_showschools') eq '' || $u->prop('opt_showschools') eq 'Y';
+    return 1 if $u->prop('opt_showschools') eq 'F' && $u->has_friend($targetu);
 
     return 0;
 }

Tags: fortl, livejournal, pm
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments