59 $form->setWrapperLegendMsg(
'confirm-rollback-top' );
60 $form->setSubmitTextMsg(
'confirm-rollback-button' );
61 $form->setTokenSalt(
'rollback' );
64 if ( $from ===
null ) {
67 foreach ( [
'from',
'bot',
'hidediff',
'summary',
'token' ] as $param ) {
69 if ( $val !==
null ) {
70 $form->addHiddenField( $param, $val );
81 if ( $this->
getUser()->getOption(
'showrollbackconfirmation' ) ==
false ||
95 $rev = $this->page->getRevision();
96 if ( $from ===
null ) {
97 throw new ErrorPageError(
'rollbackfailed',
'rollback-missingparam' );
100 throw new ErrorPageError(
'rollbackfailed',
'rollback-missingrevision' );
102 if ( $from !==
$rev->getUserText() ) {
104 $this->
getTitle()->getPrefixedText(),
111 $errors = $this->page->doRollback(
120 if (
in_array( [
'actionthrottledtext' ], $errors ) ) {
125 $this->
getOutput()->setPageTitle( $this->
msg(
'rollbackfailed' ) );
126 $errArray = $errors[0];
128 $this->
getOutput()->addWikiMsgArray( $errMsg, $errArray );
132 $current =
$data[
'current'];
134 if ( $current->getComment() !=
'' ) {
147 # NOTE: Permission errors already handled by Action::checkExecute.
148 if ( $errors == [ [
'readonlytext' ] ] ) {
152 # XXX: Would be nice if ErrorPageError could take multiple errors, and/or a status object.
153 # Right now, we only show the first error
154 foreach ( $errors as $error ) {
159 $current =
$data[
'current'];
160 $target =
$data[
'target'];
161 $newId =
$data[
'newid'];
162 $this->
getOutput()->setPageTitle( $this->
msg(
'actioncomplete' ) );
163 $this->
getOutput()->setRobotPolicy(
'noindex,nofollow' );
168 $this->
msg(
'rollback-success' )
169 ->rawParams( $old, $new )
175 if ( $user->getBoolOption(
'watchrollback' ) ) {
181 if ( !
$request->getBool(
'hidediff',
false ) &&
182 !$this->getUser()->getBoolOption(
'norollbackdiff' )
184 $contentHandler = $current->getContentHandler();
185 $de = $contentHandler->createDifferenceEngine(
192 $de->showDiff(
'',
'' );
209 $trxLimits = $this->context->getConfig()->get(
'TrxProfilerLimits' );
210 $trxProfiler = Profiler::instance()->getTransactionProfiler();
211 $trxProfiler->redefineExpectations( $trxLimits[
'POST'],
$fname );
212 DeferredUpdates::addCallableUpdate(
function () use ( $trxProfiler, $trxLimits,
$fname
214 $trxProfiler->redefineExpectations( $trxLimits[
'PostSend-POST'],
$fname );
221 if ( $form->show() ) {
230 'vertical-label' =>
true,
232 'default' => $this->
msg(
'confirm-rollback-bottom' )->parse()
238 return isset( $errors[0][0] ) &&
239 ( $errors[0][0] ==
'alreadyrolled' ||
240 $errors[0][0] ==
'cantrollback'
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
wfTransactionalTimeLimit()
Set PHP's time limit to the larger of php.ini or $wgTransactionalTimeLimit.
if(defined( 'MW_SETUP_CALLBACK')) $fname
Customization point after all loading (constants, functions, classes, DefaultSettings,...
getTitle()
Shortcut to get the Title object from the page.
getContext()
Get the IContextSource in use here.
getOutput()
Get the OutputPage being used for this instance.
msg( $key)
Get a Message object with context set Parameters are the same as wfMessage()
getUser()
Shortcut to get the User being used for this instance.
getRequest()
Get the WebRequest being used for this instance.
An error page that emits an HTTP 400 Bad Request status code.
An error page which can definitely be safely rendered using the OutputPage.
static revUserTools( $rev, $isPublic=false, $useParentheses=true)
Generate a user tool link cluster if the current user is allowed to view it.
static formatComment( $comment, $title=null, $local=false, $wikiId=null)
This function is called by all recent changes variants, by the page history, and by the user contribu...
Show an error when the wiki is locked/read-only and the user tries to do something that requires writ...
User interface for the rollback action.
getFormFields()
Get an HTMLForm descriptor array.
getDescription()
Returns the description that goes below the <h1> tag.
enableTransactionalTimelimit()
Enables transactional time limit for POST and GET requests to RollbackAction.
usesOOUI()
Whether the form should use OOUI.
onSubmit( $data)
Process the form on POST submission.
alterForm(HTMLForm $form)
Play with the HTMLForm if you need to more substantially.
getRestriction()
Get the permission required to perform this action.
onSuccess()
Do something exciting on successful processing of the form.
hasRollbackRelatedErrors(array $errors)
showRollbackConfirmationForm()
doesWrites()
Indicates whether this action may perform database writes.
getName()
Return the name of the action this object responds to.
Show an error when the user hits a rate limit.
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction you ll probably need to make sure the header is varied on $request
presenting them properly to the user as errors is done by the caller return true use this to change the list i e etc $rev
$data
Utility to generate mapping file used in mw.Title (phpCharToUpper.json)
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))