(bug 5865) Show warning when editing another users' user page and provide a link...
authorRob Church <robchurch@users.mediawiki.org>
Thu, 15 Jun 2006 06:55:42 +0000 (06:55 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Thu, 15 Jun 2006 06:55:42 +0000 (06:55 +0000)
RELEASE-NOTES
includes/EditPage.php
languages/Messages.php

index bfd2013..96f9f7a 100644 (file)
@@ -496,6 +496,8 @@ Some default configuration options have changed:
 * (bug 6296) Update to Indonesian localisation (id) #21
 * Introduce EditFormPreloadText hook, see docs/hooks.txt for more information
 * (bug 6095) Introduce RunUnknownJob hook, see docs/hooks.txt for more information
+* (bug 5865) Show warning when editing another users' user page and provide a link to edit
+  their talk page instead
 
 == Compatibility ==
 
index a3c98d6..ba11227 100644 (file)
@@ -814,6 +814,15 @@ class EditPage {
                        }
                }
 
+               $curUP = $wgUser->getUserPage();
+               $editingOTP = substr( $this->mTitle->getPrefixedText(), 0, strlen( $curUP->getPrefixedText() ) ) != $curUP->getPrefixedText()
+                       && $this->formtype != 'preview'
+                       && $this->formtype != 'diff';
+               if( $editingOTP ) {
+                       $utpLink = $sk->makeKnownLinkObj( $this->mTitle->getTalkPage(), wfMsgHtml( 'editinguserpagetalklink' ), 'action=edit' );
+                       $wgOut->addHtml( wfMsgWikiHtml( 'editinguserpage', $utpLink ) );
+               }
+
                if( wfReadOnly() ) {
                        $wgOut->addWikiText( wfMsg( 'readonlywarning' ) );
                } elseif( $wgUser->isAnon() && $this->formtype != 'preview' ) {
index ffdc013..d90b467 100644 (file)
@@ -468,6 +468,8 @@ format. Please enter a well-formatted address or empty that field.',
 'showdiff'     => 'Show changes',
 'anoneditwarning' => "'''Warning:''' You are not logged in. Your IP address will be recorded in this page's edit history.",
 'missingsummary' => "'''Reminder:''' You have not provided an edit summary. If you click Save again, your edit will be saved without one.",
+'editinguserpage' => "'''Note:''' You are editing a [[Help:User page|user page]]. To leave this user a message, $1.",
+'editinguserpagetalklink' => 'edit their talk page',
 'missingcommenttext' => 'Please enter a comment below.',
 'blockedtitle' => 'User is blocked',
 'blockedtext'  => 'Your user name or IP address has been blocked by $1.