summaryrefslogtreecommitdiffstats
path: root/editusers.cgi
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2005-06-25 07:33:05 +0200
committerlpsolit%gmail.com <>2005-06-25 07:33:05 +0200
commit05cc6289d00b21e12d4d59282384b8729a5c2b57 (patch)
treefdf103232c9428fe4c9f88b885afa790abc72f8d /editusers.cgi
parent5609425d739829a7c26840b021e3a89dceb34005 (diff)
downloadbugzilla-05cc6289d00b21e12d4d59282384b8729a5c2b57.tar.gz
bugzilla-05cc6289d00b21e12d4d59282384b8729a5c2b57.tar.xz
Bug 284273: Move productResponsibilities from editusers.cgi to Bugzilla::User.pm - Patch by Marc Schumann <wurblzap@gmail.com> r=mkanat a=justdave
Diffstat (limited to 'editusers.cgi')
-rwxr-xr-xeditusers.cgi27
1 files changed, 1 insertions, 26 deletions
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 {