From 9e7de314f1853c874c5d744175d64f62dc41fb9b Mon Sep 17 00:00:00 2001 From: Raimond Spekking Date: Tue, 27 Nov 2007 18:04:24 +0000 Subject: [PATCH] * Show a warning message when creating/editing a user (talk) page but the user does not exists --- RELEASE-NOTES | 2 ++ includes/EditPage.php | 20 ++++++++++++++++---- languages/messages/MessagesDe.php | 1 + languages/messages/MessagesEn.php | 1 + maintenance/language/messages.inc | 1 + 5 files changed, 21 insertions(+), 4 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 4252f7de7e..b6baf156c6 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -80,6 +80,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN cleanly if database connections fail unpleasantly. * (bug 12028) Add Special:Listbots as shortcut for Special:Listusers/bot * (bug 9633) Add a predefined list of delete reasons to the deletion form +* Show a warning message when creating/editing a user (talk) page but the user + does not exists === Bug fixes in 1.12 === diff --git a/includes/EditPage.php b/includes/EditPage.php index 9538669581..45c4ad9543 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -623,17 +623,29 @@ class EditPage { */ private function showIntro() { global $wgOut, $wgUser; - if( $this->suppressIntro ) return; + if( $this->suppressIntro ) + return; + + # Show a warning message when someone creates/edits a user (talk) page but the user does not exists + if( $this->mTitle->getNamespace() == NS_USER || $this->mTitle->getNamespace() == NS_USER_TALK ) { + $id = User::idFromName( $this->mTitle->getBaseText() ); + $ip = User::isIP( $this->mTitle->getBaseText() ); + + if ( $id == 0 && !$ip ) { + $wgOut->addWikiText( '
' . wfMsg( 'userpage-userdoesnotexist', $this->mTitle->getBaseText() ) . '
' ); + } + } + if( !$this->showCustomIntro() && !$this->mTitle->exists() ) { if( $wgUser->isLoggedIn() ) { - $wgOut->addWikiText( wfMsg( 'newarticletext' ) ); + $wgOut->addWikiText( '
' . wfMsg( 'newarticletext' ) . '
' ); } else { - $wgOut->addWikiText( wfMsg( 'newarticletextanon' ) ); + $wgOut->addWikiText( '
' . wfMsg( 'newarticletextanon' ) . '
' ); } $this->showDeletionLog( $wgOut ); } } - + /** * Attempt to show a custom editing introduction, if supplied * diff --git a/languages/messages/MessagesDe.php b/languages/messages/MessagesDe.php index 9c85af71fb..276d6d9a4c 100644 --- a/languages/messages/MessagesDe.php +++ b/languages/messages/MessagesDe.php @@ -692,6 +692,7 @@ Du kannst $1 oder einen der anderen [[{{MediaWiki:Grouppage-sysop}}|Administrato 'newarticletext' => 'Hier den Text der neuen Seite eintragen. Bitte nur in ganzen Sätzen schreiben und keine urheberrechtsgeschützten Texte anderer kopieren.', 'anontalkpagetext' => "---- ''Diese Seite dient dazu, einem nicht angemeldeten Benutzer Nachrichten zu hinterlassen. Wenn du mit den Kommentaren auf dieser Seite nichts anfangen kannst, richten sie sich vermutlich an einen früheren Inhaber deiner IP-Adresse und du kannst sie ignorieren.''", 'noarticletext' => '(Diese Seite enthält momentan noch keinen Text)', +'userpage-userdoesnotexist' => 'Das Benutzerkonto „$1“ ist nicht vorhanden. Bitte prüfe, ob du diese Seite wirklich erstellen/bearbeiten willst.', 'clearyourcache' => "'''Hinweis:''' Leere nach dem Speichern den Browser-Cache, um die Änderungen zu sehen: '''Mozilla/Firefox:''' ''Shift-Strg-R'', '''Internet Explorer:''' ''Strg-F5'', '''Opera:''' ''F5'', '''Safari:''' ''⌘-R'', '''Konqueror:''' ''Strg-R''.", 'usercssjsyoucanpreview' => 'Tipp: Benutze den Vorschau-Button, um dein neues css/js vor dem Speichern zu testen.', 'usercsspreview' => "== Vorschau Ihres Benutzer-CSS == diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index df151616dc..ff9b1c82bd 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -1014,6 +1014,7 @@ If you are here by mistake, just click your browser's '''back''' button.", 'anontalkpagetext' => "----''This is the discussion page for an anonymous user who has not created an account yet or who does not use it. We therefore have to use the numerical IP address to identify him/her. Such an IP address can be shared by several users. If you are an anonymous user and feel that irrelevant comments have been directed at you, please [[Special:Userlogin|create an account or log in]] to avoid future confusion with other anonymous users.''", 'noarticletext' => 'There is currently no text in this page, you can [[Special:Search/{{PAGENAME}}|search for this page title]] in other pages or [{{fullurl:{{FULLPAGENAME}}|action=edit}} edit this page].', 'noarticletextanon' => '{{int:noarticletext}}', # don't translate or duplicate this message to other languages +'userpage-userdoesnotexist' => 'User account "$1" is not registered. Please check if you want to create/edit this page.', 'clearyourcache' => "'''Note:''' After saving, you may have to bypass your browser's cache to see the changes. '''Mozilla / Firefox / Safari:''' hold down ''Shift'' while clicking ''Reload'', or press ''Ctrl-Shift-R'' (''Cmd-Shift-R'' on Apple Mac); '''IE:''' hold ''Ctrl'' while clicking ''Refresh'', or press ''Ctrl-F5''; '''Konqueror:''': simply click the ''Reload'' button, or press ''F5''; '''Opera''' users may need to completely clear their cache in ''Tools→Preferences''.", 'usercssjsyoucanpreview' => "Tip: Use the 'Show preview' button to test your new CSS/JS before saving.", 'usercsspreview' => "'''Remember that you are only previewing your user CSS, it has not yet been saved!'''", diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index 119e825f2c..36f894f72f 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -490,6 +490,7 @@ $wgMessageStructure = array( 'anontalkpagetext', 'noarticletext', 'noarticletextanon', + 'userpage-userdoesnotexist', 'clearyourcache', 'usercssjsyoucanpreview', 'usercsspreview', -- 2.20.1