summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Token.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Bugzilla/Token.pm')
-rw-r--r--Bugzilla/Token.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/Bugzilla/Token.pm b/Bugzilla/Token.pm
index 42dca47d6..dfc7be418 100644
--- a/Bugzilla/Token.pm
+++ b/Bugzilla/Token.pm
@@ -155,12 +155,16 @@ sub GenerateUniqueToken {
# the token in the "tokens" table. Gives up if it can't come up
# with a token after about one hundred tries.
+ my ($table, $column) = @_;
+
my $token;
my $duplicate = 1;
my $tries = 0;
+ $table ||= "tokens";
+ $column ||= "token";
my $dbh = Bugzilla->dbh;
- my $sth = $dbh->prepare("SELECT userid FROM tokens WHERE token = ?");
+ my $sth = $dbh->prepare("SELECT userid FROM $table WHERE $column = ?");
while ($duplicate) {
++$tries;