Commit 4d8d27d2 authored by Frédéric Buclin's avatar Frédéric Buclin

Bug 1185240: Logging out while impersonating a user should also delete the sudo token

r=dkl a=sgreen
parent 40dbd9de
......@@ -100,6 +100,8 @@ sub logout {
if ($type == LOGOUT_ALL) {
$dbh->do("DELETE FROM logincookies WHERE userid = ?",
undef, $user->id);
$dbh->do("DELETE FROM tokens WHERE userid = ? AND tokentype = 'sudo'",
undef, $user->id);
return;
}
......@@ -144,6 +146,8 @@ sub logout {
$dbh->sql_in('cookie', \@login_cookies) .
" AND userid = ?",
undef, $user->id);
my $token = $cgi->cookie('sudo');
delete_token($token);
} else {
die("Invalid type $type supplied to logout()");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment