wisest owl (wisest_owl) wrote in changelog,
wisest owl
wisest_owl
changelog

[livejournal] r18147: LJSUP-7820. Setting Owner needs to be lo...

Committer: gprochaev
LJSUP-7820. Setting Owner needs to be logged to userlog and statushistory

U   trunk/cgi-bin/LJ/Console/Command/SetOwner.pm
U   trunk/cgi-bin/LJ/User.pm
U   trunk/htdocs/community/members.bml
Modified: trunk/cgi-bin/LJ/Console/Command/SetOwner.pm
===================================================================
--- trunk/cgi-bin/LJ/Console/Command/SetOwner.pm	2011-01-31 08:07:41 UTC (rev 18146)
+++ trunk/cgi-bin/LJ/Console/Command/SetOwner.pm	2011-01-31 08:33:07 UTC (rev 18147)
@@ -41,13 +41,15 @@
         next;
     }
 
-    #LJ::statushistory_add($u, $remote, "suspend", $reason);
     my $s_maints = LJ::load_rel_user($c->{userid}, 'S');
     my $s_maint_u = @$s_maints ? LJ::load_userid($s_maints->[0]) : undef;
     if ($s_maint_u) {
         LJ::clear_rel($c->{userid}, $s_maint_u->{userid}, 'S');
     }
 
+    $c->log_event('set_owner', { actiontarget => $u->{userid}, remote => $remote });
+
+    LJ::statushistory_add($c, $remote, 'set_owner', "Console set owner as ".$u->{user});
     LJ::set_rel($c->{userid}, $u->{userid}, 'S');
 
     $self->print("User '$user' setted as supermaintainer for '$comm'.");

Modified: trunk/cgi-bin/LJ/User.pm
===================================================================
--- trunk/cgi-bin/LJ/User.pm	2011-01-31 08:07:41 UTC (rev 18146)
+++ trunk/cgi-bin/LJ/User.pm	2011-01-31 08:33:07 UTC (rev 18147)
@@ -200,7 +200,11 @@
 
     my $remote = LJ::get_remote();
     LJ::set_rel($u, $remote, "A");  # maintainer
+
     LJ::set_rel($u, $remote, "S");  # supermaintainer
+    $u->log_event('set_owner', { actiontarget => $remote->{userid}, remote => $remote });
+    LJ::statushistory_add($u, $remote, 'set_owner', "Set supermaintainer on created time as " . $remote->{user});
+
     LJ::set_rel($u, $remote, "M") if $opts{moderated} =~ /^[AF]$/; # moderator if moderated
     LJ::join_community($remote, $u, 1, 1); # member
 

Modified: trunk/htdocs/community/members.bml
===================================================================
--- trunk/htdocs/community/members.bml	2011-01-31 08:07:41 UTC (rev 18146)
+++ trunk/htdocs/community/members.bml	2011-01-31 08:33:07 UTC (rev 18147)
@@ -77,6 +77,7 @@
         if ($new_sm_u && $new_sm_u->is_visible && $new_sm_u->can_manage($c)) {
             LJ::clear_rel($c->{userid}, $remote->{userid}, 'S');
             LJ::set_rel($c->{userid}, $new_sm_u->{userid}, 'S');
+            $c->log_event('set_owner', { actiontarget => $new_sm_u->{userid}, remote => $remote });
             LJ::statushistory_add($c, $remote, 'set_owner', $new_sm_u->{user} . " set as owner by " . $remote->{user});
         }
     }

Tags: bml, livejournal, pm, wisest-owl
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