From 05cc6289d00b21e12d4d59282384b8729a5c2b57 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Sat, 25 Jun 2005 05:33:05 +0000 Subject: Bug 284273: Move productResponsibilities from editusers.cgi to Bugzilla::User.pm - Patch by Marc Schumann r=mkanat a=justdave --- editusers.cgi | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) (limited to 'editusers.cgi') diff --git a/editusers.cgi b/editusers.cgi index 371e2a612..ba5cc827e 100755 --- a/editusers.cgi +++ b/editusers.cgi @@ -404,10 +404,6 @@ if ($action eq 'search') { $vars->{'otheruser'} = $otherUser; $vars->{'editcomponents'} = UserInGroup('editcomponents'); - # If the user is default assignee or default QA contact of a component, - # then no deletion is possible. - $vars->{'product_responsibilities'} = productResponsibilities($otherUserID); - # Find other cross references. $vars->{'bugs'} = $dbh->selectrow_array( qq{SELECT COUNT(*) @@ -504,7 +500,7 @@ if ($action eq 'search') { {reason => "not_visible", action => "delete", object => "user"}); - productResponsibilities($otherUserID) + @{$otherUser->product_responsibilities()} && ThrowUserError('user_has_responsibility'); Bugzilla->logout_user_by_id($otherUserID); @@ -672,27 +668,6 @@ sub canSeeUser { return $dbh->selectrow_array($query, undef, $otherUserID); } -# Retrieve product responsibilities, usable for both display and verification. -sub productResponsibilities { - my $userid = shift; - my $h = $dbh->selectall_arrayref( - qq{SELECT products.name AS productname, - components.name AS componentname, - initialowner, - initialqacontact - FROM products, components - WHERE products.id = components.product_id - AND ? IN (initialowner, initialqacontact) - }, - {'Slice' => {}}, $userid); - - if (@$h) { - return $h; - } else { - return undef; - } -} - # Retrieve user data for the user editing form. User creation and user # editing code rely on this to call derive_groups(). sub userDataToVars { -- cgit v1.2.3-24-g4f1b