Index: trunk/extensions/CheckUser/CheckUser_body.php |
— | — | @@ -466,9 +466,10 @@ |
467 | 467 | } else if( isset($rangecount) && !$rangecount ) { |
468 | 468 | $s = wfMsgHtml("checkuser-nomatch")."\n"; |
469 | 469 | $wgOut->addHTML( $s ); |
470 | | - |
471 | 470 | return; |
472 | | - } |
| 471 | + } |
| 472 | + |
| 473 | + global $wgMemc; |
473 | 474 | # OK, do the real query... |
474 | 475 | $use_index = $dbr->useIndexClause( $index ); |
475 | 476 | $sql = "SELECT cuc_user_text, cuc_timestamp, cuc_user, cuc_ip, cuc_agent, cuc_xff |
— | — | @@ -477,7 +478,6 @@ |
478 | 479 | $ret = $dbr->query( $sql, __METHOD__ ); |
479 | 480 | |
480 | 481 | $users_first = $users_last = $users_edits = $users_ids = array(); |
481 | | - |
482 | 482 | if( !$dbr->numRows( $ret ) ) { |
483 | 483 | $s = wfMsgHtml( "checkuser-nomatch" )."\n"; |
484 | 484 | } else { |
— | — | @@ -506,7 +506,7 @@ |
507 | 507 | } |
508 | 508 | } |
509 | 509 | $dbr->freeResult( $ret ); |
510 | | - |
| 510 | + |
511 | 511 | $logs = SpecialPage::getTitleFor( 'Log' ); |
512 | 512 | $blocklist = SpecialPage::getTitleFor( 'Ipblocklist' ); |
513 | 513 | $s = '<ul>'; |
— | — | @@ -522,32 +522,42 @@ |
523 | 523 | ' -- ' . $wgLang->timeanddate( $users_last[$name], true ) . ') '; |
524 | 524 | } |
525 | 525 | $s .= ' [<strong>' . $count . '</strong>]<br />'; |
| 526 | + $flags = array(); |
526 | 527 | # Check if this user or IP is blocked. If so, give a link to the block log... |
527 | 528 | $block = new Block(); |
528 | 529 | $block->fromMaster( false ); // use slaves |
529 | | - $ip = IP::isIPAddress( $name ) ? $name : ''; // only check IP blocks if we have an IP |
| 530 | + $ip = IP::isIPAddress( $name ) ? // If an account, get last IP |
| 531 | + $name : $users_infosets[$name][count($users_infosets[$name])-1][0]; |
530 | 532 | if( $block->load( $ip, $users_ids[$name] ) ) { |
531 | 533 | if( IP::isIPAddress($block->mAddress) && strpos($block->mAddress,'/') ) { |
532 | 534 | $userpage = Title::makeTitle( NS_USER, $block->mAddress ); |
533 | 535 | $blocklog = $this->sk->makeKnownLinkObj( $logs, wfMsgHtml('checkuser-blocked'), |
534 | 536 | 'type=block&page=' . urlencode( $userpage->getPrefixedText() ) ); |
535 | | - $s .= ' <strong>(' . $blocklog . ' - ' . $block->mAddress . ')</strong>'; |
| 537 | + $flags[] = '<strong>(' . $blocklog . ' - ' . $block->mAddress . ')</strong>'; |
536 | 538 | } else if( $block->mAuto ) { |
537 | 539 | $blocklog = $this->sk->makeKnownLinkObj( $blocklist, |
538 | 540 | wfMsgHtml('checkuser-blocked'), 'ip=' . urlencode( "#$block->mId" ) ); |
539 | | - $s .= ' <strong>(' . $blocklog . ')</strong>'; |
| 541 | + $flags[] = '<strong>(' . $blocklog . ')</strong>'; |
540 | 542 | } else { |
541 | 543 | $userpage = Title::makeTitle( NS_USER, $name ); |
542 | 544 | $blocklog = $this->sk->makeKnownLinkObj( $logs, wfMsgHtml('checkuser-blocked'), |
543 | 545 | 'type=block&page=' . urlencode( $userpage->getPrefixedText() ) ); |
544 | | - $s .= '<strong>(' . $blocklog . ')</strong>'; |
| 546 | + $flags[] = '<strong>(' . $blocklog . ')</strong>'; |
545 | 547 | } |
546 | 548 | } else if( self::userWasBlocked( $name ) ) { |
547 | 549 | $userpage = Title::makeTitle( NS_USER, $name ); |
548 | 550 | $blocklog = $this->sk->makeKnownLinkObj( $logs, wfMsgHtml('checkuser-wasblocked'), |
549 | 551 | 'type=block&page=' . urlencode( $userpage->getPrefixedText() ) ); |
550 | | - $s .= '<strong>(' . $blocklog . ')</strong>'; |
| 552 | + $flags[] = '<strong>(' . $blocklog . ')</strong>'; |
551 | 553 | } |
| 554 | + # Check how many accounts the user made recently? |
| 555 | + if( $ip ) { |
| 556 | + $key = wfMemcKey( 'acctcreate', 'ip', $ip ); |
| 557 | + $count = intval( $wgMemc->get( $key ) ); |
| 558 | + if( $count ) { |
| 559 | + $flags[] = '<strong>[' . wfMsgHtml('checkuser-accounts',$count) . ']</strong>'; |
| 560 | + } |
| 561 | + } |
552 | 562 | # Check for extra user rights... |
553 | 563 | if( $users_ids[$name] ) { |
554 | 564 | $user = User::newFromId( $users_ids[$name] ); |
— | — | @@ -557,9 +567,10 @@ |
558 | 568 | } |
559 | 569 | $groups = implode( ', ', $list ); |
560 | 570 | if( $groups ) { |
561 | | - $s .= ' (' . $groups . ')'; |
| 571 | + $flags[] = '<i>(' . $groups . ')</i>'; |
562 | 572 | } |
563 | 573 | } |
| 574 | + $s .= implode(' ',$flags); |
564 | 575 | $s .= '<ol>'; |
565 | 576 | # List out each IP/XFF combo for this username |
566 | 577 | for( $i = (count($users_infosets[$name]) - 1); $i >= 0; $i-- ) { |
— | — | @@ -583,7 +594,6 @@ |
584 | 595 | # List out each agent for this username |
585 | 596 | for( $i = (count($users_agentsets[$name]) - 1); $i >= 0; $i-- ) { |
586 | 597 | $agent = $users_agentsets[$name][$i]; |
587 | | - # IP link |
588 | 598 | $s .= "<li><i>" . htmlspecialchars($agent) . "</i></li>\n"; |
589 | 599 | } |
590 | 600 | $s .= '</ol>'; |
Index: trunk/extensions/CheckUser/CheckUser.i18n.php |
— | — | @@ -35,6 +35,7 @@ |
36 | 36 | 'checkuser-nolog' => 'No log file found.', |
37 | 37 | 'checkuser-blocked' => 'Blocked', |
38 | 38 | 'checkuser-wasblocked' => 'Previously blocked', |
| 39 | + 'checkuser-accounts' => '$1 new accounts', |
39 | 40 | 'checkuser-too-many' => 'Too many results, please narrow down the CIDR. |
40 | 41 | Here are the IPs used (5000 max, sorted by address):', |
41 | 42 | 'checkuser-user-nonexistent' => 'The specified user does not exist.', |