body<= " unless $remote; # for now, assume we're operating on $remote. maybe in the future we'll be able to # manage other P type accounts, but we can't yet my $u = $remote; return $LJ::MSG_READONLY_USER if LJ::get_cap($u, "readonly"); # always have links at top my $ret = BML::ml('Backlink', { 'link' => '/manage/index.bml', 'text' => $ML{'/manage/invites.bml.manage'}, }); # get pending invites my $pending = LJ::get_pending_invites($u) || []; # short out? return "" unless @$pending; # load communities and maintainers my @ids; push @ids, ($_->[0], $_->[1]) foreach @$pending; my $us = LJ::load_userids(@ids); # all possible attributes my @allattribs = ('member', 'post', 'preapprove', 'moderate', 'admin'); # see if they posted and if we should take actions if (LJ::did_post()) { # change the back link $ret = BML::ml('Backlink', { 'link' => '/manage/invites.bml', 'text' => $ML{'/manage/invites.bml.back'}, }); my (@accepted, @rejected, @undecided); foreach my $invite (@$pending) { my ($commid, $maintid, $date, $argline) = @$invite; my $args = {}; LJ::decode_url_string($invite->[3], $args); # now take actions? if ($POST{"pending_$commid"} eq 'yes') { my $rval = LJ::accept_comm_invite($u, $us->{$commid}); push @accepted, [ $commid, $args ] if $rval; } elsif ($POST{"pending_$commid"} eq 'no') { my $rval = LJ::reject_comm_invite($u, $us->{$commid}); push @rejected, $commid if $rval; } else { push @undecided, $commid; } } # communities they've joined if (@accepted) { $ret .= "