r24759 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24758‎ | r24759 | r24760 >
Date:21:58, 13 August 2007
Author:aaron
Status:old
Tags:
Comment:
*Enforce some limits, may adjust later
Modified paths:
  • /trunk/extensions/CheckUser/CheckUser_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CheckUser/CheckUser_body.php
@@ -146,7 +146,7 @@
147147 }
148148
149149 $dbr = wfGetDB( DB_SLAVE );
150 -
 150+ # Limit added for browser limitations and to avoid time outs
151151 $ip_conds = $this->getIpConds( $dbr, $ip, $xfor );
152152 $res = $dbr->select( 'cu_changes', '*', $ip_conds, $fname,
153153 array( 'ORDER BY' => 'cuc_timestamp DESC', 'LIMIT' => 5000 ) );
@@ -326,10 +326,13 @@
327327 $users_first = $users_last = $users_edits = $users_ids = array();
328328
329329 $dbr = wfGetDB( DB_SLAVE );
330 -
 330+ # Limit cap made to stop nasty timeouts
331331 $ip_conds = $this->getIpConds( $dbr, $ip, $xfor );
332 - $res = $dbr->select( 'cu_changes', array( 'cuc_user_text', 'cuc_timestamp', 'cuc_user', 'cuc_ip', 'cuc_agent', 'cuc_xff' ),
333 - $ip_conds, $fname, array( 'ORDER BY' => 'cuc_timestamp DESC' ) );
 332+ $res = $dbr->select( 'cu_changes',
 333+ array( 'cuc_user_text', 'cuc_timestamp', 'cuc_user', 'cuc_ip', 'cuc_agent', 'cuc_xff' ),
 334+ $ip_conds,
 335+ $fname,
 336+ array( 'ORDER BY' => 'cuc_timestamp DESC', 'LIMIT' => 10,000 ) );
334337
335338 if( !$dbr->numRows( $res ) ) {
336339 $s = wfMsgHtml( "checkuser-nomatch" )."\n";
@@ -366,9 +369,11 @@
367370 $s = '<ul>';
368371 foreach( $users_edits as $name => $count ) {
369372 $s .= '<li>';
370 - $s .= $sk->userLink( -1 , $name ) . $sk->userToolLinks( -1 , $name ); // hack, ALWAYS show contribs links
371 - $s .= ' (<a href="' . $wgTitle->escapeLocalURL( 'user=' . urlencode( $name ) ) . '">' . wfMsgHtml('checkuser-check') . '</a>)';
372 - $s .= ' (' . $wgLang->timeanddate( $users_first[$name], true ) . ' -- ' . $wgLang->timeanddate( $users_last[$name], true ) . ') ';
 373+ $s .= $sk->userLink( -1 , $name ) . $sk->userToolLinks( -1 , $name );
 374+ $s .= ' (<a href="' . $wgTitle->escapeLocalURL( 'user=' . urlencode( $name ) ) .
 375+ '">' . wfMsgHtml('checkuser-check') . '</a>)';
 376+ $s .= ' (' . $wgLang->timeanddate( $users_first[$name], true ) . ' -- ' .
 377+ $wgLang->timeanddate( $users_last[$name], true ) . ') ';
373378 $s .= ' [<strong>' . $count . '</strong>]<br/>';
374379 # Check if this user or IP is blocked
375380 # If so, give a link to the block log
@@ -489,8 +494,11 @@
490495 $wgOut->addHTML( '<p>'.wfMsgHtml('checkuser-log-fail').'</p>' );
491496 }
492497 $dbr = wfGetDB( DB_SLAVE );
493 - $res = $dbr->select( 'cu_changes', array( 'cuc_ip', 'cuc_timestamp' ), array( 'cuc_user' => $user_id ), $fname,
494 - array( 'ORDER BY' => 'cuc_timestamp DESC' ) );
 498+ # Limit cap made to stop nasty time outs
 499+ $res = $dbr->select( 'cu_changes', array( 'cuc_ip', 'cuc_timestamp' ),
 500+ array( 'cuc_user' => $user_id ),
 501+ $fname,
 502+ array( 'ORDER BY' => 'cuc_timestamp DESC', 'LIMIT' => 10,000 ) );
495503 if( !$dbr->numRows( $res ) ) {
496504 $s = wfMsgHtml("checkuser-nomatch")."\n";
497505 } else {

Status & tagging log