kill_all_sessions; delete $COOKIE{'BMLschemepref'}; BML::set_scheme(undef); $body = $ML{'.loggedout.killedall'}; return; } if ($u->{'_session'} && $user eq $u->{'user'} && $sessid == $u->{'_session'}->{'sessid'}) { $u->kill_session; delete $COOKIE{'BMLschemepref'}; BML::set_scheme(undef); $body = "$ML{'.loggedout.success'}"; # Redirect to offsite uri if allowed. if ($POST{'ret'}) { my $redir_host = $1 if $POST{'ret'} =~ m#^http://([\.:\w-]+)#i; return BML::redirect($POST{'ret'}) if $LJ::REDIRECT_ALLOWED{$redir_host}; } return; } $body .= "
"; $body .= LJ::html_hidden('ret', $GET{'ret'}) if $GET{'ret'}; $body .= LJ::html_hidden("user", $u->{'user'}, "sessid", $u->{'_session'}->{'sessid'}); $body .= " p?>
"; # do they have any other sessions? my $udbr = LJ::get_cluster_reader($u); unless ($udbr) { $body = ""; return undef; } my $curid = $u->{'_session'}->{'sessid'} || 0; my $sessions = $udbr->selectcol_arrayref("SELECT sessid FROM sessions WHERE ". "userid=$u->{'userid'} AND timeexpire > UNIX_TIMESTAMP() ". "AND sessid <> $curid"); if (@$sessions) { $body .= "
"; $body .= LJ::html_hidden("action:killall", '1'); $body .= " p?>
"; } return; } _code?> body=> page?>