diff options
author | Frédéric Buclin <LpSolit@gmail.com> | 2011-08-17 00:45:22 +0200 |
---|---|---|
committer | Frédéric Buclin <LpSolit@gmail.com> | 2011-08-17 00:45:22 +0200 |
commit | e15dcf488f8bbf1fef2cd0a7001385f7a95e8d59 (patch) | |
tree | 4a46e8d94f53faf98923ca7509704f5e1fdec541 /Bugzilla/WebService | |
parent | 7a8598938d6976acb5f6bde6c86be8b65d1df8da (diff) | |
download | bugzilla-e15dcf488f8bbf1fef2cd0a7001385f7a95e8d59.tar.gz bugzilla-e15dcf488f8bbf1fef2cd0a7001385f7a95e8d59.tar.xz |
Bug 678970: Use $user and $cgi instead of Bugzilla->user and Bugzilla->cgi
r=timello a=LpSolit
Diffstat (limited to 'Bugzilla/WebService')
-rw-r--r-- | Bugzilla/WebService/Bug.pm | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Bugzilla/WebService/Bug.pm b/Bugzilla/WebService/Bug.pm index 9064f6a14..7844b4e97 100644 --- a/Bugzilla/WebService/Bug.pm +++ b/Bugzilla/WebService/Bug.pm @@ -670,10 +670,10 @@ sub add_attachment { sub add_comment { my ($self, $params) = @_; - - #The user must login in order add a comment - Bugzilla->login(LOGIN_REQUIRED); - + + # The user must login in order add a comment + my $user = Bugzilla->login(LOGIN_REQUIRED); + # Check parameters defined $params->{id} || ThrowCodeError('param_required', { param => 'id' }); @@ -682,8 +682,8 @@ sub add_comment { || ThrowCodeError('param_required', { param => 'comment' }); my $bug = Bugzilla::Bug->check($params->{id}); - - Bugzilla->user->can_edit_product($bug->product_id) + + $user->can_edit_product($bug->product_id) || ThrowUserError("product_edit_denied", {product => $bug->product}); # Backwards-compatibility for versions before 3.6 @@ -707,8 +707,8 @@ sub add_comment { $dbh->bz_commit_transaction(); # Send mail. - Bugzilla::BugMail::Send($bug->bug_id, { changer => Bugzilla->user }); - + Bugzilla::BugMail::Send($bug->bug_id, { changer => $user }); + return { id => $self->type('int', $new_comment_id) }; } |