body<= '/community/manage.bml', 'text' => $ML{'/community/members.bml.manage2'}, }); # get remote my $remote = LJ::get_remote(); return "" unless $remote; my $cname = $GET{'comm'}; return BML::redirect("$LJ::SITEROOT/community/manage.bml") unless $cname; # get $c object my $c = LJ::load_user($cname); return "" unless $c; my $cid = $c->{'userid'}; # is $remote an admin? unless (LJ::can_manage($remote, $c)) { $ret .= " LJ::ljuser($cname, { type => 'C' }) }); $ret .= " p?>"; return $ret; } # hit up the database to find pending members my $pendids = LJ::get_pending_members($c) || []; my $us = LJ::load_userids(@$pendids); # nothing pending? return "" unless @$pendids || LJ::did_post(); # saving a form submission if ($POST{'action:update'}) { my @userids = split(',', $POST{'ids'}); # need a db handle now my $dbh = LJ::get_db_writer(); # hit up each user to find out what to do with them my ($added, $rejected, $ignored, $previous); foreach my $id (@userids) { unless ($us->{$id}) { $previous++; next; } if ($POST{"pending_$id"} eq 'yes') { LJ::approve_pending_member($cid, $id); $added++; } elsif ($POST{"pending_$id"} eq 'no') { LJ::reject_pending_member($cid, $id); $rejected++; } else { $ignored++; } } $ret .= ""; $ret .= " $added }) . " p?>" if $added; $ret .= " $rejected }) . " p?>" if $rejected; $ret .= " $ignored }) . " p?>" if $ignored; $ret .= " $previous }) . " p?>" if $previous; $ret .= " BML::get_uri() . "?comm=$cname" }) . " p?>"; return $ret; } my @users = sort { $a->{user} cmp $b->{user} } values %$us; my $page_size = 100; # change to adjust page size # how to make links back to this page my $self_link = sub { return "pending.bml?comm=$cname&page=$_[0]"; }; my %items = BML::paging(\@users, $GET{page}, $page_size); my $navbar = LJ::paging_bar($items{page}, $items{pages}, { self_link => $self_link }); @users = @{$items{items}}; # output starts here $ret .= " LJ::ljuser($cname, { type => 'C' }) }); $ret .= " " . BML::ml('/community/members.bml.settings', { 'link' => "settings.bml?comm=$cname"}) . " p?>"; $ret .= "
\n\n"; $ret .= $navbar; return $ret; } _code?> <=body page?>