body<= " unless LJ::text_in(\%POST); LJ::set_active_crumb('editfriends'); # this file used to be edit_do.bml, but edit.bml died, so we moved this # functionality to edit.bml, but we don't want the translators to have to # retranslate all of the phrases, so we're still using /edit_do.bml scope BML::set_language_scope("/friends/edit_do.bml"); my $remote = LJ::get_remote(); return LJ::bad_input($ML{'error.noremote'}) unless $remote; my $authas = $GET{'authas'} || $remote->{'user'}; my $getextra = $authas ne $remote->{'user'} ? "?authas=$authas" : ''; my $u = LJ::get_authas_user($authas); return LJ::bad_input("You could not be authenticated as the specified user.") unless $u; return BML::redirect("$LJ::SITEROOT/community/members.bml?comm=$u->{'user'}") if $u->{'journaltype'} eq 'C'; return LJ::bad_input("Cannot modify friends of this journal type.") unless $u->{'journaltype'} =~ /^[PSI]$/; my $ret; # no post, show edit form unless (LJ::did_post()) { # user switcher $ret .= "
\n\n"; $ret .= "\n"; return $ret; } # if they did a post, then process their changes if (LJ::did_post()) { my %request = (); $request{'mode'} = "editfriends"; $request{'ver'} = $LJ::PROTOCOL_VER; $request{'user'} = $u->{'user'}; foreach (grep { /^editfriend_/ } keys %POST) { $request{$_} = $POST{$_}; } my %response = (); LJ::do_request(\%request, \%response, { 'noauth' => 1, 'u' => $u }); if ($response{'success'} eq "OK") { # tell the user all is well return " LJ::journal_base($u) . "/friends"})." p?>"; } else { return "