From 788e94b41f8124a05c6f25bf3084fcdaa36f4d63 Mon Sep 17 00:00:00 2001 From: "bbaetz%student.usyd.edu.au" <> Date: Mon, 4 Feb 2002 20:23:04 +0000 Subject: Bug 95732 - remove logincookies.cryptpassword, and invalidate cookies from the db when required instead. (Also fixes bug 58242 as a side effect) r=myk, kiko --- globals.pl | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'globals.pl') diff --git a/globals.pl b/globals.pl index cc05ae345..845e6ed9a 100644 --- a/globals.pl +++ b/globals.pl @@ -706,6 +706,19 @@ sub InsertNewUser { return $password; } +# Removes all entries from logincookies for $userid, except for the +# optional $keep, which refers the logincookies.cookie primary key. +# (This is useful so that a user changing their password stays logged in) +sub InvalidateLogins { + my ($userid, $keep) = @_; + + my $remove = "DELETE FROM logincookies WHERE userid = $userid"; + if (defined $keep) { + $remove .= " AND cookie != " . SqlQuote($keep); + } + SendSQL($remove); +} + sub GenerateRandomPassword { my ($size) = @_; -- cgit v1.2.3-24-g4f1b