aboutsummaryrefslogtreecommitdiffstats
path: root/includes/actions
diff options
context:
space:
mode:
authorÉtienne Beaulé <beauleetienne0@gmail.com>2014-07-15 08:32:16 -0400
committerLegoktm <legoktm.wikipedia@gmail.com>2014-07-30 21:51:41 +0000
commitb230bdce16d3c834610a41c29573d34c9b778256 (patch)
tree99a5c98f63aebcfdf5e75e2b6d56b834476b89de /includes/actions
parentcceb6895ac92ef1fbd040d1c873739b4e6558683 (diff)
downloadmediawikicore-b230bdce16d3c834610a41c29573d34c9b778256.tar.gz
mediawikicore-b230bdce16d3c834610a41c29573d34c9b778256.zip
Create preference to watchlist pages after rollbacking
This change adds a preference in the 'watchlist' section to automatically watchlist a page after rollbacking. The setting is only visible, if the user has the 'rollback'-right. I have removed the watch reverts function per advice by Vogone. Bug: 4488 Change-Id: I3aa831c9c04d627684641af0ca5a332795c87062
Diffstat (limited to 'includes/actions')
-rw-r--r--includes/actions/RollbackAction.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/includes/actions/RollbackAction.php b/includes/actions/RollbackAction.php
index 617f1c99981d..76d70d70aff1 100644
--- a/includes/actions/RollbackAction.php
+++ b/includes/actions/RollbackAction.php
@@ -39,6 +39,7 @@ class RollbackAction extends FormlessAction {
$details = null;
$request = $this->getRequest();
+ $user = $this->getUser();
$result = $this->page->doRollback(
$request->getVal( 'from' ),
@@ -97,6 +98,11 @@ class RollbackAction extends FormlessAction {
$new = Linker::revUserTools( $target );
$this->getOutput()->addHTML( $this->msg( 'rollback-success' )->rawParams( $old, $new )
->parseAsBlock() );
+
+ if ( $user->getBoolOption( 'watchrollback' ) ) {
+ $user->addWatch( $this->page->getTitle(), WatchedItem::IGNORE_USER_RIGHTS );
+ }
+
$this->getOutput()->returnToMain( false, $this->getTitle() );
if ( !$request->getBool( 'hidediff', false ) &&