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

[livejournal] r18272: LJSUP-7916. set_owner admin console comm...

Committer: gprochaev
LJSUP-7916. set_owner admin console command should set the user as maintainer as well

U   trunk/cgi-bin/LJ/Console/Command/SetOwner.pm
U   trunk/cgi-bin/communitylib.pl
Modified: trunk/cgi-bin/LJ/Console/Command/SetOwner.pm
===================================================================
--- trunk/cgi-bin/LJ/Console/Command/SetOwner.pm	2011-02-11 04:26:52 UTC (rev 18271)
+++ trunk/cgi-bin/LJ/Console/Command/SetOwner.pm	2011-02-11 05:51:48 UTC (rev 18272)
@@ -49,8 +49,11 @@
 
     $c->log_event('set_owner', { actiontarget => $u->{userid}, remote => $remote });
 
-    LJ::statushistory_add($c, $remote, 'set_owner', "Console set owner as ".$u->{user});
+    LJ::statushistory_add($c, $remote, 'set_owner', "Console set owner and new maintainer as ".$u->{user});
     LJ::set_rel($c->{userid}, $u->{userid}, 'S');
+    ## Set a new supermaintainer as maintainer too.
+    LJ::set_rel($c->{userid}, $u->{userid}, 'A');
+    $c->log_event('maintainer_add', { actiontarget => $u->{userid}, remote => $remote })
 
     $self->print("User '$user' setted as supermaintainer for '$comm'.");
 

Modified: trunk/cgi-bin/communitylib.pl
===================================================================
--- trunk/cgi-bin/communitylib.pl	2011-02-11 04:26:52 UTC (rev 18271)
+++ trunk/cgi-bin/communitylib.pl	2011-02-11 05:51:48 UTC (rev 18272)
@@ -356,7 +356,7 @@
             $flag_set_owner_error = 1;
         } else {
             LJ::set_rel($cu->{userid}, $u->{userid}, $edgelist{$_}) if $args->{$_};
-            $cu->log_event('maintainer_add', { actiontarget => $u->{userid}, remote => $u }) if $_ eq 'admin' && $args->{$_};
+            $cu->log_event('maintainer_add', { actiontarget => $u->{userid}, remote => LJ::load_userid($maintid) || $u }) if $_ eq 'admin' && $args->{$_};
         }
     }
 

Tags: 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