Remove unused variables/globals
[lhc/web/wiklou.git] / includes / revisiondelete / RevisionDelete.php
1 <?php
2 /**
3 * List for revision table items
4 *
5 * This will check both the 'revision' table for live revisions and the
6 * 'archive' table for traditionally-deleted revisions that have an
7 * ar_rev_id saved.
8 *
9 * See RevDel_RevisionItem and RevDel_ArchivedRevisionItem for items.
10 */
11 class RevDel_RevisionList extends RevDel_List {
12 var $currentRevId;
13 var $type = 'revision';
14 var $idField = 'rev_id';
15 var $dateField = 'rev_timestamp';
16 var $authorIdField = 'rev_user';
17 var $authorNameField = 'rev_user_text';
18
19 /**
20 * @param $db DatabaseBase
21 * @return mixed
22 */
23 public function doQuery( $db ) {
24 $ids = array_map( 'intval', $this->ids );
25 $live = $db->select( array('revision','page'), '*',
26 array(
27 'rev_page' => $this->title->getArticleID(),
28 'rev_id' => $ids,
29 'rev_page = page_id'
30 ),
31 __METHOD__,
32 array( 'ORDER BY' => 'rev_id DESC' )
33 );
34
35 if ( $live->numRows() >= count( $ids ) ) {
36 // All requested revisions are live, keeps things simple!
37 return $live;
38 }
39
40 // Check if any requested revisions are available fully deleted.
41 $archived = $db->select( array( 'archive' ), '*',
42 array(
43 'ar_rev_id' => $ids
44 ),
45 __METHOD__,
46 array( 'ORDER BY' => 'ar_rev_id DESC' )
47 );
48
49 if ( $archived->numRows() == 0 ) {
50 return $live;
51 } else if ( $live->numRows() == 0 ) {
52 return $archived;
53 } else {
54 // Combine the two! Whee
55 $rows = array();
56 foreach ( $live as $row ) {
57 $rows[$row->rev_id] = $row;
58 }
59 foreach ( $archived as $row ) {
60 $rows[$row->ar_rev_id] = $row;
61 }
62 krsort( $rows );
63 return new FakeResultWrapper( array_values( $rows ) );
64 }
65 }
66
67 public function newItem( $row ) {
68 if ( isset( $row->rev_id ) ) {
69 return new RevDel_RevisionItem( $this, $row );
70 } elseif ( isset( $row->ar_rev_id ) ) {
71 return new RevDel_ArchivedRevisionItem( $this, $row );
72 } else {
73 // This shouldn't happen. :)
74 throw new MWException( 'Invalid row type in RevDel_RevisionList' );
75 }
76 }
77
78 public function getCurrent() {
79 if ( is_null( $this->currentRevId ) ) {
80 $dbw = wfGetDB( DB_MASTER );
81 $this->currentRevId = $dbw->selectField(
82 'page', 'page_latest', $this->title->pageCond(), __METHOD__ );
83 }
84 return $this->currentRevId;
85 }
86
87 public function getSuppressBit() {
88 return Revision::DELETED_RESTRICTED;
89 }
90
91 public function doPreCommitUpdates() {
92 $this->title->invalidateCache();
93 return Status::newGood();
94 }
95
96 public function doPostCommitUpdates() {
97 $this->title->purgeSquid();
98 // Extensions that require referencing previous revisions may need this
99 wfRunHooks( 'ArticleRevisionVisibilitySet', array( &$this->title ) );
100 return Status::newGood();
101 }
102 }
103
104 /**
105 * Item class for a live revision table row
106 */
107 class RevDel_RevisionItem extends RevDel_Item {
108 var $revision;
109
110 public function __construct( $list, $row ) {
111 parent::__construct( $list, $row );
112 $this->revision = new Revision( $row );
113 }
114
115 public function canView() {
116 return $this->revision->userCan( Revision::DELETED_RESTRICTED );
117 }
118
119 public function canViewContent() {
120 return $this->revision->userCan( Revision::DELETED_TEXT );
121 }
122
123 public function getBits() {
124 return $this->revision->mDeleted;
125 }
126
127 public function setBits( $bits ) {
128 $dbw = wfGetDB( DB_MASTER );
129 // Update revision table
130 $dbw->update( 'revision',
131 array( 'rev_deleted' => $bits ),
132 array(
133 'rev_id' => $this->revision->getId(),
134 'rev_page' => $this->revision->getPage(),
135 'rev_deleted' => $this->getBits()
136 ),
137 __METHOD__
138 );
139 if ( !$dbw->affectedRows() ) {
140 // Concurrent fail!
141 return false;
142 }
143 // Update recentchanges table
144 $dbw->update( 'recentchanges',
145 array(
146 'rc_deleted' => $bits,
147 'rc_patrolled' => 1
148 ),
149 array(
150 'rc_this_oldid' => $this->revision->getId(), // condition
151 // non-unique timestamp index
152 'rc_timestamp' => $dbw->timestamp( $this->revision->getTimestamp() ),
153 ),
154 __METHOD__
155 );
156 return true;
157 }
158
159 public function isDeleted() {
160 return $this->revision->isDeleted( Revision::DELETED_TEXT );
161 }
162
163 public function isHideCurrentOp( $newBits ) {
164 return ( $newBits & Revision::DELETED_TEXT )
165 && $this->list->getCurrent() == $this->getId();
166 }
167
168 /**
169 * Get the HTML link to the revision text.
170 * Overridden by RevDel_ArchiveItem.
171 */
172 protected function getRevisionLink() {
173 global $wgLang;
174 $date = $wgLang->timeanddate( $this->revision->getTimestamp(), true );
175 if ( $this->isDeleted() && !$this->canViewContent() ) {
176 return $date;
177 }
178 return $this->special->skin->link(
179 $this->list->title,
180 $date,
181 array(),
182 array(
183 'oldid' => $this->revision->getId(),
184 'unhide' => 1
185 )
186 );
187 }
188
189 /**
190 * Get the HTML link to the diff.
191 * Overridden by RevDel_ArchiveItem
192 */
193 protected function getDiffLink() {
194 if ( $this->isDeleted() && !$this->canViewContent() ) {
195 return wfMsgHtml('diff');
196 } else {
197 return
198 $this->special->skin->link(
199 $this->list->title,
200 wfMsgHtml('diff'),
201 array(),
202 array(
203 'diff' => $this->revision->getId(),
204 'oldid' => 'prev',
205 'unhide' => 1
206 ),
207 array(
208 'known',
209 'noclasses'
210 )
211 );
212 }
213 }
214
215 public function getHTML() {
216 $difflink = $this->getDiffLink();
217 $revlink = $this->getRevisionLink();
218 $userlink = $this->special->skin->revUserLink( $this->revision );
219 $comment = $this->special->skin->revComment( $this->revision );
220 if ( $this->isDeleted() ) {
221 $revlink = "<span class=\"history-deleted\">$revlink</span>";
222 }
223 return "<li>($difflink) $revlink $userlink $comment</li>";
224 }
225 }
226
227 /**
228 * List for archive table items, i.e. revisions deleted via action=delete
229 */
230 class RevDel_ArchiveList extends RevDel_RevisionList {
231 var $type = 'archive';
232 var $idField = 'ar_timestamp';
233 var $dateField = 'ar_timestamp';
234 var $authorIdField = 'ar_user';
235 var $authorNameField = 'ar_user_text';
236
237 /**
238 * @param $db DatabaseBase
239 * @return mixed
240 */
241 public function doQuery( $db ) {
242 $timestamps = array();
243 foreach ( $this->ids as $id ) {
244 $timestamps[] = $db->timestamp( $id );
245 }
246 return $db->select( 'archive', '*',
247 array(
248 'ar_namespace' => $this->title->getNamespace(),
249 'ar_title' => $this->title->getDBkey(),
250 'ar_timestamp' => $timestamps
251 ),
252 __METHOD__,
253 array( 'ORDER BY' => 'ar_timestamp DESC' )
254 );
255 }
256
257 public function newItem( $row ) {
258 return new RevDel_ArchiveItem( $this, $row );
259 }
260
261 public function doPreCommitUpdates() {
262 return Status::newGood();
263 }
264
265 public function doPostCommitUpdates() {
266 return Status::newGood();
267 }
268 }
269
270 /**
271 * Item class for a archive table row
272 */
273 class RevDel_ArchiveItem extends RevDel_RevisionItem {
274 public function __construct( $list, $row ) {
275 RevDel_Item::__construct( $list, $row );
276 $this->revision = Revision::newFromArchiveRow( $row,
277 array( 'page' => $this->list->title->getArticleId() ) );
278 }
279
280 public function getId() {
281 # Convert DB timestamp to MW timestamp
282 return $this->revision->getTimestamp();
283 }
284
285 public function setBits( $bits ) {
286 $dbw = wfGetDB( DB_MASTER );
287 $dbw->update( 'archive',
288 array( 'ar_deleted' => $bits ),
289 array( 'ar_namespace' => $this->list->title->getNamespace(),
290 'ar_title' => $this->list->title->getDBkey(),
291 // use timestamp for index
292 'ar_timestamp' => $this->row->ar_timestamp,
293 'ar_rev_id' => $this->row->ar_rev_id,
294 'ar_deleted' => $this->getBits()
295 ),
296 __METHOD__ );
297 return (bool)$dbw->affectedRows();
298 }
299
300 protected function getRevisionLink() {
301 global $wgLang;
302 $undelete = SpecialPage::getTitleFor( 'Undelete' );
303 $date = $wgLang->timeanddate( $this->revision->getTimestamp(), true );
304 if ( $this->isDeleted() && !$this->canViewContent() ) {
305 return $date;
306 }
307 return $this->special->skin->link( $undelete, $date, array(),
308 array(
309 'target' => $this->list->title->getPrefixedText(),
310 'timestamp' => $this->revision->getTimestamp()
311 ) );
312 }
313
314 protected function getDiffLink() {
315 if ( $this->isDeleted() && !$this->canViewContent() ) {
316 return wfMsgHtml( 'diff' );
317 }
318 $undelete = SpecialPage::getTitleFor( 'Undelete' );
319 return $this->special->skin->link( $undelete, wfMsgHtml('diff'), array(),
320 array(
321 'target' => $this->list->title->getPrefixedText(),
322 'diff' => 'prev',
323 'timestamp' => $this->revision->getTimestamp()
324 ) );
325 }
326 }
327
328
329 /**
330 * Item class for a archive table row by ar_rev_id -- actually
331 * used via RevDel_RevisionList.
332 */
333 class RevDel_ArchivedRevisionItem extends RevDel_ArchiveItem {
334 public function __construct( $list, $row ) {
335 RevDel_Item::__construct( $list, $row );
336
337 $this->revision = Revision::newFromArchiveRow( $row,
338 array( 'page' => $this->list->title->getArticleId() ) );
339 }
340
341 public function getId() {
342 return $this->revision->getId();
343 }
344
345 public function setBits( $bits ) {
346 $dbw = wfGetDB( DB_MASTER );
347 $dbw->update( 'archive',
348 array( 'ar_deleted' => $bits ),
349 array( 'ar_rev_id' => $this->row->ar_rev_id,
350 'ar_deleted' => $this->getBits()
351 ),
352 __METHOD__ );
353 return (bool)$dbw->affectedRows();
354 }
355 }
356
357 /**
358 * List for oldimage table items
359 */
360 class RevDel_FileList extends RevDel_List {
361 var $type = 'oldimage';
362 var $idField = 'oi_archive_name';
363 var $dateField = 'oi_timestamp';
364 var $authorIdField = 'oi_user';
365 var $authorNameField = 'oi_user_text';
366 var $storeBatch, $deleteBatch, $cleanupBatch;
367
368 /**
369 * @param $db DatabaseBase
370 * @return mixed
371 */
372 public function doQuery( $db ) {
373 $archiveNames = array();
374 foreach( $this->ids as $timestamp ) {
375 $archiveNames[] = $timestamp . '!' . $this->title->getDBkey();
376 }
377 return $db->select( 'oldimage', '*',
378 array(
379 'oi_name' => $this->title->getDBkey(),
380 'oi_archive_name' => $archiveNames
381 ),
382 __METHOD__,
383 array( 'ORDER BY' => 'oi_timestamp DESC' )
384 );
385 }
386
387 public function newItem( $row ) {
388 return new RevDel_FileItem( $this, $row );
389 }
390
391 public function clearFileOps() {
392 $this->deleteBatch = array();
393 $this->storeBatch = array();
394 $this->cleanupBatch = array();
395 }
396
397 public function doPreCommitUpdates() {
398 $status = Status::newGood();
399 $repo = RepoGroup::singleton()->getLocalRepo();
400 if ( $this->storeBatch ) {
401 $status->merge( $repo->storeBatch( $this->storeBatch, FileRepo::OVERWRITE_SAME ) );
402 }
403 if ( !$status->isOK() ) {
404 return $status;
405 }
406 if ( $this->deleteBatch ) {
407 $status->merge( $repo->deleteBatch( $this->deleteBatch ) );
408 }
409 if ( !$status->isOK() ) {
410 // Running cleanupDeletedBatch() after a failed storeBatch() with the DB already
411 // modified (but destined for rollback) causes data loss
412 return $status;
413 }
414 if ( $this->cleanupBatch ) {
415 $status->merge( $repo->cleanupDeletedBatch( $this->cleanupBatch ) );
416 }
417 return $status;
418 }
419
420 public function doPostCommitUpdates() {
421 $file = wfLocalFile( $this->title );
422 $file->purgeCache();
423 $file->purgeDescription();
424 return Status::newGood();
425 }
426
427 public function getSuppressBit() {
428 return File::DELETED_RESTRICTED;
429 }
430 }
431
432 /**
433 * Item class for an oldimage table row
434 */
435 class RevDel_FileItem extends RevDel_Item {
436
437 /**
438 * @var File
439 */
440 var $file;
441
442 public function __construct( $list, $row ) {
443 parent::__construct( $list, $row );
444 $this->file = RepoGroup::singleton()->getLocalRepo()->newFileFromRow( $row );
445 }
446
447 public function getId() {
448 $parts = explode( '!', $this->row->oi_archive_name );
449 return $parts[0];
450 }
451
452 public function canView() {
453 return $this->file->userCan( File::DELETED_RESTRICTED );
454 }
455
456 public function canViewContent() {
457 return $this->file->userCan( File::DELETED_FILE );
458 }
459
460 public function getBits() {
461 return $this->file->getVisibility();
462 }
463
464 public function setBits( $bits ) {
465 # Queue the file op
466 # @todo FIXME: Move to LocalFile.php
467 if ( $this->isDeleted() ) {
468 if ( $bits & File::DELETED_FILE ) {
469 # Still deleted
470 } else {
471 # Newly undeleted
472 $key = $this->file->getStorageKey();
473 $srcRel = $this->file->repo->getDeletedHashPath( $key ) . $key;
474 $this->list->storeBatch[] = array(
475 $this->file->repo->getVirtualUrl( 'deleted' ) . '/' . $srcRel,
476 'public',
477 $this->file->getRel()
478 );
479 $this->list->cleanupBatch[] = $key;
480 }
481 } elseif ( $bits & File::DELETED_FILE ) {
482 # Newly deleted
483 $key = $this->file->getStorageKey();
484 $dstRel = $this->file->repo->getDeletedHashPath( $key ) . $key;
485 $this->list->deleteBatch[] = array( $this->file->getRel(), $dstRel );
486 }
487
488 # Do the database operations
489 $dbw = wfGetDB( DB_MASTER );
490 $dbw->update( 'oldimage',
491 array( 'oi_deleted' => $bits ),
492 array(
493 'oi_name' => $this->row->oi_name,
494 'oi_timestamp' => $this->row->oi_timestamp,
495 'oi_deleted' => $this->getBits()
496 ),
497 __METHOD__
498 );
499 return (bool)$dbw->affectedRows();
500 }
501
502 public function isDeleted() {
503 return $this->file->isDeleted( File::DELETED_FILE );
504 }
505
506 /**
507 * Get the link to the file.
508 * Overridden by RevDel_ArchivedFileItem.
509 */
510 protected function getLink() {
511 global $wgLang, $wgUser;
512 $date = $wgLang->timeanddate( $this->file->getTimestamp(), true );
513 if ( $this->isDeleted() ) {
514 # Hidden files...
515 if ( !$this->canViewContent() ) {
516 $link = $date;
517 } else {
518 $link = $this->special->skin->link(
519 $this->special->getTitle(),
520 $date, array(),
521 array(
522 'target' => $this->list->title->getPrefixedText(),
523 'file' => $this->file->getArchiveName(),
524 'token' => $wgUser->editToken( $this->file->getArchiveName() )
525 )
526 );
527 }
528 return '<span class="history-deleted">' . $link . '</span>';
529 } else {
530 # Regular files...
531 return Xml::element( 'a', array( 'href' => $this->file->getUrl() ), $date );
532 }
533 }
534 /**
535 * Generate a user tool link cluster if the current user is allowed to view it
536 * @return string HTML
537 */
538 protected function getUserTools() {
539 if( $this->file->userCan( Revision::DELETED_USER ) ) {
540 $link = $this->special->skin->userLink( $this->file->user, $this->file->user_text ) .
541 $this->special->skin->userToolLinks( $this->file->user, $this->file->user_text );
542 } else {
543 $link = wfMsgHtml( 'rev-deleted-user' );
544 }
545 if( $this->file->isDeleted( Revision::DELETED_USER ) ) {
546 return '<span class="history-deleted">' . $link . '</span>';
547 }
548 return $link;
549 }
550
551 /**
552 * Wrap and format the file's comment block, if the current
553 * user is allowed to view it.
554 *
555 * @return string HTML
556 */
557 protected function getComment() {
558 if( $this->file->userCan( File::DELETED_COMMENT ) ) {
559 $block = $this->special->skin->commentBlock( $this->file->description );
560 } else {
561 $block = ' ' . wfMsgHtml( 'rev-deleted-comment' );
562 }
563 if( $this->file->isDeleted( File::DELETED_COMMENT ) ) {
564 return "<span class=\"history-deleted\">$block</span>";
565 }
566 return $block;
567 }
568
569 public function getHTML() {
570 global $wgLang;
571 $data =
572 wfMsg(
573 'widthheight',
574 $wgLang->formatNum( $this->file->getWidth() ),
575 $wgLang->formatNum( $this->file->getHeight() )
576 ) .
577 ' (' .
578 wfMsgExt( 'nbytes', 'parsemag', $wgLang->formatNum( $this->file->getSize() ) ) .
579 ')';
580
581 return '<li>' . $this->getLink() . ' ' . $this->getUserTools() . ' ' .
582 $data . ' ' . $this->getComment(). '</li>';
583 }
584 }
585
586 /**
587 * List for filearchive table items
588 */
589 class RevDel_ArchivedFileList extends RevDel_FileList {
590 var $type = 'filearchive';
591 var $idField = 'fa_id';
592 var $dateField = 'fa_timestamp';
593 var $authorIdField = 'fa_user';
594 var $authorNameField = 'fa_user_text';
595
596 /**
597 * @param $db DatabaseBase
598 * @return mixed
599 */
600 public function doQuery( $db ) {
601 $ids = array_map( 'intval', $this->ids );
602 return $db->select( 'filearchive', '*',
603 array(
604 'fa_name' => $this->title->getDBkey(),
605 'fa_id' => $ids
606 ),
607 __METHOD__,
608 array( 'ORDER BY' => 'fa_id DESC' )
609 );
610 }
611
612 public function newItem( $row ) {
613 return new RevDel_ArchivedFileItem( $this, $row );
614 }
615 }
616
617 /**
618 * Item class for a filearchive table row
619 */
620 class RevDel_ArchivedFileItem extends RevDel_FileItem {
621 public function __construct( $list, $row ) {
622 RevDel_Item::__construct( $list, $row );
623 $this->file = ArchivedFile::newFromRow( $row );
624 }
625
626 public function getId() {
627 return $this->row->fa_id;
628 }
629
630 public function setBits( $bits ) {
631 $dbw = wfGetDB( DB_MASTER );
632 $dbw->update( 'filearchive',
633 array( 'fa_deleted' => $bits ),
634 array(
635 'fa_id' => $this->row->fa_id,
636 'fa_deleted' => $this->getBits(),
637 ),
638 __METHOD__
639 );
640 return (bool)$dbw->affectedRows();
641 }
642
643 protected function getLink() {
644 global $wgLang, $wgUser;
645 $date = $wgLang->timeanddate( $this->file->getTimestamp(), true );
646 $undelete = SpecialPage::getTitleFor( 'Undelete' );
647 $key = $this->file->getKey();
648 # Hidden files...
649 if( !$this->canViewContent() ) {
650 $link = $date;
651 } else {
652 $link = $this->special->skin->link( $undelete, $date, array(),
653 array(
654 'target' => $this->list->title->getPrefixedText(),
655 'file' => $key,
656 'token' => $wgUser->editToken( $key )
657 )
658 );
659 }
660 if( $this->isDeleted() ) {
661 $link = '<span class="history-deleted">' . $link . '</span>';
662 }
663 return $link;
664 }
665 }
666
667 /**
668 * List for logging table items
669 */
670 class RevDel_LogList extends RevDel_List {
671 var $type = 'logging';
672 var $idField = 'log_id';
673 var $dateField = 'log_timestamp';
674 var $authorIdField = 'log_user';
675 var $authorNameField = 'log_user_text';
676
677 /**
678 * @param $db DatabaseBase
679 * @return mixed
680 */
681 public function doQuery( $db ) {
682 $ids = array_map( 'intval', $this->ids );
683 return $db->select( 'logging', '*',
684 array( 'log_id' => $ids ),
685 __METHOD__,
686 array( 'ORDER BY' => 'log_id DESC' )
687 );
688 }
689
690 public function newItem( $row ) {
691 return new RevDel_LogItem( $this, $row );
692 }
693
694 public function getSuppressBit() {
695 return Revision::DELETED_RESTRICTED;
696 }
697
698 public function getLogAction() {
699 return 'event';
700 }
701
702 public function getLogParams( $params ) {
703 return array(
704 implode( ',', $params['ids'] ),
705 "ofield={$params['oldBits']}",
706 "nfield={$params['newBits']}"
707 );
708 }
709 }
710
711 /**
712 * Item class for a logging table row
713 */
714 class RevDel_LogItem extends RevDel_Item {
715 public function canView() {
716 return LogEventsList::userCan( $this->row, Revision::DELETED_RESTRICTED );
717 }
718
719 public function canViewContent() {
720 return true; // none
721 }
722
723 public function getBits() {
724 return $this->row->log_deleted;
725 }
726
727 public function setBits( $bits ) {
728 $dbw = wfGetDB( DB_MASTER );
729 $dbw->update( 'recentchanges',
730 array(
731 'rc_deleted' => $bits,
732 'rc_patrolled' => 1
733 ),
734 array(
735 'rc_logid' => $this->row->log_id,
736 'rc_timestamp' => $this->row->log_timestamp // index
737 ),
738 __METHOD__
739 );
740 $dbw->update( 'logging',
741 array( 'log_deleted' => $bits ),
742 array(
743 'log_id' => $this->row->log_id,
744 'log_deleted' => $this->getBits()
745 ),
746 __METHOD__
747 );
748 return (bool)$dbw->affectedRows();
749 }
750
751 public function getHTML() {
752 global $wgLang;
753
754 $date = htmlspecialchars( $wgLang->timeanddate( $this->row->log_timestamp ) );
755 $paramArray = LogPage::extractParams( $this->row->log_params );
756 $title = Title::makeTitle( $this->row->log_namespace, $this->row->log_title );
757
758 // Log link for this page
759 $loglink = $this->special->skin->link(
760 SpecialPage::getTitleFor( 'Log' ),
761 wfMsgHtml( 'log' ),
762 array(),
763 array( 'page' => $title->getPrefixedText() )
764 );
765 // Action text
766 if( !$this->canView() ) {
767 $action = '<span class="history-deleted">' . wfMsgHtml('rev-deleted-event') . '</span>';
768 } else {
769 $action = LogPage::actionText( $this->row->log_type, $this->row->log_action, $title,
770 $this->special->skin, $paramArray, true, true );
771 if( $this->row->log_deleted & LogPage::DELETED_ACTION )
772 $action = '<span class="history-deleted">' . $action . '</span>';
773 }
774 // User links
775 $userLink = $this->special->skin->userLink( $this->row->log_user,
776 User::WhoIs( $this->row->log_user ) );
777 if( LogEventsList::isDeleted($this->row,LogPage::DELETED_USER) ) {
778 $userLink = '<span class="history-deleted">' . $userLink . '</span>';
779 }
780 // Comment
781 $comment = $wgLang->getDirMark() . $this->special->skin->commentBlock( $this->row->log_comment );
782 if( LogEventsList::isDeleted($this->row,LogPage::DELETED_COMMENT) ) {
783 $comment = '<span class="history-deleted">' . $comment . '</span>';
784 }
785 return "<li>($loglink) $date $userLink $action $comment</li>";
786 }
787 }