From fa9b63f55b3118a30ff641d0e386266eb877e258 Mon Sep 17 00:00:00 2001 From: "mkanat%kerio.com" <> Date: Fri, 25 Feb 2005 07:42:47 +0000 Subject: Bug 283237: Move DBname_to_id out of globals.pl Patch By Max Kanat-Alexander r=wurblzap, a=myk --- globals.pl | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'globals.pl') diff --git a/globals.pl b/globals.pl index 100c8fab6..2d01cb5f1 100644 --- a/globals.pl +++ b/globals.pl @@ -37,6 +37,7 @@ use Bugzilla::Util; use Bugzilla::Config qw(:DEFAULT ChmodDataFile $localconfig $datadir); use Bugzilla::BugMail; use Bugzilla::Auth; +use Bugzilla::User; # Shut up misguided -w warnings about "used only once". For some reason, # "use vars" chokes on me when I try it here. @@ -654,24 +655,9 @@ sub DBID_to_name { return $::cachedNameArray{$id}; } -sub DBname_to_id { - my ($name) = (@_); - PushGlobalSQLState(); - SendSQL("select userid from profiles where login_name = @{[SqlQuote($name)]}"); - my $r = FetchOneColumn(); - PopGlobalSQLState(); - # $r should be a positive integer, this makes Taint mode happy - if (defined $r && $r =~ m/^([1-9][0-9]*)$/) { - return $1; - } else { - return 0; - } -} - - sub DBNameToIdAndCheck { my ($name) = (@_); - my $result = DBname_to_id($name); + my $result = login_to_id($name); if ($result > 0) { return $result; } -- cgit v1.2.3-24-g4f1b