Closed
Bug 678970
Opened 14 years ago
Closed 14 years ago
Use $user and $cgi instead of Bugzilla->user and Bugzilla->cgi
Categories
(Bugzilla :: Bugzilla-General, enhancement)
Tracking
()
RESOLVED
FIXED
Bugzilla 4.4
People
(Reporter: LpSolit, Assigned: LpSolit)
Details
Attachments
(1 file)
17.11 KB,
patch
|
timello
:
review+
|
Details | Diff | Splinter Review |
This is part of a code cleanup process I started to remove very old code. Before Bugzilla 2.22, Bugzilla->login didn't return anything. Since 2.22, it returns the user object. As all *.cgi scripts call Bugzilla->login, we already have the current user object in hands. No need to call Bugzilla->user anymore within the whole script. I also fixed places which still uses Bugzilla->cgi instead of the already defined $cgi object.
Attachment #553155 -
Flags: review?(timello)
Comment 1•14 years ago
|
||
Cool. Just to check, does any of this touch code that is inside of subroutines in .cgi files? Because "my $user" and "my $cgi" from outside of the subroutines can't be safely used inside of subroutines under mod_perl.
![]() |
Assignee | |
Comment 2•14 years ago
|
||
I checked them all one by one, don't worry. :)
Comment 3•14 years ago
|
||
(In reply to Frédéric Buclin from comment #2)
> I checked them all one by one, don't worry. :)
Okay, sounds good to me, then. :-)
Comment 4•14 years ago
|
||
Comment on attachment 553155 [details] [diff] [review]
patch, v1
Review of attachment 553155 [details] [diff] [review]:
-----------------------------------------------------------------
Bug.add_comment is also using Bugzilla->user instead of $user.
Otherwise it looks right.
::: userprefs.cgi
@@ +51,4 @@
> ($vars->{'realname'}) = $dbh->selectrow_array(
> "SELECT realname FROM profiles WHERE userid = ?", undef, $user->id);
>
> + if (Bugzilla->params->{'allowemailchange'} && $user->authorizer->can_change_email) {
This line is a bit long.
Attachment #553155 -
Flags: review?(timello) → review+
Updated•14 years ago
|
Flags: approval?
![]() |
Assignee | |
Comment 5•14 years ago
|
||
(In reply to Tiago Mello [:timello] from comment #4)
> Bug.add_comment is also using Bugzilla->user instead of $user.
Nice catch, thanks! I will fix it on checkin.
Flags: approval? → approval+
![]() |
Assignee | |
Comment 6•14 years ago
|
||
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/
modified buglist.cgi
modified colchange.cgi
modified config.cgi
modified createaccount.cgi
modified describekeywords.cgi
modified editclassifications.cgi
modified editvalues.cgi
modified editwhines.cgi
modified enter_bug.cgi
modified process_bug.cgi
modified query.cgi
modified sanitycheck.cgi
modified show_bug.cgi
modified showdependencygraph.cgi
modified summarize_time.cgi
modified userprefs.cgi
modified Bugzilla/WebService/Bug.pm
Committed revision 7930.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•