r34065 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r34064‎ | r34065 | r34066 >
Date:23:49, 30 April 2008
Author:brion
Status:old
Tags:
Comment:
Make the hack from r33376 conditional...
This'll put the username field back in except where disabled (due to need to fix up indexes on wikipedia sites)
Modified paths:
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/SpecialNewpages.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialNewpages.php
@@ -28,6 +28,7 @@
2929 */
3030 public function showList( $par, $including ) {
3131 global $wgScript, $wgLang, $wgGroupPermissions, $wgRequest, $wgUser, $wgOut;
 32+ global $wgEnableNewpagesUserFilter;
3233 $sk = $wgUser->getSkin();
3334 $self = SpecialPage::getTitleFor( 'NewPages' );
3435
@@ -95,8 +96,10 @@
9697 }
9798 }
9899
99 - // hack disable
100 - $options['username'] = '';
 100+ if( !$wgEnableNewpagesUserFilter ) {
 101+ // hack disable
 102+ $options['username'] = '';
 103+ }
101104
102105 if( !$including ){
103106 $wgOut->setSyndicated( true );
@@ -146,18 +149,17 @@
147150 <td class='mw-input'>" .
148151 Xml::namespaceSelector( $options['namespace'], 'all' ) .
149152 "</td>
150 - </tr>
151 - <!--
152 - <tr>
 153+ </tr>" .
 154+ ($wgEnableNewpagesUserFilter ?
 155+ "<tr>
153156 <td class='mw-label'>" .
154157 Xml::label( wfMsg( 'newpages-username' ), 'mw-np-username' ) .
155158 "</td>
156159 <td class='mw-input'>" .
157160 Xml::input( 'username', 30, $options['username'], array( 'id' => 'mw-np-username' ) ) .
158161 "</td>
159 - </tr>
160 - -->
161 - <tr> <td></td>
 162+ </tr>" : "" ) .
 163+ "<tr> <td></td>
162164 <td class='mw-submit'>" .
163165 Xml::submitButton( wfMsg( 'allpagessubmit' ) ) .
164166 "</td>
@@ -345,6 +347,7 @@
346348 }
347349
348350 function getQueryInfo() {
 351+ global $wgEnableNewpagesUserFilter;
349352 $conds = $this->mConds;
350353 $conds['rc_new'] = 1;
351354 if( $this->namespace !== false ) {
@@ -353,6 +356,9 @@
354357 } else {
355358 $rcIndexes = array( 'rc_timestamp' );
356359 }
 360+ if( $wgEnableNewpagesUserFilter ) {
 361+ $rcIndex[] = 'rc_user_text';
 362+ }
357363 $conds[] = 'page_id = rc_cur_id';
358364 $conds['page_is_redirect'] = 0;
359365
Index: trunk/phase3/includes/DefaultSettings.php
@@ -1892,6 +1892,11 @@
18931893 $wgRC2UDPPort = false;
18941894 $wgRC2UDPPrefix = '';
18951895
 1896+# Enable user search in Special:Newpages
 1897+# This is really a temporary hack around an index install bug on some Wikipedias.
 1898+# Kill it once fixed.
 1899+$wgEnableNewpagesUserFilter = true;
 1900+
18961901 #
18971902 # Copyright and credits settings
18981903 #

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r33376Temporarily remove the username option....brion17:33, 15 April 2008

Status & tagging log