"; return; } # bad statusvis? unless ($remote->{statusvis} eq 'V') { $body = ""; return; } # get info about the community my $cuserid = $FORM{'cuserid'}+0; my $cu = $FORM{comm} ? LJ::load_user($FORM{comm}) : # they gave us the comm name LJ::load_userid($cuserid); # they gave us the comm id # NOTE: we wrapped this in an eval due to code going live; the library isn't going to go # live at the same time as the BML file, and we don't want weird things happening, so we # verify that this is all good and return an error if it's not okay. my $ci; eval { $ci = LJ::get_community_row($cu); }; if ($@) { $body = ""; return; } $cuserid = $ci->{'userid'}; LJ::text_out(\$ci->{'name'}); my $ecname = LJ::ehtml($ci->{'name'}); # does this community even exit? unless ($cu) { $body .= ""; return; } # make sure a community doesn't join a community (that's confusing # or something) unless ($remote->{'journaltype'} eq "P") { $body .= ""; return; } # ensure this user isn't banned if (LJ::is_banned($remote, $cuserid)) { $body .= ""; return; } # # and make sure they're not already a member # if (LJ::is_friend($cuserid, $remote->{userid})) { # $body .= ""; # return; # } # get the list of maintainers and their usernames my $dbr = LJ::get_db_reader(); my $admins = $dbr->selectcol_arrayref("SELECT u.user FROM useridmap u, reluser r ". "WHERE r.userid=$cuserid AND r.targetid=u.userid AND r.type='A'") || []; my $list = "