From c1e97020139a8c5ad4ca637958306a3298b68222 Mon Sep 17 00:00:00 2001 From: Raimond Spekking Date: Wed, 13 Jun 2007 11:08:57 +0000 Subject: [PATCH] * (bug 8734) Different log message when article protection level is changed Based on a patch of Max Semenik * [[ ]] in protection log related messages removed as the page name is already linked. --- RELEASE-NOTES | 9 +++++---- includes/Article.php | 10 ++++++++-- includes/DefaultSettings.php | 1 + includes/SpecialLog.php | 2 +- languages/messages/MessagesDe.php | 5 +++-- languages/messages/MessagesEn.php | 5 +++-- languages/messages/MessagesRu.php | 5 +++-- maintenance/language/messages.inc | 1 + 8 files changed, 25 insertions(+), 13 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 1057de1520..a10c2b93cf 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -81,6 +81,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN pre-Monobook skins. As always, modifications should go in-wiki to MediaWiki: Common.css and MediaWiki:Monobook.css. * (bug 8869) Introduce Special:Uncategorizedtemplates +* (bug 8734) Different log message when article protection level is changed == Bugfixes since 1.10 == @@ -153,9 +154,6 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 9383) Don't set a default value for BLOB column in rc-deleted database patch * (bug 10149) Don't show full template list on section-0 edit -* Fix maintenance/importImages.php so it doesn't barf PHP errors when no - suitable files are found, and make the list of extensions an option (defaults - to $wgFileExtensions) * (bug 9909) Ensure access to binary fields in the math table use encodeBlob() and decodeBlob() * (bug 6743) Don't link broken image links to the upload form when uploads @@ -201,6 +199,9 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * Add support for wgMaxTocLevel option in parserTests * (bug 6823) Disable article view counter in maintenance/dumpHTML.php +* Fix maintenance/importImages.php so it doesn't barf PHP errors when no + suitable files are found, and make the list of extensions an option (defaults + to $wgFileExtensions) == Languages updated since 1.10 == @@ -308,4 +309,4 @@ going to run a public MediaWiki, so you can be notified of security fixes. === IRC help === -There's usually someone online in #mediawiki on irc.freenode.net \ No newline at end of file +There's usually someone online in #mediawiki on irc.freenode.net diff --git a/includes/Article.php b/includes/Article.php index 6e7f779f75..0efa3ea0ff 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -1699,7 +1699,13 @@ class Article { } # Prepare a null revision to be added to the history - $comment = $wgContLang->ucfirst( wfMsgForContent( $protect ? 'protectedarticle' : 'unprotectedarticle', $this->mTitle->getPrefixedText() ) ); + $modified = $current != '' && $protect; + if ( $protect ) { + $comment_type = $modified ? 'modifiedarticleprotection' : 'protectedarticle'; + } else { + $comment_type = 'unprotectedarticle'; + } + $comment = $wgContLang->ucfirst( wfMsgForContent( $comment_type, $this->mTitle->getPrefixedText() ) ); foreach( $limit as $action => $restrictions ) { # Check if the group level required to edit also can protect pages @@ -1753,7 +1759,7 @@ class Article { $log = new LogPage( 'protect' ); if( $protect ) { - $log->addEntry( 'protect', $this->mTitle, trim( $reason . " [$updated]$cascade_description$expiry_description" ) ); + $log->addEntry( $modified ? 'modify' : 'protect', $this->mTitle, trim( $reason . " [$updated]$cascade_description$expiry_description" ) ); } else { $log->addEntry( 'unprotect', $this->mTitle, $reason ); } diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 564f82df67..b25a50ef75 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -2219,6 +2219,7 @@ $wgLogActions = array( 'block/block' => 'blocklogentry', 'block/unblock' => 'unblocklogentry', 'protect/protect' => 'protectedarticle', + 'protect/modify' => 'modifiedarticleprotection', 'protect/unprotect' => 'unprotectedarticle', 'rights/rights' => 'rightslogentry', 'delete/delete' => 'deletedarticle', diff --git a/includes/SpecialLog.php b/includes/SpecialLog.php index 2fcce66467..f2400fefb1 100644 --- a/includes/SpecialLog.php +++ b/includes/SpecialLog.php @@ -384,7 +384,7 @@ class LogViewer { wfMsg( 'unblocklink' ), 'action=unblock&ip=' . urlencode( $s->log_title ) ) . ')'; // show change protection link - } elseif ( $s->log_action == 'protect' && $wgUser->isAllowed( 'protect' ) ) { + } elseif ( ( $s->log_action == 'protect' || $s->log_action == 'modify' ) && $wgUser->isAllowed( 'protect' ) ) { $revert = '(' . $skin->makeKnownLink( $title->getPrefixedDBkey() , wfMsg( 'protect_change' ), 'action=unprotect' ) . ')'; diff --git a/languages/messages/MessagesDe.php b/languages/messages/MessagesDe.php index 5e2a6ad564..2a7837beda 100644 --- a/languages/messages/MessagesDe.php +++ b/languages/messages/MessagesDe.php @@ -1420,8 +1420,9 @@ Diese Aktion wurde aus Sicherheitsgründen abgebrochen, um eine falsche Zuordnun Bitte gehen Sie zurück und versuchen den Vorgang erneut auszuführen.', 'protectlogpage' => 'Seitenschutz-Logbuch', 'protectlogtext' => 'Dies ist das Seitenschutz-Logbuch. Siehe die [[{{ns:special}}:Protectedpages|Liste der geschützten Seiten]] für alle aktuell geschützten Seiten.', -'protectedarticle' => 'änderte den Seitenschutzstatus von [[$1]]', -'unprotectedarticle' => 'hob den Schutz von $1 auf', +'protectedarticle' => 'schützte „$1“', +'modifiedarticleprotection' => 'änderte den Schutz von „$1“', +'unprotectedarticle' => 'hob den Schutz von „$1“ auf', 'protectsub' => '(Schutz ändern von „$1“)', 'confirmprotecttext' => 'Soll diese Seite wirklich geschützt werden?', 'confirmprotect' => 'Seitenschutzstatus ändern', diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index f5b60ec069..e61b46c08d 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -1812,8 +1812,9 @@ this action has been canceled as a precaution against session hijacking. Please hit "back" and reload the page you came from, then try again.', 'protectlogpage' => 'Protection log', 'protectlogtext' => 'Below is a list of page locks and unlocks. See the [[Special:Protectedpages|protected pages list]] for the list of currently operational page protections.', -'protectedarticle' => 'protected "[[$1]]"', -'unprotectedarticle' => 'unprotected "[[$1]]"', +'protectedarticle' => 'protected "$1"', +'modifiedarticleprotection' => 'changed protection level for "$1"', +'unprotectedarticle' => 'unprotected "$1"', 'protectsub' => '(Protecting "$1")', 'confirmprotecttext' => 'Do you really want to protect this page?', 'confirmprotect' => 'Confirm protection', diff --git a/languages/messages/MessagesRu.php b/languages/messages/MessagesRu.php index 3bb0992d96..04e3951072 100644 --- a/languages/messages/MessagesRu.php +++ b/languages/messages/MessagesRu.php @@ -1425,8 +1425,9 @@ $NEWPAGE Пожалуйста, нажмите кнопку «Назад» и перезагрузите страницу, с которой вы пришли.', 'protectlogpage' => 'Журнал защиты', 'protectlogtext' => 'Ниже приведён журнал установок и снятий защиты со статей. Вы можете также просмотреть [[{{ns:special}}:Protectedpages|список страниц, которые в данный момент защищены]].', -'protectedarticle' => 'защищена страница «[[$1]]»', -'unprotectedarticle' => 'снята защита со страницы «[[$1]]»', +'protectedarticle' => 'защищена страница «$1»', +'modifiedarticleprotection' => 'изменён уровень защиты страницы «$1»', +'unprotectedarticle' => 'снята защита со страницы «$1»', 'protectsub' => '(Установка защиты для «$1»)', 'confirmprotecttext' => 'Вы действительно хотите установить защиту этой страницы?', 'confirmprotect' => 'Подтвердите установку защиты страницы', diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index c6fbec42db..364c7977b7 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -1158,6 +1158,7 @@ $wgMessageStructure = array( 'protectlogpage', 'protectlogtext', 'protectedarticle', + 'modifiedarticleprotection', 'unprotectedarticle', 'protectsub', 'confirmprotecttext', -- 2.20.1