"; return; } my $remote = LJ::get_remote(); return $err->($ML{'error.noremote'}) unless $remote; my $authas = $GET{'authas'} || $remote->{'user'}; my $u = LJ::get_authas_user($authas); return $err->($ML{'error.invalidauth'}) unless $u; # extra arguments for get requests my $getextra = $authas ne $remote->{'user'} ? "?authas=$authas" : ''; if ($POST{'mode'} eq "save") { my %res; $POST{'mode'} = "editfriendgroups"; $POST{'user'} = $u->{'user'}; $POST{'ver'} = $LJ::PROTOCOL_VER; LJ::do_request(\%POST, \%res, { 'u' => $u, 'noauth' => 1, }); if ($res{'success'} eq "OK") { $body .= ""; } else { $body .= ""; } return; } my %res; LJ::do_request({ 'mode' => 'getfriends', 'user' => $u->{'user'}, 'ver' => $LJ::PROTOCOL_VER, 'includegroups' => 1 }, \%res, { 'u' => $u, 'noauth' => 1, }); my @num_used; my @num_free; # authas switcher form $body .= "
\n"; $body .= LJ::make_authas_select($remote, { 'authas' => $GET{'authas'} }) . "\n"; $body .= "
\n\n"; $body .= "

"; $body .= "

"; $body .= ""; for (my $i=1; $i<=30; $i++) { my $sort = 255; my $name = ""; my $public = 0; if ($res{"frgrp_${i}_name"}) { $sort = $res{"frgrp_${i}_sortorder"}+0; $name = LJ::ehtml($res{"frgrp_${i}_name"}); $public = $res{"frgrp_${i}_public"}+0; push @num_used, $i; } else { push @num_free, $i; } $body .= ""; $body .= ""; $body .= ""; $body .= ""; } for (my $i=1; $i<=$res{'friend_count'}; $i++) { my $user = $res{"friend_${i}_user"}; my $mask = $res{"friend_${i}_groupmask"} || 1; $body .= ""; } # escape strings for JavaScript my %T = qw(public .group.public rename .prompt.rename newname .prompt.newname delete .confirm.delete max30 .error.max30 ); foreach (keys %T) { $T{$_} = LJ::ejs($ML{$T{$_}}); } $body .= <<"END_JS"; END_JS $body .= ""; $body .= ""; $body .= ""; $body .= ""; $body .= ""; $body .= ""; $body .= ""; $body .= ""; $body .= ""; $body .= ""; $body .= ""; $body .= "
$ML{'.yourgroups'}$ML{'.ingroup.not'}$ML{'.ingroup'}
"; $body .= "

"; $body .= "
"; $body .= "

"; $body .= "
"; $body .= ""; $body .= " "; $body .= " "; $body .= ""; $body .= "
"; $body .= " "; $body .= ""; $body .= "
"; $body .= ""; $body .= " p?>"; $body .= "
"; return; } _code?> body=> page?> link: htdocs/login.bml post: htdocs/friends/editgroups.bml _c?>