afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)
afuna ([personal profile] afuna) wrote in [site community profile] changelog2009-07-20 06:16 pm

[dw-free] Remove remnants of shared journal support

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

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

Killed with fire.

Patch by [personal profile] yvi.

Files modified:
  • cgi-bin/Apache/LiveJournal/Interface/ElsewhereInfo.pm
  • cgi-bin/LJ/User.pm
  • cgi-bin/ljlib.pl
  • cgi-bin/ljprotocol.pl
  • htdocs/approve.bml
  • htdocs/approve.bml.text
  • htdocs/community/join.bml.text
  • htdocs/community/members.bml
  • htdocs/customize/viewuser.bml
  • htdocs/manage/circle/edit.bml
  • htdocs/modify_do.bml.text
  • htdocs/preview/entry.bml
  • htdocs/reject.bml.text
  • htdocs/talkpost_do.bml.text
--------------------------------------------------------------------------------
diff -r 1f7f4d76eca2 -r 2c494fd4d32b cgi-bin/Apache/LiveJournal/Interface/ElsewhereInfo.pm
--- a/cgi-bin/Apache/LiveJournal/Interface/ElsewhereInfo.pm	Mon Jul 20 18:06:52 2009 +0000
+++ b/cgi-bin/Apache/LiveJournal/Interface/ElsewhereInfo.pm	Mon Jul 20 18:15:43 2009 +0000
@@ -50,11 +50,11 @@ sub handle {
     # find what node type we're dealing with
     my $node_type;
     my $node_ident = $u->user;
-    if ($u->is_community || $u->is_shared ) {
+    if ( $u->is_community ) {
         $node_type = 'group';
-    } elsif ($u->is_person) {
+    } elsif ( $u->is_person ) {
         $node_type = 'person';
-    } elsif ($u->is_identity) {
+    } elsif ( $u->is_identity ) {
         $node_type = 'openid';
         $node_ident = $u->url; # should be identity type O
     } else {
diff -r 1f7f4d76eca2 -r 2c494fd4d32b cgi-bin/LJ/User.pm
--- a/cgi-bin/LJ/User.pm	Mon Jul 20 18:06:52 2009 +0000
+++ b/cgi-bin/LJ/User.pm	Mon Jul 20 18:15:43 2009 +0000
@@ -609,7 +609,6 @@ sub info_for_js {
                is_person        => $u->is_person,
                is_syndicated    => $u->is_syndicated,
                is_identity      => $u->is_identity,
-               is_shared        => $u->is_shared,
                );
     # Without url_message "Send Message" link should not display
     $ret{url_message} = $u->message_url unless ($u->opt_usermsg eq 'N');
@@ -668,12 +667,6 @@ sub is_person {
 *is_personal = \&is_person;
 
 
-sub is_shared {
-    my $u = shift;
-    return $u->{journaltype} eq "S";
-}
-
-
 sub is_syndicated {
     my $u = shift;
     return $u->{journaltype} eq "Y";
@@ -694,7 +687,6 @@ sub journaltype_readable {
         R => 'redirect',
         I => 'identity',
         P => 'personal',
-        S => 'shared',
         Y => 'syndicated',
         C => 'community',
     }->{$u->{journaltype}};
@@ -8703,25 +8695,6 @@ sub userpic_count {
 ########################################################################
 ###  99. Miscellaneous Legacy Items
 
-# FIXME: shared journals are gone. Check what calls this and kill it.
-# <LJFUNC>
-# name: LJ::get_shared_journals
-# des: Gets an array of shared journals a user has access to.
-# returns: An array of shared journals.
-# args: u
-# </LJFUNC>
-sub get_shared_journals
-{
-    my $u = shift;
-    my $ids = LJ::load_rel_target($u, 'A') || [];
-
-    # have to get usernames;
-    my %users;
-    LJ::load_userids_multiple([ map { $_, \$users{$_} } @$ids ], [$u]);
-    return sort map { $_->{'user'} } values %users;
-}
-
-
 # FIXME: these are deprecated and no longer used; check what calls them and kill it.
 sub add_friend    { confess 'LJ::add_friend has been deprecated.';    }
 sub remove_friend { confess 'LJ::remove_friend has been deprecated.'; }
diff -r 1f7f4d76eca2 -r 2c494fd4d32b cgi-bin/ljlib.pl
--- a/cgi-bin/ljlib.pl	Mon Jul 20 18:06:52 2009 +0000
+++ b/cgi-bin/ljlib.pl	Mon Jul 20 18:15:43 2009 +0000
@@ -643,60 +643,6 @@ sub get_authas_user {
 
     # passed all checks, return $u
     return $u;
-}
-
-
-# <LJFUNC>
-# name: LJ::shared_member_request
-# des: Registers an authaction to add a user to a
-#      shared journal and sends an approval e-mail.
-# returns: Hashref; output of LJ::register_authaction()
-#          includes datecreate of old row if no new row was created.
-# args: ju, u, attr?
-# des-ju: Shared journal user object
-# des-u: User object to add to shared journal
-# </LJFUNC>
-sub shared_member_request {
-    my ($ju, $u) = @_;
-    return undef unless ref $ju && ref $u;
-
-    my $dbh = LJ::get_db_writer();
-
-    # check for duplicates
-    my $oldaa = $dbh->selectrow_hashref("SELECT aaid, authcode, datecreate FROM authactions " .
-                                        "WHERE userid=? AND action='shared_invite' AND used='N' " .
-                                        "AND NOW() < datecreate + INTERVAL 1 HOUR " .
-                                        "ORDER BY 1 DESC LIMIT 1",
-                                        undef, $ju->{'userid'});
-    return $oldaa if $oldaa;
-
-    # insert authactions row
-    my $aa = LJ::register_authaction($ju->{'userid'}, 'shared_invite', "targetid=$u->{'userid'}");
-    return undef unless $aa;
-
-    # if there are older duplicates, invalidate any existing unused authactions of this type
-    $dbh->do("UPDATE authactions SET used='Y' WHERE userid=? AND aaid<>? " .
-             "AND action='shared_invite' AND used='N'",
-             undef, $ju->{'userid'}, $aa->{'aaid'});
-
-    my $body = "The maintainer of the $ju->{'user'} shared journal has requested that " .
-        "you be given posting access.\n\n" .
-        "If you do not wish to be added to this journal, just ignore this email.  " .
-        "However, if you would like to accept posting rights to $ju->{'user'}, click " .
-        "the link below to authorize this action.\n\n" .
-        "     $LJ::SITEROOT/approve/$aa->{'aaid'}.$aa->{'authcode'}\n\n" .
-        "Regards\n$LJ::SITENAME Team\n";
-
-    LJ::send_mail({
-        'to' => $u->email_raw,
-        'from' => $LJ::ADMIN_EMAIL,
-        'fromname' => $LJ::SITENAME,
-        'charset' => 'utf-8',
-        'subject' => "Community Membership: $ju->{'name'}",
-        'body' => $body
-        });
-
-    return $aa;
 }
 
 # <LJFUNC>
diff -r 1f7f4d76eca2 -r 2c494fd4d32b cgi-bin/ljprotocol.pl
--- a/cgi-bin/ljprotocol.pl	Mon Jul 20 18:06:52 2009 +0000
+++ b/cgi-bin/ljprotocol.pl	Mon Jul 20 18:15:43 2009 +0000
@@ -1022,7 +1022,6 @@ sub postevent
     ### note: shared journals are deprecated.  every shared journal
     ##        should one day be a community journal, of some form.
     return fail($err,150) if ($u->{'journaltype'} eq "C" ||
-                              $u->{'journaltype'} eq "S" ||
                               $u->{'journaltype'} eq "I");
 
     # suspended users can't post
@@ -1926,8 +1925,7 @@ sub getevents
 
     # if this is on, we sort things different (logtime vs. posttime)
     # to avoid timezone issues
-    my $is_community = ($uowner->{'journaltype'} eq "C" ||
-                        $uowner->{'journaltype'} eq "S");
+    my $is_community = ($uowner->{journaltype} eq "C");
 
     # in some cases we'll use the master, to ensure there's no
     # replication delay.  useful cases: getting one item, use master
diff -r 1f7f4d76eca2 -r 2c494fd4d32b htdocs/approve.bml
--- a/htdocs/approve.bml	Mon Jul 20 18:06:52 2009 +0000
+++ b/htdocs/approve.bml	Mon Jul 20 18:15:43 2009 +0000
@@ -60,26 +60,6 @@ body<=
                ' p?>';
     }
 
-    # invite users to shared journals
-    if ($aa->{'action'} eq 'shared_invite') {
-        my $dbh = LJ::get_db_writer();
-
-        my $targetid = $arg->{'targetid'};
-        return LJ::bad_input($ML{'.error.internerr.invalidaction'}) unless $targetid;
-
-        LJ::set_rel($aa->{'userid'}, $targetid, 'P');
-
-        # mark this authaction as used
-        $dbh->do("UPDATE authactions SET used='Y' WHERE aaid=?", undef, $aa->{'aaid'});
-
-        my $username = LJ::get_username($aa->{'userid'});
-        return "<?h1 $ML{'.shared.success'} h1?>".
-               '<?p '.BML::ml('.shared.text',
-               {'shared'=>LJ::ljuser($username),
-                'aopts'=>'href="'.$LJ::SITEROOT.'/manage/circle/add.bml?user='.$username.'&action=subscribe"'}).
-               ' p?>';
-    }
-
     # approve someone joining a community
     if ($aa->{action} eq 'comm_join_request') {
         my $dbh = LJ::get_db_writer();
diff -r 1f7f4d76eca2 -r 2c494fd4d32b htdocs/approve.bml.text
--- a/htdocs/approve.bml.text	Mon Jul 20 18:06:52 2009 +0000
+++ b/htdocs/approve.bml.text	Mon Jul 20 18:15:43 2009 +0000
@@ -22,12 +22,5 @@ other options for this user.
 
 .error.unknownactiontype=Unknown action type
 
-.shared.success=Success
-
-.shared.text<<
-You have been given posting access to [[shared]].
-Click <a [[aopts]]>here</a> to add the shared journal to your friends list.
-.
-
 .title=Action Approval
 
diff -r 1f7f4d76eca2 -r 2c494fd4d32b htdocs/community/join.bml.text
--- a/htdocs/community/join.bml.text	Mon Jul 20 18:06:52 2009 +0000
+++ b/htdocs/community/join.bml.text	Mon Jul 20 18:15:43 2009 +0000
@@ -41,7 +41,7 @@
 
 .label.closed=This community is closed.  If you're interested in joining it, please contact one of its maintainers. Below is the list of maintainers for this community: [[admins]]
 
-.label.commlogged=You're logged in as a shared/community account, not your personal account.
+.label.commlogged=You're logged in as a community account, not your personal account.
 
 .label.errorcomminfo=The specified community information is not valid.
 
diff -r 1f7f4d76eca2 -r 2c494fd4d32b htdocs/community/members.bml
--- a/htdocs/community/members.bml	Mon Jul 20 18:06:52 2009 +0000
+++ b/htdocs/community/members.bml	Mon Jul 20 18:15:43 2009 +0000
@@ -39,7 +39,7 @@ body<=
     }
 
     # make sure it is a comm
-    unless ($c->is_comm || $c->is_shared ) {
+    unless ( $c->is_comm ) {
         $ret .= "<?h1 $ML{'Error'} h1?><?p ";
         $ret .= BML::ml( '.error.notcomm', { user => LJ::ljuser($c) } );
         $ret .= " p?>";
diff -r 1f7f4d76eca2 -r 2c494fd4d32b htdocs/customize/viewuser.bml
--- a/htdocs/customize/viewuser.bml	Mon Jul 20 18:06:52 2009 +0000
+++ b/htdocs/customize/viewuser.bml	Mon Jul 20 18:15:43 2009 +0000
@@ -2,6 +2,8 @@
 {
     use strict;
     use vars qw(%POST %GET $title $body);
+
+    my ($u, $opts) = @_; # type, authas, label, button
 
     my $dbh = LJ::get_db_writer();
 
@@ -9,13 +11,9 @@
     return "<?h1 $ML{'.login.required'} h1?><?p " . BML::ml('.login.first', {'url'=>"href='/login.bml?ret=1'"}) . " p?>"
         unless $remote;
 
-    my @journals = ($remote->{'user'});
-    push @journals, LJ::get_shared_journals($remote);
-    my $journal = $GET{'journal'} || $remote->{'user'};
-    unless (grep { $_ eq $journal } @journals) {  return BML::redirect("/customize/");  }
+    my $authas = $GET{authas} || $remote->{user};
+    my $u = LJ::get_authas_user($authas);
 
-    my $u = $remote;
-    $u = LJ::load_user($journal) unless $journal eq $remote->{'user'};
     my $userid = $u->{'userid'};
 
     LJ::load_user_props($u, "stylesys", "s2_style");
@@ -23,17 +21,11 @@
     $body = "";
     $title = $ML{".user.layer"};
 
-    if (@journals > 1) {
-        $body .= "<form method='get' action='viewuser.bml'>";
-        $body .= $ML{'.work.with.journal'};
-        $body .= LJ::html_select({
-            'name' => 'journal',
-            'selected' => $journal,
-        }, map { $_, $_ } @journals);
-        $body .= " <input type='submit' value='$ML{'.switch'}'> </form>";
-    }
+    $body .= "<form method='get' action='viewuser.bml'>\n";
+    $body .= LJ::make_authas_select($remote, { 'authas' => $GET{'authas'} }) . "\n";
+    $body .= "</form>\n\n";
 
-    $body .= "&lt;&lt; <a href='/customize/?journal=$journal'>$ML{'.customize'}</a><p>";
+    $body .= "&lt;&lt; <a href='/customize/?journal=$authas'>$ML{'.customize'}</a><p>";
 
     my $err = sub {
         $title = $ML{"Error"};
@@ -98,8 +90,8 @@
     # load the language and layout choices for core.
     LJ::S2::load_layer_info(\%layerinfo, \@layerids);
    
-    $body .= "<a href='viewuser.bml?journal=$journal'>$ML{'.raw'}</a> | ";
-    $body .= "<a href='viewuser.bml?journal=$journal&as=theme'>$ML{'.as.theme'}</a>\n";
+    $body .= "<a href='viewuser.bml?journal=$authas'>$ML{'.raw'}</a> | ";
+    $body .= "<a href='viewuser.bml?journal=$authas&as=theme'>$ML{'.as.theme'}</a>\n";
 
     $body .= "<p><textarea rows='40' cols='60' wrap='off'>";
     
diff -r 1f7f4d76eca2 -r 2c494fd4d32b htdocs/manage/circle/edit.bml
--- a/htdocs/manage/circle/edit.bml	Mon Jul 20 18:06:52 2009 +0000
+++ b/htdocs/manage/circle/edit.bml	Mon Jul 20 18:15:43 2009 +0000
@@ -27,7 +27,7 @@ body<=
     return BML::redirect("$LJ::SITEROOT/community/members.bml?authas=$u->{'user'}")
         if $u->is_community;
     return LJ::bad_input($ML{'.error.badjournaltype'})
-        unless $u->is_person || $u->is_shared || $u->is_identity;
+        unless $u->is_person || $u->is_identity;
 
     my $ret;
 
diff -r 1f7f4d76eca2 -r 2c494fd4d32b htdocs/modify_do.bml.text
--- a/htdocs/modify_do.bml.text	Mon Jul 20 18:06:52 2009 +0000
+++ b/htdocs/modify_do.bml.text	Mon Jul 20 18:15:43 2009 +0000
@@ -45,7 +45,7 @@
 
 .friends.head=Friends View
 
-.friends.opt.usesharedpic.about=This option controls what picture you see on your friends page when a user posts in a shared or community journal.  If you check it, then you'll see the community's icon.  If you leave it unchecked, then you'll see the person that's actually posting's personal user icon.
+.friends.opt.usesharedpic.about=This option controls what picture you see on your friends page when a user posts in a community journal.  If you check it, then you'll see the community's icon.  If you leave it unchecked, then you'll see the person that's actually posting's personal user icon.
 
 .friends.opt.usesharedpic.head=Use shared journal pictures instead of poster's user picture
 
diff -r 1f7f4d76eca2 -r 2c494fd4d32b htdocs/preview/entry.bml
--- a/htdocs/preview/entry.bml	Mon Jul 20 18:06:52 2009 +0000
+++ b/htdocs/preview/entry.bml	Mon Jul 20 18:15:43 2009 +0000
@@ -113,8 +113,7 @@
             }
 
             $ret .= "<td>";
-            my $is_shared = $u->{'journaltype'} eq 'C' || $u->{'journaltype'} eq 'S';
-            if ($is_shared) {
+            if ( $u->is_community ) {
                 $ret .= BML::ml("talk.somebodywrote_comm", { 'realname' => LJ::ehtml($up->{'name'}),
                                                              'userlink' => LJ::ljuser($up),
                                                              'commlink' => LJ::ljuser($u) });
diff -r 1f7f4d76eca2 -r 2c494fd4d32b htdocs/reject.bml.text
--- a/htdocs/reject.bml.text	Mon Jul 20 18:06:52 2009 +0000
+++ b/htdocs/reject.bml.text	Mon Jul 20 18:15:43 2009 +0000
@@ -13,7 +13,5 @@
 
 .error.unknownactiontype=Unknown action type
 
-.shared.success=Success
-
 .title=Action Reject
 
diff -r 1f7f4d76eca2 -r 2c494fd4d32b htdocs/talkpost_do.bml.text
--- a/htdocs/talkpost_do.bml.text	Mon Jul 20 18:06:52 2009 +0000
+++ b/htdocs/talkpost_do.bml.text	Mon Jul 20 18:15:43 2009 +0000
@@ -48,7 +48,7 @@
 
 .error.noverify2=Sorry, you aren't allowed to post comments until your email address has been validated. If you've lost the confirmation email to do this, you can <a [[aopts]]>have it re-sent</a>.
 
-.error.postshared=You can't post as a shared or community account.  Shared accounts represent groups of people, not individual people.
+.error.postshared=You can't post as a community account.
 
 .error.purged=Your journal has been deleted and purged.  You can't post messages.
 
--------------------------------------------------------------------------------