Page MenuHomePhabricator

modify_protection.patch

Authored By
bzimport
Nov 21 2014, 9:29 PM
Size
3 KB
Referenced Files
None
Subscribers
None

modify_protection.patch

Index: includes/Article.php
===================================================================
--- includes/Article.php (revision 19587)
+++ includes/Article.php (working copy)
@@ -1687,7 +1687,10 @@
$dbw =& wfGetDB( DB_MASTER );
# 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() ) );
if( $reason )
$comment .= ": $reason";
if( $protect )
@@ -1737,7 +1740,7 @@
}
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 );
}
Index: includes/DefaultSettings.php
===================================================================
--- includes/DefaultSettings.php (revision 19587)
+++ includes/DefaultSettings.php (working copy)
@@ -2060,6 +2060,7 @@
'block/block' => 'blocklogentry',
'block/unblock' => 'unblocklogentry',
'protect/protect' => 'protectedarticle',
+ 'protect/modify' => 'modifiedarticleprotection',
'protect/unprotect' => 'unprotectedarticle',
'rights/rights' => 'rightslogentry',
'delete/delete' => 'deletedarticle',
Index: languages/messages/MessagesEn.php
===================================================================
--- languages/messages/MessagesEn.php (revision 19587)
+++ languages/messages/MessagesEn.php (working copy)
@@ -1740,6 +1740,7 @@
'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]]"',
+'modifiedarticleprotection' => 'changed protection level for "[[$1]]"',
'unprotectedarticle' => 'unprotected "[[$1]]"',
'protectsub' => '(Protecting "$1")',
'confirmprotecttext' => 'Do you really want to protect this page?',
Index: languages/messages/MessagesRu.php
===================================================================
--- languages/messages/MessagesRu.php (revision 19587)
+++ languages/messages/MessagesRu.php (working copy)
@@ -1369,6 +1369,7 @@
'protectlogtext' => 'Ниже приведён журнал установок и снятий защиты со статей.',
'protectedarticle' => 'защищена страница «[[$1]]»',
'unprotectedarticle' => 'снята защита со страницы «[[$1]]»',
+'modifiedarticleprotection' => 'изменён уровень защиты страницы «[[$1]]»',
'protectsub' =>'(Установка защиты для «$1»)',
'confirmprotecttext' => 'Вы действительно хотите установить защиту этой страницы?',
'confirmprotect' => 'Подтвердите установку защиты страницы',

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3027
Default Alt Text
modify_protection.patch (3 KB)

Event Timeline