Make the hack from r33376 conditional...
authorBrion Vibber <brion@users.mediawiki.org>
Wed, 30 Apr 2008 23:49:28 +0000 (23:49 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Wed, 30 Apr 2008 23:49:28 +0000 (23:49 +0000)
This'll put the username field back in except where disabled (due to need to fix up indexes on wikipedia sites)

includes/DefaultSettings.php
includes/SpecialNewpages.php

index 93f0487..cbcba2e 100644 (file)
@@ -1892,6 +1892,11 @@ $wgRC2UDPAddress = false;
 $wgRC2UDPPort = false;
 $wgRC2UDPPrefix = '';
 
+# Enable user search in Special:Newpages
+# This is really a temporary hack around an index install bug on some Wikipedias.
+# Kill it once fixed.
+$wgEnableNewpagesUserFilter = true;
+
 #
 # Copyright and credits settings
 #
index 617c055..6f8fad9 100644 (file)
@@ -28,6 +28,7 @@ class NewPagesForm {
         */
        public function showList( $par, $including ) {
                global $wgScript, $wgLang, $wgGroupPermissions, $wgRequest, $wgUser, $wgOut;
+               global $wgEnableNewpagesUserFilter;
                $sk = $wgUser->getSkin();
                $self = SpecialPage::getTitleFor( 'NewPages' );
 
@@ -95,8 +96,10 @@ class NewPagesForm {
                        }
                }
 
-               // hack disable
-               $options['username'] = '';
+               if( !$wgEnableNewpagesUserFilter ) {
+                       // hack disable
+                       $options['username'] = '';
+               }
                
                if( !$including ){
                        $wgOut->setSyndicated( true );
@@ -146,18 +149,17 @@ class NewPagesForm {
                                        <td class='mw-input'>" .
                                                Xml::namespaceSelector( $options['namespace'], 'all' ) .
                                        "</td>
-                               </tr>
-                               <!--
-                               <tr>
+                               </tr>" .
+                               ($wgEnableNewpagesUserFilter ?
+                               "<tr>
                                        <td class='mw-label'>" .
                                                Xml::label( wfMsg( 'newpages-username' ), 'mw-np-username' ) .
                                        "</td>
                                        <td class='mw-input'>" .
                                                Xml::input( 'username', 30, $options['username'], array( 'id' => 'mw-np-username' ) ) .
                                        "</td>
-                               </tr>
-                               -->
-                               <tr> <td></td>
+                               </tr>" : "" ) .
+                               "<tr> <td></td>
                                        <td class='mw-submit'>" .
                                                Xml::submitButton( wfMsg( 'allpagessubmit' ) ) .
                                        "</td>
@@ -345,6 +347,7 @@ class NewPagesPager extends ReverseChronologicalPager {
        }
 
        function getQueryInfo() {
+               global $wgEnableNewpagesUserFilter;
                $conds = $this->mConds;
                $conds['rc_new'] = 1;
                if( $this->namespace !== false ) {
@@ -353,6 +356,9 @@ class NewPagesPager extends ReverseChronologicalPager {
                } else {
                        $rcIndexes = array( 'rc_timestamp' );
                }
+               if( $wgEnableNewpagesUserFilter ) {
+                       $rcIndex[] = 'rc_user_text';
+               }
                $conds[] = 'page_id = rc_cur_id';
                $conds['page_is_redirect'] = 0;