Some cleanup to ProtectionForm:
[lhc/web/wiklou.git] / includes / ProtectionForm.php
1 <?php
2 /**
3 * Page protection
4 *
5 * Copyright © 2005 Brion Vibber <brion@pobox.com>
6 * http://www.mediawiki.org/
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 * http://www.gnu.org/copyleft/gpl.html
22 *
23 * @file
24 */
25
26 /**
27 * Handles the page protection UI and backend
28 */
29 class ProtectionForm {
30 /** A map of action to restriction level, from request or default */
31 var $mRestrictions = array();
32
33 /** The custom/additional protection reason */
34 var $mReason = '';
35
36 /** The reason selected from the list, blank for other/additional */
37 var $mReasonSelection = '';
38
39 /** True if the restrictions are cascading, from request or existing protection */
40 var $mCascade = false;
41
42 /** Map of action to "other" expiry time. Used in preference to mExpirySelection. */
43 var $mExpiry = array();
44
45 /**
46 * Map of action to value selected in expiry drop-down list.
47 * Will be set to 'othertime' whenever mExpiry is set.
48 */
49 var $mExpirySelection = array();
50
51 /** Permissions errors for the protect action */
52 var $mPermErrors = array();
53
54 /** Types (i.e. actions) for which levels can be selected */
55 var $mApplicableTypes = array();
56
57 /** Map of action to the expiry time of the existing protection */
58 var $mExistingExpiry = array();
59
60 function __construct( Page $article ) {
61 global $wgUser;
62 // Set instance variables.
63 $this->mArticle = $article;
64 $this->mTitle = $article->getTitle();
65 $this->mApplicableTypes = $this->mTitle->getRestrictionTypes();
66
67 // Check if the form should be disabled.
68 // If it is, the form will be available in read-only to show levels.
69 $this->mPermErrors = $this->mTitle->getUserPermissionsErrors( 'protect', $wgUser );
70 if ( wfReadOnly() ) {
71 $this->mPermErrors[] = array( 'readonlytext', wfReadOnlyReason() );
72 }
73 $this->disabled = $this->mPermErrors != array();
74 $this->disabledAttrib = $this->disabled
75 ? array( 'disabled' => 'disabled' )
76 : array();
77
78 $this->loadData();
79 }
80
81 /**
82 * Loads the current state of protection into the object.
83 */
84 function loadData() {
85 global $wgRequest, $wgUser;
86 global $wgRestrictionLevels;
87
88 $this->mCascade = $this->mTitle->areRestrictionsCascading();
89
90 $this->mReason = $wgRequest->getText( 'mwProtect-reason' );
91 $this->mReasonSelection = $wgRequest->getText( 'wpProtectReasonSelection' );
92 $this->mCascade = $wgRequest->getBool( 'mwProtect-cascade', $this->mCascade );
93
94 foreach( $this->mApplicableTypes as $action ) {
95 // @todo FIXME: This form currently requires individual selections,
96 // but the db allows multiples separated by commas.
97
98 // Pull the actual restriction from the DB
99 $this->mRestrictions[$action] = implode( '', $this->mTitle->getRestrictions( $action ) );
100
101 if ( !$this->mRestrictions[$action] ) {
102 // No existing expiry
103 $existingExpiry = '';
104 } else {
105 $existingExpiry = $this->mTitle->getRestrictionExpiry( $action );
106 }
107 $this->mExistingExpiry[$action] = $existingExpiry;
108
109 $requestExpiry = $wgRequest->getText( "mwProtect-expiry-$action" );
110 $requestExpirySelection = $wgRequest->getVal( "wpProtectExpirySelection-$action" );
111
112 if ( $requestExpiry ) {
113 // Custom expiry takes precedence
114 $this->mExpiry[$action] = $requestExpiry;
115 $this->mExpirySelection[$action] = 'othertime';
116 } elseif ( $requestExpirySelection ) {
117 // Expiry selected from list
118 $this->mExpiry[$action] = '';
119 $this->mExpirySelection[$action] = $requestExpirySelection;
120 } elseif ( $existingExpiry == 'infinity' ) {
121 // Existing expiry is infinite, use "infinite" in drop-down
122 $this->mExpiry[$action] = '';
123 $this->mExpirySelection[$action] = 'infinite';
124 } elseif ( $existingExpiry ) {
125 // Use existing expiry in its own list item
126 $this->mExpiry[$action] = '';
127 $this->mExpirySelection[$action] = $existingExpiry;
128 } else {
129 // Final default: infinite
130 $this->mExpiry[$action] = '';
131 $this->mExpirySelection[$action] = 'infinite';
132 }
133
134 $val = $wgRequest->getVal( "mwProtect-level-$action" );
135 if( isset( $val ) && in_array( $val, $wgRestrictionLevels ) ) {
136 // Prevent users from setting levels that they cannot later unset
137 if( $val == 'sysop' ) {
138 // Special case, rewrite sysop to either protect and editprotected
139 if( !$wgUser->isAllowedAny( 'protect', 'editprotected' ) )
140 continue;
141 } else {
142 if( !$wgUser->isAllowed($val) )
143 continue;
144 }
145 $this->mRestrictions[$action] = $val;
146 }
147 }
148 }
149
150 /**
151 * Get the expiry time for a given action, by combining the relevant inputs.
152 *
153 * @param $action string
154 *
155 * @return string 14-char timestamp or "infinity", or false if the input was invalid
156 */
157 function getExpiry( $action ) {
158 if ( $this->mExpirySelection[$action] == 'existing' ) {
159 return $this->mExistingExpiry[$action];
160 } elseif ( $this->mExpirySelection[$action] == 'othertime' ) {
161 $value = $this->mExpiry[$action];
162 } else {
163 $value = $this->mExpirySelection[$action];
164 }
165 if ( $value == 'infinite' || $value == 'indefinite' || $value == 'infinity' ) {
166 $time = wfGetDB( DB_SLAVE )->getInfinity();
167 } else {
168 $unix = strtotime( $value );
169
170 if ( !$unix || $unix === -1 ) {
171 return false;
172 }
173
174 // @todo FIXME: Non-qualified absolute times are not in users specified timezone
175 // and there isn't notice about it in the ui
176 $time = wfTimestamp( TS_MW, $unix );
177 }
178 return $time;
179 }
180
181 /**
182 * Main entry point for action=protect and action=unprotect
183 */
184 function execute() {
185 global $wgRequest, $wgOut;
186
187 if ( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) {
188 throw new ErrorPageError( 'protect-badnamespace-title', 'protect-badnamespace-text' );
189 }
190
191 if( $wgRequest->wasPosted() ) {
192 if( $this->save() ) {
193 $q = $this->mArticle->isRedirect() ? 'redirect=no' : '';
194 $wgOut->redirect( $this->mTitle->getFullUrl( $q ) );
195 }
196 } else {
197 $this->show();
198 }
199 }
200
201 /**
202 * Show the input form with optional error message
203 *
204 * @param $err String: error message or null if there's no error
205 */
206 function show( $err = null ) {
207 global $wgOut;
208
209 $wgOut->setRobotPolicy( 'noindex,nofollow' );
210
211 if ( is_array( $err ) ) {
212 $wgOut->wrapWikiMsg( "<p class='error'>\n$1\n</p>\n", $err );
213 } elseif ( is_string( $err ) ) {
214 $wgOut->addHTML( "<p class='error'>{$err}</p>\n" );
215 }
216
217 list( $cascadeSources, /* $restrictions */ ) = $this->mTitle->getCascadeProtectionSources();
218 if ( $cascadeSources && count($cascadeSources) > 0 ) {
219 $titles = '';
220
221 foreach ( $cascadeSources as $title ) {
222 $titles .= '* [[:' . $title->getPrefixedText() . "]]\n";
223 }
224
225 $wgOut->wrapWikiMsg( "<div id=\"mw-protect-cascadeon\">\n$1\n" . $titles . "</div>", array( 'protect-cascadeon', count($cascadeSources) ) );
226 }
227
228 # Show an appropriate message if the user isn't allowed or able to change
229 # the protection settings at this time
230 if ( $this->disabled ) {
231 $wgOut->setPageTitle( wfMessage( 'protect-title-notallowed', $this->mTitle->getPrefixedText() ) );
232 $wgOut->addWikiText( $wgOut->formatPermissionsErrorMessage( $this->mPermErrors, 'protect' ) );
233 } else {
234 $wgOut->setPageTitle( wfMessage( 'protect-title', $this->mTitle->getPrefixedText() ) );
235 $wgOut->addWikiMsg( 'protect-text',
236 wfEscapeWikiText( $this->mTitle->getPrefixedText() ) );
237 }
238
239 $titleLink = Linker::link( $this->mTitle );
240 $wgOut->setSubtitle( wfMsg( 'protect-backlink', $titleLink ) );
241
242 $wgOut->addHTML( $this->buildForm() );
243
244 $this->showLogExtract( $wgOut );
245 }
246
247 /**
248 * Save submitted protection form
249 *
250 * @return Boolean: success
251 */
252 function save() {
253 global $wgRequest, $wgUser;
254
255 # Permission check!
256 if ( $this->disabled ) {
257 $this->show();
258 return false;
259 }
260
261 $token = $wgRequest->getVal( 'wpEditToken' );
262 if ( !$wgUser->matchEditToken( $token, array( 'protect', $this->mTitle->getPrefixedDBkey() ) ) ) {
263 $this->show( array( 'sessionfailure' ) );
264 return false;
265 }
266
267 # Create reason string. Use list and/or custom string.
268 $reasonstr = $this->mReasonSelection;
269 if ( $reasonstr != 'other' && $this->mReason != '' ) {
270 // Entry from drop down menu + additional comment
271 $reasonstr .= wfMsgForContent( 'colon-separator' ) . $this->mReason;
272 } elseif ( $reasonstr == 'other' ) {
273 $reasonstr = $this->mReason;
274 }
275 $expiry = array();
276 foreach( $this->mApplicableTypes as $action ) {
277 $expiry[$action] = $this->getExpiry( $action );
278 if( empty($this->mRestrictions[$action]) )
279 continue; // unprotected
280 if ( !$expiry[$action] ) {
281 $this->show( array( 'protect_expiry_invalid' ) );
282 return false;
283 }
284 if ( $expiry[$action] < wfTimestampNow() ) {
285 $this->show( array( 'protect_expiry_old' ) );
286 return false;
287 }
288 }
289
290 # They shouldn't be able to do this anyway, but just to make sure, ensure that cascading restrictions aren't being applied
291 # to a semi-protected page.
292 global $wgGroupPermissions;
293
294 $edit_restriction = isset( $this->mRestrictions['edit'] ) ? $this->mRestrictions['edit'] : '';
295 $this->mCascade = $wgRequest->getBool( 'mwProtect-cascade' );
296 if ($this->mCascade && ($edit_restriction != 'protect') &&
297 !(isset($wgGroupPermissions[$edit_restriction]['protect']) && $wgGroupPermissions[$edit_restriction]['protect'] ) )
298 $this->mCascade = false;
299
300 if ($this->mTitle->exists()) {
301 $ok = $this->mArticle->updateRestrictions( $this->mRestrictions, $reasonstr, $this->mCascade, $expiry );
302 } else {
303 $ok = $this->mTitle->updateTitleProtection( $this->mRestrictions['create'], $reasonstr, $expiry['create'] );
304 }
305
306 if( !$ok ) {
307 throw new FatalError( "Unknown error at restriction save time." );
308 }
309
310 /**
311 * Give extensions a change to handle added form items
312 *
313 * @since 1.19 you can (and you should) return false to abort saving;
314 * you can also return an array of message name and its parameters
315 */
316 $errorMsg = '';
317 if( !wfRunHooks( 'ProtectionForm::save', array( $this->mArticle, &$errorMsg ) ) ) {
318 if ( $errorMsg == '' ) {
319 $errorMsg = array( 'hookaborted' );
320 }
321 }
322 if( $errorMsg != '' ) {
323 $this->show( $errorMsg );
324 return false;
325 }
326
327 if ( $wgRequest->getCheck( 'mwProtectWatch' ) && $wgUser->isLoggedIn() ) {
328 WatchAction::doWatch( $this->mTitle, $wgUser );
329 } elseif ( $this->mTitle->userIsWatching() ) {
330 WatchAction::doUnwatch( $this->mTitle, $wgUser );
331 }
332 return $ok;
333 }
334
335 /**
336 * Build the input form
337 *
338 * @return String: HTML form
339 */
340 function buildForm() {
341 global $wgUser, $wgLang, $wgOut;
342
343 $mProtectreasonother = Xml::label( wfMsg( 'protectcomment' ), 'wpProtectReasonSelection' );
344 $mProtectreason = Xml::label( wfMsg( 'protect-otherreason' ), 'mwProtect-reason' );
345
346 $out = '';
347 if( !$this->disabled ) {
348 $wgOut->addModules( 'mediawiki.legacy.protect' );
349 $out .= Xml::openElement( 'form', array( 'method' => 'post',
350 'action' => $this->mTitle->getLocalUrl( 'action=protect' ),
351 'id' => 'mw-Protect-Form', 'onsubmit' => 'ProtectionForm.enableUnchainedInputs(true)' ) );
352 }
353
354 $out .= Xml::openElement( 'fieldset' ) .
355 Xml::element( 'legend', null, wfMsg( 'protect-legend' ) ) .
356 Xml::openElement( 'table', array( 'id' => 'mwProtectSet' ) ) .
357 Xml::openElement( 'tbody' );
358
359 foreach( $this->mRestrictions as $action => $selected ) {
360 /* Not all languages have V_x <-> N_x relation */
361 $msg = wfMessage( 'restriction-' . $action );
362 $out .= "<tr><td>".
363 Xml::openElement( 'fieldset' ) .
364 Xml::element( 'legend', null, $msg->exists() ? $msg->text() : $action ) .
365 Xml::openElement( 'table', array( 'id' => "mw-protect-table-$action" ) ) .
366 "<tr><td>" . $this->buildSelector( $action, $selected ) . "</td></tr><tr><td>";
367
368 $reasonDropDown = Xml::listDropDown( 'wpProtectReasonSelection',
369 wfMsgForContent( 'protect-dropdown' ),
370 wfMsgForContent( 'protect-otherreason-op' ),
371 $this->mReasonSelection,
372 'mwProtect-reason', 4 );
373 $scExpiryOptions = wfMsgForContent( 'protect-expiry-options' );
374
375 $showProtectOptions = ($scExpiryOptions !== '-' && !$this->disabled);
376
377 $mProtectexpiry = Xml::label( wfMsg( 'protectexpiry' ), "mwProtectExpirySelection-$action" );
378 $mProtectother = Xml::label( wfMsg( 'protect-othertime' ), "mwProtect-$action-expires" );
379
380 $expiryFormOptions = '';
381 if ( $this->mExistingExpiry[$action] && $this->mExistingExpiry[$action] != 'infinity' ) {
382 $timestamp = $wgLang->timeanddate( $this->mExistingExpiry[$action], true );
383 $d = $wgLang->date( $this->mExistingExpiry[$action], true );
384 $t = $wgLang->time( $this->mExistingExpiry[$action], true );
385 $expiryFormOptions .=
386 Xml::option(
387 wfMsg( 'protect-existing-expiry', $timestamp, $d, $t ),
388 'existing',
389 $this->mExpirySelection[$action] == 'existing'
390 ) . "\n";
391 }
392
393 $expiryFormOptions .= Xml::option( wfMsg( 'protect-othertime-op' ), "othertime" ) . "\n";
394 foreach( explode(',', $scExpiryOptions) as $option ) {
395 if ( strpos($option, ":") === false ) {
396 $show = $value = $option;
397 } else {
398 list($show, $value) = explode(":", $option);
399 }
400 $show = htmlspecialchars($show);
401 $value = htmlspecialchars($value);
402 $expiryFormOptions .= Xml::option( $show, $value, $this->mExpirySelection[$action] === $value ) . "\n";
403 }
404 # Add expiry dropdown
405 if( $showProtectOptions && !$this->disabled ) {
406 $out .= "
407 <table><tr>
408 <td class='mw-label'>
409 {$mProtectexpiry}
410 </td>
411 <td class='mw-input'>" .
412 Xml::tags( 'select',
413 array(
414 'id' => "mwProtectExpirySelection-$action",
415 'name' => "wpProtectExpirySelection-$action",
416 'onchange' => "ProtectionForm.updateExpiryList(this)",
417 'tabindex' => '2' ) + $this->disabledAttrib,
418 $expiryFormOptions ) .
419 "</td>
420 </tr></table>";
421 }
422 # Add custom expiry field
423 $attribs = array( 'id' => "mwProtect-$action-expires",
424 'onkeyup' => 'ProtectionForm.updateExpiry(this)',
425 'onchange' => 'ProtectionForm.updateExpiry(this)' ) + $this->disabledAttrib;
426 $out .= "<table><tr>
427 <td class='mw-label'>" .
428 $mProtectother .
429 '</td>
430 <td class="mw-input">' .
431 Xml::input( "mwProtect-expiry-$action", 50, $this->mExpiry[$action], $attribs ) .
432 '</td>
433 </tr></table>';
434 $out .= "</td></tr>" .
435 Xml::closeElement( 'table' ) .
436 Xml::closeElement( 'fieldset' ) .
437 "</td></tr>";
438 }
439 # Give extensions a chance to add items to the form
440 wfRunHooks( 'ProtectionForm::buildForm', array($this->mArticle,&$out) );
441
442 $out .= Xml::closeElement( 'tbody' ) . Xml::closeElement( 'table' );
443
444 // JavaScript will add another row with a value-chaining checkbox
445 if( $this->mTitle->exists() ) {
446 $out .= Xml::openElement( 'table', array( 'id' => 'mw-protect-table2' ) ) .
447 Xml::openElement( 'tbody' );
448 $out .= '<tr>
449 <td></td>
450 <td class="mw-input">' .
451 Xml::checkLabel( wfMsg( 'protect-cascade' ), 'mwProtect-cascade', 'mwProtect-cascade',
452 $this->mCascade, $this->disabledAttrib ) .
453 "</td>
454 </tr>\n";
455 $out .= Xml::closeElement( 'tbody' ) . Xml::closeElement( 'table' );
456 }
457
458 # Add manual and custom reason field/selects as well as submit
459 if( !$this->disabled ) {
460 $out .= Xml::openElement( 'table', array( 'id' => 'mw-protect-table3' ) ) .
461 Xml::openElement( 'tbody' );
462 $out .= "
463 <tr>
464 <td class='mw-label'>
465 {$mProtectreasonother}
466 </td>
467 <td class='mw-input'>
468 {$reasonDropDown}
469 </td>
470 </tr>
471 <tr>
472 <td class='mw-label'>
473 {$mProtectreason}
474 </td>
475 <td class='mw-input'>" .
476 Xml::input( 'mwProtect-reason', 60, $this->mReason, array( 'type' => 'text',
477 'id' => 'mwProtect-reason', 'maxlength' => 180 ) ) .
478 // Limited maxlength as the database trims at 255 bytes and other texts
479 // chosen by dropdown menus on this page are also included in this database field.
480 // The byte limit of 180 bytes is enforced in javascript
481 "</td>
482 </tr>";
483 # Disallow watching is user is not logged in
484 if( $wgUser->isLoggedIn() ) {
485 $out .= "
486 <tr>
487 <td></td>
488 <td class='mw-input'>" .
489 Xml::checkLabel( wfMsg( 'watchthis' ),
490 'mwProtectWatch', 'mwProtectWatch',
491 $this->mTitle->userIsWatching() || $wgUser->getOption( 'watchdefault' ) ) .
492 "</td>
493 </tr>";
494 }
495 $out .= "
496 <tr>
497 <td></td>
498 <td class='mw-submit'>" .
499 Xml::submitButton( wfMsg( 'confirm' ), array( 'id' => 'mw-Protect-submit' ) ) .
500 "</td>
501 </tr>\n";
502 $out .= Xml::closeElement( 'tbody' ) . Xml::closeElement( 'table' );
503 }
504 $out .= Xml::closeElement( 'fieldset' );
505
506 if ( $wgUser->isAllowed( 'editinterface' ) ) {
507 $title = Title::makeTitle( NS_MEDIAWIKI, 'Protect-dropdown' );
508 $link = Linker::link(
509 $title,
510 wfMsgHtml( 'protect-edit-reasonlist' ),
511 array(),
512 array( 'action' => 'edit' )
513 );
514 $out .= '<p class="mw-protect-editreasons">' . $link . '</p>';
515 }
516
517 if ( !$this->disabled ) {
518 $out .= Html::hidden( 'wpEditToken', $wgUser->getEditToken( array( 'protect', $this->mTitle->getPrefixedDBkey() ) ) );
519 $out .= Xml::closeElement( 'form' );
520 $wgOut->addScript( $this->buildCleanupScript() );
521 }
522
523 return $out;
524 }
525
526 /**
527 * Build protection level selector
528 *
529 * @param $action String: action to protect
530 * @param $selected String: current protection level
531 * @return String: HTML fragment
532 */
533 function buildSelector( $action, $selected ) {
534 global $wgRestrictionLevels, $wgUser;
535
536 $levels = array();
537 foreach( $wgRestrictionLevels as $key ) {
538 //don't let them choose levels above their own (aka so they can still unprotect and edit the page). but only when the form isn't disabled
539 if( $key == 'sysop' ) {
540 //special case, rewrite sysop to protect and editprotected
541 if( !$wgUser->isAllowedAny( 'protect', 'editprotected' ) && !$this->disabled )
542 continue;
543 } else {
544 if( !$wgUser->isAllowed($key) && !$this->disabled )
545 continue;
546 }
547 $levels[] = $key;
548 }
549
550 $id = 'mwProtect-level-' . $action;
551 $attribs = array(
552 'id' => $id,
553 'name' => $id,
554 'size' => count( $levels ),
555 'onchange' => 'ProtectionForm.updateLevels(this)',
556 ) + $this->disabledAttrib;
557
558 $out = Xml::openElement( 'select', $attribs );
559 foreach( $levels as $key ) {
560 $out .= Xml::option( $this->getOptionLabel( $key ), $key, $key == $selected );
561 }
562 $out .= Xml::closeElement( 'select' );
563 return $out;
564 }
565
566 /**
567 * Prepare the label for a protection selector option
568 *
569 * @param $permission String: permission required
570 * @return String
571 */
572 private function getOptionLabel( $permission ) {
573 if( $permission == '' ) {
574 return wfMsg( 'protect-default' );
575 } else {
576 $msg = wfMessage( "protect-level-{$permission}" );
577 if( $msg->exists() ) {
578 return $msg->text();
579 }
580 return wfMsg( 'protect-fallback', $permission );
581 }
582 }
583
584 function buildCleanupScript() {
585 global $wgRestrictionLevels, $wgGroupPermissions, $wgOut;
586
587 $cascadeableLevels = array();
588 foreach( $wgRestrictionLevels as $key ) {
589 if ( ( isset( $wgGroupPermissions[$key]['protect'] ) && $wgGroupPermissions[$key]['protect'] )
590 || $key == 'protect'
591 ) {
592 $cascadeableLevels[] = $key;
593 }
594 }
595 $options = array(
596 'tableId' => 'mwProtectSet',
597 'labelText' => wfMessage( 'protect-unchain-permissions' )->plain(),
598 'numTypes' => count( $this->mApplicableTypes ),
599 'existingMatch' => count( array_unique( $this->mExistingExpiry ) ) === 1,
600 );
601
602 $wgOut->addJsConfigVars( 'wgCascadeableLevels', $cascadeableLevels );
603 $script = Xml::encodeJsCall( 'ProtectionForm.init', array( $options ) );
604 return Html::inlineScript( ResourceLoader::makeLoaderConditionalScript( $script ) );
605 }
606
607 /**
608 * Show protection long extracts for this page
609 *
610 * @param $out OutputPage
611 * @access private
612 */
613 function showLogExtract( &$out ) {
614 # Show relevant lines from the protection log:
615 $out->addHTML( Xml::element( 'h2', null, LogPage::logName( 'protect' ) ) );
616 LogEventsList::showLogExtract( $out, 'protect', $this->mTitle );
617 # Let extensions add other relevant log extracts
618 wfRunHooks( 'ProtectionForm::showLogExtract', array($this->mArticle,$out) );
619 }
620 }