r107394 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107393‎ | r107394 | r107395 >
Date:16:26, 27 December 2011
Author:ialex
Status:ok
Tags:
Comment:
Follow-up r107341: remove now-useless parameter
Modified paths:
  • /trunk/phase3/includes/specials/SpecialContributions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialContributions.php
@@ -224,7 +224,7 @@
225225 $nt = $userObj->getUserPage();
226226 $talk = $userObj->getTalkPage();
227227 if ( $talk ) {
228 - $tools = $this->getUserLinks( $nt, $talk, $userObj, $this->getUser() );
 228+ $tools = $this->getUserLinks( $nt, $talk, $userObj );
229229 $links = $this->getLanguage()->pipeList( $tools );
230230
231231 // Show a note if the user is blocked and display the last block log entry.
@@ -267,10 +267,9 @@
268268 * @param $userpage Title: Target user page
269269 * @param $talkpage Title: Talk page
270270 * @param $target User: Target user object
271 - * @param $subject User: The viewing user ($wgUser might be still checked in some cases)
272271 * @return array
273272 */
274 - public function getUserLinks( Title $userpage, Title $talkpage, User $target, User $subject ) {
 273+ public function getUserLinks( Title $userpage, Title $talkpage, User $target ) {
275274
276275 $id = $target->getId();
277276 $username = $target->getName();
@@ -278,7 +277,7 @@
279278 $tools[] = Linker::link( $talkpage, $this->msg( 'sp-contributions-talk' )->escaped() );
280279
281280 if ( ( $id !== null ) || ( $id === null && IP::isIPAddress( $username ) ) ) {
282 - if ( $subject->isAllowed( 'block' ) ) { # Block / Change block / Unblock links
 281+ if ( $this->getUser()->isAllowed( 'block' ) ) { # Block / Change block / Unblock links
283282 if ( $target->isBlocked() ) {
284283 $tools[] = Linker::linkKnown( # Change block link
285284 SpecialPage::getTitleFor( 'Block', $username ),
@@ -318,7 +317,7 @@
319318 );
320319
321320 # Add link to deleted user contributions for priviledged users
322 - if ( $subject->isAllowed( 'deletedhistory' ) ) {
 321+ if ( $this->getUser()->isAllowed( 'deletedhistory' ) ) {
323322 $tools[] = Linker::linkKnown(
324323 SpecialPage::getTitleFor( 'DeletedContributions', $username ),
325324 $this->msg( 'sp-contributions-deleted' )->escaped()
@@ -327,7 +326,7 @@
328327
329328 # Add a link to change user rights for privileged users
330329 $userrightsPage = new UserrightsPage();
331 - $userrightsPage->getContext()->setUser( $subject );
 330+ $userrightsPage->setContext( $this->getContext() );
332331 if ( $id !== null && $userrightsPage->userCanChangeRights( $target ) ) {
333332 $tools[] = Linker::linkKnown(
334333 SpecialPage::getTitleFor( 'Userrights', $username ),

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r107341Fix fixme on r107328, attempting to use $this in a static method...reedy21:03, 26 December 2011

Status & tagging log