From 265cc589851fc51b0ef324574ddcc7bb7cd20245 Mon Sep 17 00:00:00 2001 From: Rob Church Date: Thu, 15 Jun 2006 06:55:42 +0000 Subject: [PATCH] (bug 5865) Show warning when editing another users' user page and provide a link to edit their talk page instead --- RELEASE-NOTES | 2 ++ includes/EditPage.php | 9 +++++++++ languages/Messages.php | 2 ++ 3 files changed, 13 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index bfd2013eed..96f9f7a4d5 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 == diff --git a/includes/EditPage.php b/includes/EditPage.php index a3c98d676f..ba11227e33 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -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' ) { diff --git a/languages/Messages.php b/languages/Messages.php index ffdc0131ea..d90b467a5b 100644 --- a/languages/Messages.php +++ b/languages/Messages.php @@ -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. -- 2.20.1