(bug 5865) Warning on editing other user's userpage
authorJohn Du Hart <johnduhart@users.mediawiki.org>
Thu, 1 Sep 2011 03:56:33 +0000 (03:56 +0000)
committerJohn Du Hart <johnduhart@users.mediawiki.org>
Thu, 1 Sep 2011 03:56:33 +0000 (03:56 +0000)
RELEASE-NOTES-1.19
includes/EditPage.php
languages/messages/MessagesEn.php

index 872738b..805b980 100644 (file)
@@ -51,6 +51,7 @@ production.
 * (bug 30344) Add configuration variable for setting custom priorities when
   generating sitemaps
 * (bug 16428) Include permalink in printable version
+* (bug 5865) Warning on editing other user's userpage
 
 === Bug fixes in 1.19 ===
 * $wgUploadNavigationUrl should be used for file redlinks if
index 90434a4..a0bafa7 100644 (file)
@@ -1605,6 +1605,17 @@ HTML
                        }
                }
 
+               $curUP = $wgUser->getUserPage();
+               $sk = $wgOut->getSkin();
+               if ( $this->mTitle->getNamespace() == NS_USER
+                       && substr( $this->mTitle->getPrefixedText(), 0, strlen( $curUP->getPrefixedText() ) ) != $curUP->getPrefixedText()
+                       && $this->formtype != 'preview'
+                       && $this->formtype != 'diff' )
+               {
+                       $utpLink = $sk->makeKnownLinkObj( $this->mTitle->getTalkPage(), wfMsgHtml( 'editinguserpagetalklink' ), 'action=edit' );
+                       $wgOut->addHTML( wfMsgWikiHtml( 'editinguserpage', $utpLink ) );
+               }
+
                if ( wfReadOnly() ) {
                        $wgOut->wrapWikiMsg( "<div id=\"mw-read-only-warning\">\n$1\n</div>", array( 'readonlywarning', wfReadOnlyReason() ) );
                } elseif ( $wgUser->isAnon() ) {
index 98b3712..cafa477 100644 (file)
@@ -1437,6 +1437,8 @@ It appears to have been deleted.',
 'edit-no-change'                   => 'Your edit was ignored, because no change was made to the text.',
 'edit-already-exists'              => 'Could not create a new page.
 It already exists.',
+'editinguserpage' => "'''Note:''' You are editing a [[Help:User page|user page]]. To leave this user a message, $1.",
+'editinguserpagetalklink' => 'edit their talk page',
 'addsection-preload'               => '', # do not translate or duplicate this message to other languages
 'addsection-editintro'             => '', # do not translate or duplicate this message to other languages