[livejournal] r18040: LJSUP-7726. Supermaintainer loses the ri...
Committer: gprochaev
LJSUP-7726. Supermaintainer loses the right of maintainer, if he removes the flag maintainerU trunk/cgi-bin/LJ/User.pm U trunk/htdocs/community/manage.bml U trunk/htdocs/community/members.bml
Modified: trunk/cgi-bin/LJ/User.pm
===================================================================
--- trunk/cgi-bin/LJ/User.pm 2011-01-18 07:22:09 UTC (rev 18039)
+++ trunk/cgi-bin/LJ/User.pm 2011-01-18 08:06:37 UTC (rev 18040)
@@ -5214,6 +5214,9 @@
# people/syn/rename accounts can only be managed by the one account
return undef if $u->{journaltype} =~ /^[PYR]$/;
+ # check for supermaintainer
+ return 1 if $remote->can_super_manage($u);
+
# check for admin access
return undef unless LJ::check_rel($u, $remote, 'A');
Modified: trunk/htdocs/community/manage.bml
===================================================================
--- trunk/htdocs/community/manage.bml 2011-01-18 07:22:09 UTC (rev 18039)
+++ trunk/htdocs/community/manage.bml 2011-01-18 08:06:37 UTC (rev 18040)
@@ -37,6 +37,11 @@
my %mods;
if ($mods) { foreach (@$mods) { $mods{$_} = $show{$_} = 1; } }
+ # keep track of what communities remote supermaintainer
+ my $smods = LJ::load_rel_target($remote, 'S');
+ my %smods;
+ if ($smods) { foreach (@$smods) { $admin{$_} = $smods{$_} = $show{$_} = 1; } }
+
my %names = ();
my %pending = ();
if (%show) {
Modified: trunk/htdocs/community/members.bml
===================================================================
--- trunk/htdocs/community/members.bml 2011-01-18 07:22:09 UTC (rev 18039)
+++ trunk/htdocs/community/members.bml 2011-01-18 08:06:37 UTC (rev 18040)
@@ -35,7 +35,7 @@
return BML::redirect("$LJ::SITEROOT/community/manage.bml") unless $cname;
$ret .= "<form action='members.bml' method='GET'>\n";
- $ret .= LJ::make_authas_select($remote, { authas => $GET{authas}, type => 'C' });
+ $ret .= LJ::make_authas_select($remote, { authas => $GET{authas}, type => 'S' });
$ret .= "</form>\n\n";
# get $c object
