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

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

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

U   trunk/bin/misc/set_comm_supermaintainer.pl
U   trunk/cgi-bin/LJ/Poll.pm
U   trunk/htdocs/community/members.bml
Modified: trunk/bin/misc/set_comm_supermaintainer.pl
===================================================================
--- trunk/bin/misc/set_comm_supermaintainer.pl	2011-01-31 05:15:38 UTC (rev 18141)
+++ trunk/bin/misc/set_comm_supermaintainer.pl	2011-01-31 05:36:44 UTC (rev 18142)
@@ -117,6 +117,9 @@
         ## Check for alone maintainer is normal user and if ok set to supermaintainer
         my $user = $alive_mainteiners[0];
         _log "Set user ".$user->user." as supermaintainer for ".$comm->user."\n";
+        my $system = LJ::load_user('system');
+        $comm->log_event('set_owner', { actiontarget => $user->{userid}, remote => $system });
+        LJ::statushistory_add($comm, $system, 'set_owner', "LJ script set owner as ".$user->{user});
         LJ::set_rel($c->{userid}, $user->{userid}, 'S');
     } else {
         ## Search for maintainer via userlog
@@ -124,7 +127,10 @@
         my $u = _check_maintainers ($comm);
         if ($u) {
             _log "Set user ".$u->user." as supermaintainer for ".$comm->user."\n";
+            my $system = LJ::load_user('system');
+            $comm->log_event('set_owner', { actiontarget => $u->{userid}, remote => $system });
             LJ::set_rel($c->{userid}, $u->{userid}, 'S');
+            LJ::statushistory_add($comm, $system, 'set_owner', "LJ script set owner as ".$u->{user});
         } else {
             _log "Create poll for supermaintainer election\n";
             my $poll_id = _create_poll ($c->{userid});

Modified: trunk/cgi-bin/LJ/Poll.pm
===================================================================
--- trunk/cgi-bin/LJ/Poll.pm	2011-01-31 05:15:38 UTC (rev 18141)
+++ trunk/cgi-bin/LJ/Poll.pm	2011-01-31 05:36:44 UTC (rev 18142)
@@ -830,6 +830,8 @@
             my $system = LJ::load_user('system');
             $comm->log_event('set_owner', { actiontarget => $winner->{userid}, remote => $system });
 
+            LJ::statushistory_add($comm, $system, 'set_owner', "Poll set owner as ".$winner->{user});
+
             ## Poll is closed. Emailing to all maintainers about it.
             my $subject = LJ::Lang::ml('poll.election.email.subject.closed');
             my $maintainers = LJ::load_rel_user($comm->userid, 'A');

Modified: trunk/htdocs/community/members.bml
===================================================================
--- trunk/htdocs/community/members.bml	2011-01-31 05:15:38 UTC (rev 18141)
+++ trunk/htdocs/community/members.bml	2011-01-31 05:36:44 UTC (rev 18142)
@@ -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');
+            LJ::statushistory_add($comm, $remote, 'set_owner', $new_sm_u->{user} . " set as owner by " . $remote->{user});
         }
     }
 

Tags: bml, livejournal, pl, 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