Index: trunk/phase3/includes/specials/SpecialContributions.php |
— | — | @@ -224,7 +224,7 @@ |
225 | 225 | $nt = $userObj->getUserPage(); |
226 | 226 | $talk = $userObj->getTalkPage(); |
227 | 227 | if ( $talk ) { |
228 | | - $tools = $this->getUserLinks( $nt, $talk, $userObj, $this->getUser() ); |
| 228 | + $tools = $this->getUserLinks( $nt, $talk, $userObj ); |
229 | 229 | $links = $this->getLanguage()->pipeList( $tools ); |
230 | 230 | |
231 | 231 | // Show a note if the user is blocked and display the last block log entry. |
— | — | @@ -267,10 +267,9 @@ |
268 | 268 | * @param $userpage Title: Target user page |
269 | 269 | * @param $talkpage Title: Talk page |
270 | 270 | * @param $target User: Target user object |
271 | | - * @param $subject User: The viewing user ($wgUser might be still checked in some cases) |
272 | 271 | * @return array |
273 | 272 | */ |
274 | | - public function getUserLinks( Title $userpage, Title $talkpage, User $target, User $subject ) { |
| 273 | + public function getUserLinks( Title $userpage, Title $talkpage, User $target ) { |
275 | 274 | |
276 | 275 | $id = $target->getId(); |
277 | 276 | $username = $target->getName(); |
— | — | @@ -278,7 +277,7 @@ |
279 | 278 | $tools[] = Linker::link( $talkpage, $this->msg( 'sp-contributions-talk' )->escaped() ); |
280 | 279 | |
281 | 280 | 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 |
283 | 282 | if ( $target->isBlocked() ) { |
284 | 283 | $tools[] = Linker::linkKnown( # Change block link |
285 | 284 | SpecialPage::getTitleFor( 'Block', $username ), |
— | — | @@ -318,7 +317,7 @@ |
319 | 318 | ); |
320 | 319 | |
321 | 320 | # Add link to deleted user contributions for priviledged users |
322 | | - if ( $subject->isAllowed( 'deletedhistory' ) ) { |
| 321 | + if ( $this->getUser()->isAllowed( 'deletedhistory' ) ) { |
323 | 322 | $tools[] = Linker::linkKnown( |
324 | 323 | SpecialPage::getTitleFor( 'DeletedContributions', $username ), |
325 | 324 | $this->msg( 'sp-contributions-deleted' )->escaped() |
— | — | @@ -327,7 +326,7 @@ |
328 | 327 | |
329 | 328 | # Add a link to change user rights for privileged users |
330 | 329 | $userrightsPage = new UserrightsPage(); |
331 | | - $userrightsPage->getContext()->setUser( $subject ); |
| 330 | + $userrightsPage->setContext( $this->getContext() ); |
332 | 331 | if ( $id !== null && $userrightsPage->userCanChangeRights( $target ) ) { |
333 | 332 | $tools[] = Linker::linkKnown( |
334 | 333 | SpecialPage::getTitleFor( 'Userrights', $username ), |