(bug 13441) Allow Special:Recentchanges to show bots only
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Wed, 2 Apr 2008 10:47:50 +0000 (10:47 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Wed, 2 Apr 2008 10:47:50 +0000 (10:47 +0000)
RELEASE-NOTES
includes/SpecialRecentchanges.php

index c67c324..a6046e8 100644 (file)
@@ -149,6 +149,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 13554) PHP Notice in old pre-processor when list item is empty.
 * (bug 13556) Don't show a blank form if no image is attached in Special:Upload
 * (bug 13576) maintenance/rebuildrecentchanges.php fails
+* (bug 13441) Allow Special:Recentchanges to show bots only
 
 === API changes in 1.13 ===
 
index 382833d..22c92c5 100644 (file)
@@ -132,16 +132,25 @@ function wfSpecialRecentchanges( $par, $specialPage ) {
 
        # It makes no sense to hide both anons and logged-in users
        # Where this occurs, force anons to be shown
-       if( $hideanons && $hideliu )
-               $hideanons = false;
+       $forcebot = false;
+       if( $hideanons && $hideliu ){
+               # Check if the user wants to show bots only
+               if( $hidebots ){
+                       $hideanons = 0;
+               } else {
+                       $forcebot = true;
+                       $hidebots = 0;
+               }
+       }
 
        # Form WHERE fragments for all the options
        $hidem  = $hideminor ? 'AND rc_minor = 0' : '';
        $hidem .= $hidebots ? ' AND rc_bot = 0' : '';
-       $hidem .= $hideliu ? ' AND rc_user = 0' : '';
+       $hidem .= $hideliu && !$forcebot ? ' AND rc_user = 0' : '';
        $hidem .= ( ChangesList::usePatrol() && $hidepatrolled ) ? ' AND rc_patrolled = 0' : '';
-       $hidem .= $hideanons ? ' AND rc_user != 0' : '';
-       
+       $hidem .= $hideanons && !$forcebot ? ' AND rc_user != 0' : '';
+       $hidem .= $forcebot ? ' AND rc_bot = 1' : '';
+
        if( $hidemyself ) {
                if( $wgUser->getID() ) {
                        $hidem .= ' AND rc_user != ' . $wgUser->getID();