From: lpsolit%gmail.com <> Date: Sat, 26 May 2007 05:54:33 +0000 (+0000) Subject: Bug 381732: Old tokens are not deleted on time when changing the email address -... X-Git-Tag: bugzilla-3.0.1~75 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=87d868b94aa5a356785a59f04bc2f5f0a43efedb;p=thirdparty%2Fbugzilla.git Bug 381732: Old tokens are not deleted on time when changing the email address - Patch by Frédéric Buclin r=mkanat a=LpSolit --- diff --git a/userprefs.cgi b/userprefs.cgi index 564057ee89..8f94809cb7 100755 --- a/userprefs.cgi +++ b/userprefs.cgi @@ -32,6 +32,7 @@ use Bugzilla::Search; use Bugzilla::Util; use Bugzilla::Error; use Bugzilla::User; +use Bugzilla::Token; my $template = Bugzilla->template; local our $vars = {}; @@ -51,6 +52,9 @@ sub DoAccount { if(Bugzilla->params->{'allowemailchange'} && Bugzilla->user->authorizer->can_change_email) { + # First delete old tokens. + Bugzilla::Token::CleanTokenTable(); + my @token = $dbh->selectrow_array( "SELECT tokentype, issuedate + " . $dbh->sql_interval(MAX_TOKEN_AGE, 'DAY') . ", eventdata