Committer: wisest-owl
LJSUP-8713U trunk/cgi-bin/Apache/LiveJournal.pm U trunk/cgi-bin/LJ/User.pm
Modified: trunk/cgi-bin/Apache/LiveJournal.pm =================================================================== --- trunk/cgi-bin/Apache/LiveJournal.pm 2011-08-09 03:54:27 UTC (rev 19644) +++ trunk/cgi-bin/Apache/LiveJournal.pm 2011-08-09 04:07:33 UTC (rev 19645) @@ -727,10 +727,9 @@ return LJ::Request::NOT_FOUND; } - ## For beta-testers only. - my $comm = LJ::load_user($LJ::LJPHOTO_ALLOW_FROM_COMMUNITY); my %post_params = LJ::Request->post_params; + ## If no remote we can try authtorize by auth_token if (!$remote && !LJ::Auth->check_sessionless_auth_token ( $LJ::DOMAIN_WEB."/pics/upload", auth_token => $post_params{'form_auth'}, @@ -743,12 +742,11 @@ LJ::set_remote ($u) unless $remote; $remote = LJ::get_remote(); - unless ($remote && $remote->is_mutual_friend($comm)) { + unless ($remote && $remote->can_use_ljphoto()) { LJ::Request->pnotes ('error' => 'members'); LJ::Request->pnotes ('remote' => LJ::get_remote()); return LJ::Request::FORBIDDEN; } - ## unless ($u->is_person) { LJ::Request->pnotes ('error' => 'e404'); Modified: trunk/cgi-bin/LJ/User.pm =================================================================== --- trunk/cgi-bin/LJ/User.pm 2011-08-09 03:54:27 UTC (rev 19644) +++ trunk/cgi-bin/LJ/User.pm 2011-08-09 04:07:33 UTC (rev 19645) @@ -7054,6 +7054,7 @@ # 'O' == pOrtal box id, 'V' == 'vgift', 'E' == ESN subscription id # 'Q' == Notification Inbox, 'G' == 'SMS messaGe' # 'D' == 'moDule embed contents', 'W' == 'Wish-list element' +# 'F' == Photo ID, 'A' == Album ID # # FIXME: both phonepost and vgift are ljcom. need hooks. but then also # need a separate namespace. perhaps a separate function/table? @@ -7064,7 +7065,7 @@ ################################################################## # IF YOU UPDATE THIS MAKE SURE YOU ADD INITIALIZATION CODE BELOW # - return undef unless $dom =~ /^[LTMPSRKCOVEQGDW]$/; # + return undef unless $dom =~ /^[LTMPSRKCOVEQGDWFA]$/; # ################################################################## my $dbh = LJ::get_db_writer(); @@ -7182,6 +7183,12 @@ } elsif ($dom eq "W") { $newmax = $u->selectrow_array("SELECT MAX(wishid) FROM wishlist2 WHERE userid=?", undef, $uid); + } elsif ($dom eq "F") { + $newmax = $u->selectrow_array("SELECT MAX(photo_id) FROM fotki_photos WHERE userid=?", + undef, $uid); + } elsif ($dom eq "A") { + $newmax = $u->selectrow_array("SELECT MAX(album_id) FROM fotki_albums WHERE userid=?", + undef, $uid); } else { die "No user counter initializer defined for area '$dom'.\n"; }