r43990 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r43989‎ | r43990 | r43991 >
Date:07:45, 27 November 2008
Author:aaron
Status:ok (Comments)
Tags:
Comment:
(bug 16445) add info if accounts are not sul accounts to cu results
Modified paths:
  • /trunk/extensions/CheckUser/CheckUser_body.php (modified) (history)
  • /trunk/phase3/includes/AuthPlugin.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/AuthPlugin.php
@@ -244,6 +244,11 @@
245245 # Override this!
246246 }
247247
 248+ public function getId() {
 249+ # Override this!
 250+ return -1;
 251+ }
 252+
248253 public function isLocked() {
249254 # Override this!
250255 return false;
Index: trunk/extensions/CheckUser/CheckUser_body.php
@@ -777,6 +777,7 @@
778778 if( !$dbr->numRows( $ret ) ) {
779779 $s = $this->noMatchesMessage($ip)."\n";
780780 } else {
 781+ global $wgAuth;
781782 while( ($row = $dbr->fetchObject($ret) ) != false ) {
782783 if( !array_key_exists( $row->cuc_user_text, $users_edits ) ) {
783784 $users_last[$row->cuc_user_text] = $row->cuc_timestamp;
@@ -805,30 +806,39 @@
806807
807808 $logs = SpecialPage::getTitleFor( 'Log' );
808809 $blocklist = SpecialPage::getTitleFor( 'Ipblocklist' );
809 -
 810+
810811 $action = $wgTitle->escapeLocalUrl( 'action=block' );
811812 $s = "<form name='checkuserblock' id='checkuserblock' action=\"$action\" method='post'>";
812813 $s .= '<div id="checkuserresults"><ul>';
813814 foreach( $users_edits as $name => $count ) {
814815 $s .= '<li>';
815816 $s .= Xml::check( 'users[]', false, array( 'value' => $name ) ) . '&nbsp;';
 817+ # Load user object
 818+ $user = User::newFromName( $name, false );
 819+ $authUser = $wgAuth->getUserInstance( $user );
 820+ # Show if account is local only
 821+ if( $authUser->getId() === 0 ) {
 822+ $s .= '*';
 823+ }
 824+ # Add user tool links
816825 $s .= $this->sk->userLink( -1 , $name ) . $this->sk->userToolLinks( -1 , $name );
 826+ # Add CheckUser link
817827 $s .= ' (<a href="' . $wgTitle->escapeLocalURL( 'user='.urlencode($name) .
818828 '&reason='.urlencode($reason) ) . '">' . wfMsgHtml('checkuser-check') . '</a>)';
 829+ # Show edit time range
819830 if( $users_first[$name] == $users_last[$name] ) {
820831 $s .= ' (' . $wgLang->timeanddate( wfTimestamp(TS_MW,$users_first[$name]), true ) . ') ';
821832 } else {
822833 $s .= ' (' . $wgLang->timeanddate( wfTimestamp(TS_MW,$users_first[$name]), true ) .
823834 ' -- ' . $wgLang->timeanddate( wfTimestamp(TS_MW,$users_last[$name]), true ) . ') ';
824835 }
 836+ # Total edit count
825837 $s .= ' [<strong>' . $count . '</strong>]<br />';
826 - $flags = array();
827838 # Check if this user or IP is blocked. If so, give a link to the block log...
828839 $block = new Block();
829840 $block->fromMaster( false ); // use slaves
830841 $ip = IP::isIPAddress( $name ) ? $name : '';
831 - # Load user object
832 - $user = User::newFromName( $name, false );
 842+ $flags = array();
833843 if( $block->load( $ip, $users_ids[$name] ) ) {
834844 // Range blocked?
835845 if( IP::isIPAddress($block->mAddress) && strpos($block->mAddress,'/') ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r44462(bug 16445) Use more obvious text than *aaron19:31, 11 December 2008

Comments

#Comment by Brion VIBBER (talk | contribs)   19:10, 11 December 2008

The "*" is not really discoverable in that you can see it's there but will have no idea what it means. It's also hardcoded, so it's not localizable. I'd strongly recommend changing this to some bit of clear text.

Status & tagging log