From ece3a7ec4685b281efee69286a4dbdeb44971661 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Mon, 8 May 2006 03:13:47 +0000 Subject: =?UTF-8?q?Bug=20332598:=20Move=20ValidatePassword()=20and=20DBNam?= =?UTF-8?q?eToIdAndCheck()=20from=20globals.pl=20into=20User.pm=20-=20Patc?= =?UTF-8?q?h=20by=20Fr=C3=A9d=C3=A9ric=20Buclin=20=20r?= =?UTF-8?q?=3Dmkanat=20a=3Dmyk?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- votes.cgi | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'votes.cgi') diff --git a/votes.cgi b/votes.cgi index e1bfb3616..61154a069 100755 --- a/votes.cgi +++ b/votes.cgi @@ -29,6 +29,7 @@ use lib "."; use Bugzilla; use Bugzilla::Constants; use Bugzilla::Bug; +use Bugzilla::User; require "globals.pl"; @@ -117,11 +118,11 @@ sub show_user { # If a bug_id is given, and we're editing, we'll add it to the votes list. $bug_id ||= ""; - + my $name = $cgi->param('user') || $user->login; - my $who = DBNameToIdAndCheck($name); + my $who = login_to_id($name, THROW_ERROR); my $userid = $user->id; - + my $canedit = (Param('usevotes') && $userid == $who) ? 1 : 0; $dbh->bz_lock_tables('bugs READ', 'products READ', 'votes WRITE', -- cgit v1.2.1