* Hide undo link if user can't edit article
authorVictor Vasiliev <vasilievvv@users.mediawiki.org>
Thu, 27 Dec 2007 18:05:40 +0000 (18:05 +0000)
committerVictor Vasiliev <vasilievvv@users.mediawiki.org>
Thu, 27 Dec 2007 18:05:40 +0000 (18:05 +0000)
RELEASE-NOTES
includes/PageHistory.php

index a40d1a2..0eba7fb 100644 (file)
@@ -267,6 +267,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 12371) Handle more namespace case variants in namespaceDupes.php
 * (bug 12380) Bot-friendly EditPage::spamPage
 * (bug 8066) Spaces can't be entered in special page aliases
+* Hide undo link if user can't edit article
 
 == Parser changes in 1.12 ==
 
index d2da47a..9d84665 100644 (file)
@@ -267,12 +267,14 @@ class PageHistory {
                                        . '</span>';
                        }
 
-                       $undolink = $this->mSkin->makeKnownLinkObj(
-                               $this->mTitle,
-                               wfMsgHtml( 'editundo' ),
-                               'action=edit&undoafter=' . $next->rev_id . '&undo=' . $rev->getId()
-                       );
-                       $tools[] = "<span class=\"mw-history-undo\">{$undolink}</span>";
+                       if( $this->mTitle->quickUserCan( 'edit' ) ) {
+                               $undolink = $this->mSkin->makeKnownLinkObj(
+                                       $this->mTitle,
+                                       wfMsgHtml( 'editundo' ),
+                                       'action=edit&undoafter=' . $next->rev_id . '&undo=' . $rev->getId()
+                               );
+                               $tools[] = "<span class=\"mw-history-undo\">{$undolink}</span>";
+                       }
                }
                
                if( $tools ) {