Merge "JSON i18n shim: Only register LocalisationCacheRecache handler once"
[lhc/web/wiklou.git] / includes / specials / SpecialRevisiondelete.php
1 <?php
2 /**
3 * Implements Special:Revisiondelete
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * http://www.gnu.org/copyleft/gpl.html
19 *
20 * @file
21 * @ingroup SpecialPage
22 */
23
24 /**
25 * Special page allowing users with the appropriate permissions to view
26 * and hide revisions. Log items can also be hidden.
27 *
28 * @ingroup SpecialPage
29 */
30 class SpecialRevisionDelete extends UnlistedSpecialPage {
31 /** @var bool Was the DB modified in this request */
32 protected $wasSaved = false;
33
34 /** @var bool True if the submit button was clicked, and the form was posted */
35 private $submitClicked;
36
37 /** @var array Target ID list */
38 private $ids;
39
40 /** @var string Archive name, for reviewing deleted files */
41 private $archiveName;
42
43 /** @var string Edit token for securing image views against XSS */
44 private $token;
45
46 /** @var Title Title object for target parameter */
47 private $targetObj;
48
49 /** @var string Deletion type, may be revision, archive, oldimage, filearchive, logging. */
50 private $typeName;
51
52 /** @var array Array of checkbox specs (message, name, deletion bits) */
53 private $checks;
54
55 /** @var array UI Labels about the current type */
56 private $typeLabels;
57
58 /** @var RevDel_List RevDel_List object, storing the list of items to be deleted/undeleted */
59 private $revDelList;
60
61 /** @var bool Whether user is allowed to perform the action */
62 private $mIsAllowed;
63
64 /** @var string */
65 private $otherReason;
66
67 /**
68 * UI labels for each type.
69 */
70 private static $UILabels = array(
71 'revision' => array(
72 'check-label' => 'revdelete-hide-text',
73 'success' => 'revdelete-success',
74 'failure' => 'revdelete-failure',
75 'text' => 'revdelete-text-text',
76 'selected'=> 'revdelete-selected-text',
77 ),
78 'archive' => array(
79 'check-label' => 'revdelete-hide-text',
80 'success' => 'revdelete-success',
81 'failure' => 'revdelete-failure',
82 'text' => 'revdelete-text-text',
83 'selected'=> 'revdelete-selected-text',
84 ),
85 'oldimage' => array(
86 'check-label' => 'revdelete-hide-image',
87 'success' => 'revdelete-success',
88 'failure' => 'revdelete-failure',
89 'text' => 'revdelete-text-file',
90 'selected'=> 'revdelete-selected-file',
91 ),
92 'filearchive' => array(
93 'check-label' => 'revdelete-hide-image',
94 'success' => 'revdelete-success',
95 'failure' => 'revdelete-failure',
96 'text' => 'revdelete-text-file',
97 'selected'=> 'revdelete-selected-file',
98 ),
99 'logging' => array(
100 'check-label' => 'revdelete-hide-name',
101 'success' => 'logdelete-success',
102 'failure' => 'logdelete-failure',
103 'text' => 'logdelete-text',
104 'selected' => 'logdelete-selected',
105 ),
106 );
107
108 public function __construct() {
109 parent::__construct( 'Revisiondelete', 'deletedhistory' );
110 }
111
112 public function execute( $par ) {
113 $this->checkPermissions();
114 $this->checkReadOnly();
115
116 $output = $this->getOutput();
117 $user = $this->getUser();
118
119 $this->setHeaders();
120 $this->outputHeader();
121 $request = $this->getRequest();
122 $this->submitClicked = $request->wasPosted() && $request->getBool( 'wpSubmit' );
123 # Handle our many different possible input types.
124 $ids = $request->getVal( 'ids' );
125 if ( !is_null( $ids ) ) {
126 # Allow CSV, for backwards compatibility, or a single ID for show/hide links
127 $this->ids = explode( ',', $ids );
128 } else {
129 # Array input
130 $this->ids = array_keys( $request->getArray( 'ids', array() ) );
131 }
132 // $this->ids = array_map( 'intval', $this->ids );
133 $this->ids = array_unique( array_filter( $this->ids ) );
134
135 if ( $request->getVal( 'action' ) == 'historysubmit' || $request->getVal( 'action' ) == 'revisiondelete' ) {
136 // For show/hide form submission from history page
137 // Since we are access through index.php?title=XXX&action=historysubmit
138 // getFullTitle() will contain the target title and not our title
139 $this->targetObj = $this->getFullTitle();
140 $this->typeName = 'revision';
141 } else {
142 $this->typeName = $request->getVal( 'type' );
143 $this->targetObj = Title::newFromText( $request->getText( 'target' ) );
144 }
145
146 # For reviewing deleted files...
147 $this->archiveName = $request->getVal( 'file' );
148 $this->token = $request->getVal( 'token' );
149 if ( $this->archiveName && $this->targetObj ) {
150 $this->tryShowFile( $this->archiveName );
151
152 return;
153 }
154
155 $this->typeName = RevisionDeleter::getCanonicalTypeName( $this->typeName );
156
157 # No targets?
158 if ( !$this->typeName || count( $this->ids ) == 0 ) {
159 throw new ErrorPageError( 'revdelete-nooldid-title', 'revdelete-nooldid-text' );
160 }
161 $this->typeLabels = self::$UILabels[$this->typeName];
162 $this->mIsAllowed = $user->isAllowed( RevisionDeleter::getRestriction( $this->typeName ) );
163
164 # Allow the list type to adjust the passed target
165 $this->targetObj = RevisionDeleter::suggestTarget( $this->typeName, $this->targetObj, $this->ids );
166
167 $this->otherReason = $request->getVal( 'wpReason' );
168 # We need a target page!
169 if ( is_null( $this->targetObj ) ) {
170 $output->addWikiMsg( 'undelete-header' );
171
172 return;
173 }
174 # Give a link to the logs/hist for this page
175 $this->showConvenienceLinks();
176
177 # Initialise checkboxes
178 $this->checks = array(
179 # Messages: revdelete-hide-text, revdelete-hide-image, revdelete-hide-name
180 array( $this->typeLabels['check-label'], 'wpHidePrimary',
181 RevisionDeleter::getRevdelConstant( $this->typeName )
182 ),
183 array( 'revdelete-hide-comment', 'wpHideComment', Revision::DELETED_COMMENT ),
184 array( 'revdelete-hide-user', 'wpHideUser', Revision::DELETED_USER )
185 );
186 if ( $user->isAllowed( 'suppressrevision' ) ) {
187 $this->checks[] = array( 'revdelete-hide-restricted',
188 'wpHideRestricted', Revision::DELETED_RESTRICTED );
189 }
190
191 # Either submit or create our form
192 if ( $this->mIsAllowed && $this->submitClicked ) {
193 $this->submit( $request );
194 } else {
195 $this->showForm();
196 }
197
198 $qc = $this->getLogQueryCond();
199 # Show relevant lines from the deletion log
200 $deleteLogPage = new LogPage( 'delete' );
201 $output->addHTML( "<h2>" . $deleteLogPage->getName()->escaped() . "</h2>\n" );
202 LogEventsList::showLogExtract(
203 $output,
204 'delete',
205 $this->targetObj,
206 '', /* user */
207 array( 'lim' => 25, 'conds' => $qc, 'useMaster' => $this->wasSaved )
208 );
209 # Show relevant lines from the suppression log
210 if ( $user->isAllowed( 'suppressionlog' ) ) {
211 $suppressLogPage = new LogPage( 'suppress' );
212 $output->addHTML( "<h2>" . $suppressLogPage->getName()->escaped() . "</h2>\n" );
213 LogEventsList::showLogExtract(
214 $output,
215 'suppress',
216 $this->targetObj,
217 '',
218 array( 'lim' => 25, 'conds' => $qc, 'useMaster' => $this->wasSaved )
219 );
220 }
221 }
222
223 /**
224 * Show some useful links in the subtitle
225 */
226 protected function showConvenienceLinks() {
227 # Give a link to the logs/hist for this page
228 if ( $this->targetObj ) {
229 // Also set header tabs to be for the target.
230 $this->getSkin()->setRelevantTitle( $this->targetObj );
231
232 $links = array();
233 $links[] = Linker::linkKnown(
234 SpecialPage::getTitleFor( 'Log' ),
235 $this->msg( 'viewpagelogs' )->escaped(),
236 array(),
237 array( 'page' => $this->targetObj->getPrefixedText() )
238 );
239 if ( !$this->targetObj->isSpecialPage() ) {
240 # Give a link to the page history
241 $links[] = Linker::linkKnown(
242 $this->targetObj,
243 $this->msg( 'pagehist' )->escaped(),
244 array(),
245 array( 'action' => 'history' )
246 );
247 # Link to deleted edits
248 if ( $this->getUser()->isAllowed( 'undelete' ) ) {
249 $undelete = SpecialPage::getTitleFor( 'Undelete' );
250 $links[] = Linker::linkKnown(
251 $undelete,
252 $this->msg( 'deletedhist' )->escaped(),
253 array(),
254 array( 'target' => $this->targetObj->getPrefixedDBkey() )
255 );
256 }
257 }
258 # Logs themselves don't have histories or archived revisions
259 $this->getOutput()->addSubtitle( $this->getLanguage()->pipeList( $links ) );
260 }
261 }
262
263 /**
264 * Get the condition used for fetching log snippets
265 * @return array
266 */
267 protected function getLogQueryCond() {
268 $conds = array();
269 // Revision delete logs for these item
270 $conds['log_type'] = array( 'delete', 'suppress' );
271 $conds['log_action'] = $this->getList()->getLogAction();
272 $conds['ls_field'] = RevisionDeleter::getRelationType( $this->typeName );
273 $conds['ls_value'] = $this->ids;
274
275 return $conds;
276 }
277
278 /**
279 * Show a deleted file version requested by the visitor.
280 * TODO Mostly copied from Special:Undelete. Refactor.
281 * @param string $archiveName
282 */
283 protected function tryShowFile( $archiveName ) {
284 $repo = RepoGroup::singleton()->getLocalRepo();
285 $oimage = $repo->newFromArchiveName( $this->targetObj, $archiveName );
286 $oimage->load();
287 // Check if user is allowed to see this file
288 if ( !$oimage->exists() ) {
289 $this->getOutput()->addWikiMsg( 'revdelete-no-file' );
290
291 return;
292 }
293 $user = $this->getUser();
294 if ( !$oimage->userCan( File::DELETED_FILE, $user ) ) {
295 if ( $oimage->isDeleted( File::DELETED_RESTRICTED ) ) {
296 throw new PermissionsError( 'suppressrevision' );
297 } else {
298 throw new PermissionsError( 'deletedtext' );
299 }
300 }
301 if ( !$user->matchEditToken( $this->token, $archiveName ) ) {
302 $lang = $this->getLanguage();
303 $this->getOutput()->addWikiMsg( 'revdelete-show-file-confirm',
304 $this->targetObj->getText(),
305 $lang->userDate( $oimage->getTimestamp(), $user ),
306 $lang->userTime( $oimage->getTimestamp(), $user ) );
307 $this->getOutput()->addHTML(
308 Xml::openElement( 'form', array(
309 'method' => 'POST',
310 'action' => $this->getPageTitle()->getLocalURL( array(
311 'target' => $this->targetObj->getPrefixedDBkey(),
312 'file' => $archiveName,
313 'token' => $user->getEditToken( $archiveName ),
314 ) )
315 )
316 ) .
317 Xml::submitButton( $this->msg( 'revdelete-show-file-submit' )->text() ) .
318 '</form>'
319 );
320
321 return;
322 }
323 $this->getOutput()->disable();
324 # We mustn't allow the output to be Squid cached, otherwise
325 # if an admin previews a deleted image, and it's cached, then
326 # a user without appropriate permissions can toddle off and
327 # nab the image, and Squid will serve it
328 $this->getRequest()->response()->header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', 0 ) . ' GMT' );
329 $this->getRequest()->response()->header( 'Cache-Control: no-cache, no-store, max-age=0, must-revalidate' );
330 $this->getRequest()->response()->header( 'Pragma: no-cache' );
331
332 $key = $oimage->getStorageKey();
333 $path = $repo->getZonePath( 'deleted' ) . '/' . $repo->getDeletedHashPath( $key ) . $key;
334 $repo->streamFile( $path );
335 }
336
337 /**
338 * Get the list object for this request
339 * @return RevDel_List
340 */
341 protected function getList() {
342 if ( is_null( $this->revDelList ) ) {
343 $this->revDelList = RevisionDeleter::createList(
344 $this->typeName, $this->getContext(), $this->targetObj, $this->ids
345 );
346 }
347
348 return $this->revDelList;
349 }
350
351 /**
352 * Show a list of items that we will operate on, and show a form with checkboxes
353 * which will allow the user to choose new visibility settings.
354 */
355 protected function showForm() {
356 $userAllowed = true;
357
358 // Messages: revdelete-selected-text, revdelete-selected-file, logdelete-selected
359 $this->getOutput()->wrapWikiMsg( "<strong>$1</strong>", array( $this->typeLabels['selected'],
360 $this->getLanguage()->formatNum( count( $this->ids ) ), $this->targetObj->getPrefixedText() ) );
361
362 $this->getOutput()->addHTML( "<ul>" );
363
364 $numRevisions = 0;
365 // Live revisions...
366 $list = $this->getList();
367 for ( $list->reset(); $list->current(); $list->next() ) {
368 $item = $list->current();
369 if ( !$item->canView() ) {
370 if ( !$this->submitClicked ) {
371 throw new PermissionsError( 'suppressrevision' );
372 }
373 $userAllowed = false;
374 }
375 $numRevisions++;
376 $this->getOutput()->addHTML( $item->getHTML() );
377 }
378
379 if ( !$numRevisions ) {
380 throw new ErrorPageError( 'revdelete-nooldid-title', 'revdelete-nooldid-text' );
381 }
382
383 $this->getOutput()->addHTML( "</ul>" );
384 // Explanation text
385 $this->addUsageText();
386
387 // Normal sysops can always see what they did, but can't always change it
388 if ( !$userAllowed ) {
389 return;
390 }
391
392 // Show form if the user can submit
393 if ( $this->mIsAllowed ) {
394 $out = Xml::openElement( 'form', array( 'method' => 'post',
395 'action' => $this->getPageTitle()->getLocalURL( array( 'action' => 'submit' ) ),
396 'id' => 'mw-revdel-form-revisions' ) ) .
397 Xml::fieldset( $this->msg( 'revdelete-legend' )->text() ) .
398 $this->buildCheckBoxes() .
399 Xml::openElement( 'table' ) .
400 "<tr>\n" .
401 '<td class="mw-label">' .
402 Xml::label( $this->msg( 'revdelete-log' )->text(), 'wpRevDeleteReasonList' ) .
403 '</td>' .
404 '<td class="mw-input">' .
405 Xml::listDropDown( 'wpRevDeleteReasonList',
406 $this->msg( 'revdelete-reason-dropdown' )->inContentLanguage()->text(),
407 $this->msg( 'revdelete-reasonotherlist' )->inContentLanguage()->text(),
408 $this->getRequest()->getText( 'wpRevDeleteReasonList', 'other' ), 'wpReasonDropDown', 1
409 ) .
410 '</td>' .
411 "</tr><tr>\n" .
412 '<td class="mw-label">' .
413 Xml::label( $this->msg( 'revdelete-otherreason' )->text(), 'wpReason' ) .
414 '</td>' .
415 '<td class="mw-input">' .
416 Xml::input( 'wpReason', 60, $this->otherReason, array( 'id' => 'wpReason', 'maxlength' => 100 ) ) .
417 '</td>' .
418 "</tr><tr>\n" .
419 '<td></td>' .
420 '<td class="mw-submit">' .
421 Xml::submitButton( $this->msg( 'revdelete-submit', $numRevisions )->text(),
422 array( 'name' => 'wpSubmit' ) ) .
423 '</td>' .
424 "</tr>\n" .
425 Xml::closeElement( 'table' ) .
426 Html::hidden( 'wpEditToken', $this->getUser()->getEditToken() ) .
427 Html::hidden( 'target', $this->targetObj->getPrefixedText() ) .
428 Html::hidden( 'type', $this->typeName ) .
429 Html::hidden( 'ids', implode( ',', $this->ids ) ) .
430 Xml::closeElement( 'fieldset' ) . "\n";
431 } else {
432 $out = '';
433 }
434 if ( $this->mIsAllowed ) {
435 $out .= Xml::closeElement( 'form' ) . "\n";
436 // Show link to edit the dropdown reasons
437 if ( $this->getUser()->isAllowed( 'editinterface' ) ) {
438 $title = Title::makeTitle( NS_MEDIAWIKI, 'Revdelete-reason-dropdown' );
439 $link = Linker::link(
440 $title,
441 $this->msg( 'revdelete-edit-reasonlist' )->escaped(),
442 array(),
443 array( 'action' => 'edit' )
444 );
445 $out .= Xml::tags( 'p', array( 'class' => 'mw-revdel-editreasons' ), $link ) . "\n";
446 }
447 }
448 $this->getOutput()->addHTML( $out );
449 }
450
451 /**
452 * Show some introductory text
453 * @todo FIXME: Wikimedia-specific policy text
454 */
455 protected function addUsageText() {
456 // Messages: revdelete-text-text, revdelete-text-file, logdelete-text
457 $this->getOutput()->wrapWikiMsg( "<strong>$1</strong>\n$2", $this->typeLabels['text'], 'revdelete-text-others' );
458 if ( $this->getUser()->isAllowed( 'suppressrevision' ) ) {
459 $this->getOutput()->addWikiMsg( 'revdelete-suppress-text' );
460 }
461 if ( $this->mIsAllowed ) {
462 $this->getOutput()->addWikiMsg( 'revdelete-confirm' );
463 }
464 }
465
466 /**
467 * @return string HTML
468 */
469 protected function buildCheckBoxes() {
470 $html = '<table>';
471 // If there is just one item, use checkboxes
472 $list = $this->getList();
473 if ( $list->length() == 1 ) {
474 $list->reset();
475 $bitfield = $list->current()->getBits(); // existing field
476 if ( $this->submitClicked ) {
477 $bitfield = RevisionDeleter::extractBitfield( $this->extractBitParams(), $bitfield );
478 }
479 foreach ( $this->checks as $item ) {
480 // Messages: revdelete-hide-text, revdelete-hide-image, revdelete-hide-name,
481 // revdelete-hide-comment, revdelete-hide-user, revdelete-hide-restricted
482 list( $message, $name, $field ) = $item;
483 $innerHTML = Xml::checkLabel( $this->msg( $message )->text(), $name, $name, $bitfield & $field );
484 if ( $field == Revision::DELETED_RESTRICTED ) {
485 $innerHTML = "<b>$innerHTML</b>";
486 }
487 $line = Xml::tags( 'td', array( 'class' => 'mw-input' ), $innerHTML );
488 $html .= "<tr>$line</tr>\n";
489 }
490 } else {
491 // Otherwise, use tri-state radios
492 $html .= '<tr>';
493 $html .= '<th class="mw-revdel-checkbox">' . $this->msg( 'revdelete-radio-same' )->escaped() . '</th>';
494 $html .= '<th class="mw-revdel-checkbox">' . $this->msg( 'revdelete-radio-unset' )->escaped() . '</th>';
495 $html .= '<th class="mw-revdel-checkbox">' . $this->msg( 'revdelete-radio-set' )->escaped() . '</th>';
496 $html .= "<th></th></tr>\n";
497 foreach ( $this->checks as $item ) {
498 // Messages: revdelete-hide-text, revdelete-hide-image, revdelete-hide-name,
499 // revdelete-hide-comment, revdelete-hide-user, revdelete-hide-restricted
500 list( $message, $name, $field ) = $item;
501 // If there are several items, use third state by default...
502 if ( $this->submitClicked ) {
503 $selected = $this->getRequest()->getInt( $name, 0 /* unchecked */ );
504 } else {
505 $selected = -1; // use existing field
506 }
507 $line = '<td class="mw-revdel-checkbox">' . Xml::radio( $name, -1, $selected == -1 ) . '</td>';
508 $line .= '<td class="mw-revdel-checkbox">' . Xml::radio( $name, 0, $selected == 0 ) . '</td>';
509 $line .= '<td class="mw-revdel-checkbox">' . Xml::radio( $name, 1, $selected == 1 ) . '</td>';
510 $label = $this->msg( $message )->escaped();
511 if ( $field == Revision::DELETED_RESTRICTED ) {
512 $label = "<b>$label</b>";
513 }
514 $line .= "<td>$label</td>";
515 $html .= "<tr>$line</tr>\n";
516 }
517 }
518
519 $html .= '</table>';
520
521 return $html;
522 }
523
524 /**
525 * UI entry point for form submission.
526 * @throws PermissionsError
527 * @return bool
528 */
529 protected function submit() {
530 # Check edit token on submission
531 $token = $this->getRequest()->getVal( 'wpEditToken' );
532 if ( $this->submitClicked && !$this->getUser()->matchEditToken( $token ) ) {
533 $this->getOutput()->addWikiMsg( 'sessionfailure' );
534
535 return false;
536 }
537 $bitParams = $this->extractBitParams();
538 $listReason = $this->getRequest()->getText( 'wpRevDeleteReasonList', 'other' ); // from dropdown
539 $comment = $listReason;
540 if ( $comment != 'other' && $this->otherReason != '' ) {
541 // Entry from drop down menu + additional comment
542 $comment .= $this->msg( 'colon-separator' )->inContentLanguage()->text() . $this->otherReason;
543 } elseif ( $comment == 'other' ) {
544 $comment = $this->otherReason;
545 }
546 # Can the user set this field?
547 if ( $bitParams[Revision::DELETED_RESTRICTED] == 1 && !$this->getUser()->isAllowed( 'suppressrevision' ) ) {
548 throw new PermissionsError( 'suppressrevision' );
549 }
550 # If the save went through, go to success message...
551 $status = $this->save( $bitParams, $comment, $this->targetObj );
552 if ( $status->isGood() ) {
553 $this->success();
554
555 return true;
556 } else {
557 # ...otherwise, bounce back to form...
558 $this->failure( $status );
559 }
560
561 return false;
562 }
563
564 /**
565 * Report that the submit operation succeeded
566 */
567 protected function success() {
568 // Messages: revdelete-success, logdelete-success
569 $this->getOutput()->setPageTitle( $this->msg( 'actioncomplete' ) );
570 $this->getOutput()->wrapWikiMsg( "<span class=\"success\">\n$1\n</span>", $this->typeLabels['success'] );
571 $this->wasSaved = true;
572 $this->revDelList->reloadFromMaster();
573 $this->showForm();
574 }
575
576 /**
577 * Report that the submit operation failed
578 */
579 protected function failure( $status ) {
580 // Messages: revdelete-failure, logdelete-failure
581 $this->getOutput()->setPageTitle( $this->msg( 'actionfailed' ) );
582 $this->getOutput()->addWikiText( $status->getWikiText( $this->typeLabels['failure'] ) );
583 $this->showForm();
584 }
585
586 /**
587 * Put together an array that contains -1, 0, or the *_deleted const for each bit
588 *
589 * @return array
590 */
591 protected function extractBitParams() {
592 $bitfield = array();
593 foreach ( $this->checks as $item ) {
594 list( /* message */, $name, $field ) = $item;
595 $val = $this->getRequest()->getInt( $name, 0 /* unchecked */ );
596 if ( $val < -1 || $val > 1 ) {
597 $val = -1; // -1 for existing value
598 }
599 $bitfield[$field] = $val;
600 }
601 if ( !isset( $bitfield[Revision::DELETED_RESTRICTED] ) ) {
602 $bitfield[Revision::DELETED_RESTRICTED] = 0;
603 }
604
605 return $bitfield;
606 }
607
608 /**
609 * Do the write operations. Simple wrapper for RevDel_*List::setVisibility().
610 * @param int $bitfield
611 * @param string $reason
612 * @param Title $title
613 * @return Status
614 */
615 protected function save( $bitfield, $reason, $title ) {
616 return $this->getList()->setVisibility(
617 array( 'value' => $bitfield, 'comment' => $reason )
618 );
619 }
620
621 protected function getGroupName() {
622 return 'pagetools';
623 }
624 }