summaryrefslogtreecommitdiffstats
path: root/globals.pl
diff options
context:
space:
mode:
authormkanat%kerio.com <>2005-02-25 08:42:47 +0100
committermkanat%kerio.com <>2005-02-25 08:42:47 +0100
commitfa9b63f55b3118a30ff641d0e386266eb877e258 (patch)
treea388e3577fef067abe83e94bbdb52428e442b35b /globals.pl
parent63dde60072374b2f7ef2f756d4ab9dff66669793 (diff)
downloadbugzilla-fa9b63f55b3118a30ff641d0e386266eb877e258.tar.gz
bugzilla-fa9b63f55b3118a30ff641d0e386266eb877e258.tar.xz
Bug 283237: Move DBname_to_id out of globals.pl
Patch By Max Kanat-Alexander <mkanat@kerio.com> r=wurblzap, a=myk
Diffstat (limited to 'globals.pl')
-rw-r--r--globals.pl18
1 files changed, 2 insertions, 16 deletions
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;
}