Commit ceaa62ca authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 381732: Old tokens are not deleted on time when changing the email address -…

Bug 381732: Old tokens are not deleted on time when changing the email address - Patch by Fré©ric Buclin <LpSolit@gmail.com> r=mkanat a=LpSolit
parent 3588c7d3
...@@ -32,6 +32,7 @@ use Bugzilla::Search; ...@@ -32,6 +32,7 @@ use Bugzilla::Search;
use Bugzilla::Util; use Bugzilla::Util;
use Bugzilla::Error; use Bugzilla::Error;
use Bugzilla::User; use Bugzilla::User;
use Bugzilla::Token;
my $template = Bugzilla->template; my $template = Bugzilla->template;
local our $vars = {}; local our $vars = {};
...@@ -51,6 +52,9 @@ sub DoAccount { ...@@ -51,6 +52,9 @@ sub DoAccount {
if(Bugzilla->params->{'allowemailchange'} if(Bugzilla->params->{'allowemailchange'}
&& Bugzilla->user->authorizer->can_change_email) { && Bugzilla->user->authorizer->can_change_email) {
# First delete old tokens.
Bugzilla::Token::CleanTokenTable();
my @token = $dbh->selectrow_array( my @token = $dbh->selectrow_array(
"SELECT tokentype, issuedate + " . "SELECT tokentype, issuedate + " .
$dbh->sql_interval(MAX_TOKEN_AGE, 'DAY') . ", eventdata $dbh->sql_interval(MAX_TOKEN_AGE, 'DAY') . ", eventdata
......
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