Do not log user rights change that didn't change anything
authorAryeh Gregor <simetrical@users.mediawiki.org>
Thu, 10 Jan 2008 02:28:58 +0000 (02:28 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Thu, 10 Jan 2008 02:28:58 +0000 (02:28 +0000)
RELEASE-NOTES
includes/SpecialUserrights.php

index 5d74b84..fa39373 100644 (file)
@@ -293,7 +293,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 12489) Special:Userrights listed in restricted section again
 * (bug 12553) Fixed invalid XHTML in edit conflict screen
 * (bug 12505) Fixed section=0 with action=raw
-
+* Do not log user rights change that didn't change anything
 
 == Parser changes in 1.12 ==
 
index 40fe55a..4b0a50a 100644 (file)
@@ -136,17 +136,19 @@ class UserrightsPage extends SpecialPage {
                        wfRunHooks( 'UserRights', array( &$user, $addgroup, $removegroup ) );
                }
 
-               $log = new LogPage( 'rights' );
-
-               global $wgRequest;
-               $log->addEntry( 'rights',
-                       $user->getUserPage(),
-                       $wgRequest->getText( 'user-reason' ),
-                       array(
-                               $this->makeGroupNameList( $oldGroups ),
-                               $this->makeGroupNameList( $newGroups )
-                       )
-               );
+               if( $addgroup or $removegroup ) {
+                       $log = new LogPage( 'rights' );
+
+                       global $wgRequest;
+                       $log->addEntry( 'rights',
+                               $user->getUserPage(),
+                               $wgRequest->getText( 'user-reason' ),
+                               array(
+                                       $this->makeGroupNameList( $oldGroups ),
+                                       $this->makeGroupNameList( $newGroups )
+                               )
+                       );
+               }
        }
 
        /**