diff options
author | bbaetz%student.usyd.edu.au <> | 2002-02-04 21:23:04 +0100 |
---|---|---|
committer | bbaetz%student.usyd.edu.au <> | 2002-02-04 21:23:04 +0100 |
commit | 788e94b41f8124a05c6f25bf3084fcdaa36f4d63 (patch) | |
tree | e7313868133ce351cc5719c3da5da944ee2a6515 /globals.pl | |
parent | 7398c1d65281cf04584652f3b854dc5e9d471175 (diff) | |
download | bugzilla-788e94b41f8124a05c6f25bf3084fcdaa36f4d63.tar.gz bugzilla-788e94b41f8124a05c6f25bf3084fcdaa36f4d63.tar.xz |
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
Diffstat (limited to 'globals.pl')
-rw-r--r-- | globals.pl | 13 |
1 files changed, 13 insertions, 0 deletions
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) = @_; |