* Let MySQL choose among more indexes for title/user conditions
[lhc/web/wiklou.git] / includes / LogEventsList.php
1 <?php
2 # Copyright (C) 2004 Brion Vibber <brion@pobox.com>, 2008 Aaron Schulz
3 # http://www.mediawiki.org/
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 class LogEventsList {
21 const NO_ACTION_LINK = 1;
22
23 private $skin;
24 public $flags;
25
26 function __construct( &$skin, $flags = 0 ) {
27 $this->skin =& $skin;
28 $this->flags = $flags;
29 $this->preCacheMessages();
30 }
31
32 /**
33 * As we use the same small set of messages in various methods and that
34 * they are called often, we call them once and save them in $this->message
35 */
36 private function preCacheMessages() {
37 // Precache various messages
38 if( !isset( $this->message ) ) {
39 $messages = 'revertmerge protect_change unblocklink revertmove undeletelink revdel-restore rev-delundel';
40 foreach( explode(' ', $messages ) as $msg ) {
41 $this->message[$msg] = wfMsgExt( $msg, array( 'escape') );
42 }
43 }
44 }
45
46 /**
47 * Set page title and show header for this log type
48 * @param OutputPage $out where to send output
49 * @param strin $type
50 */
51 public function showHeader( $out, $type ) {
52 if( LogPage::isLogType( $type ) ) {
53 $out->setPageTitle( LogPage::logName( $type ) );
54 $out->addWikiText( LogPage::logHeader( $type ) );
55 }
56 }
57
58 /**
59 * Show options for the log list
60 * @param OutputPage $out where to send output
61 * @param string $type,
62 * @param string $user,
63 * @param string $page,
64 * @param string $pattern
65 */
66 public function showOptions( $out, $type, $user, $page, $pattern ) {
67 global $wgScript, $wgMiserMode;
68 $action = htmlspecialchars( $wgScript );
69 $title = SpecialPage::getTitleFor( 'Log' );
70 $special = htmlspecialchars( $title->getPrefixedDBkey() );
71 $out->addHTML( "<form action=\"$action\" method=\"get\"><fieldset>" .
72 Xml::element( 'legend', array(), wfMsg( 'log' ) ) .
73 Xml::hidden( 'title', $special ) . "\n" .
74 $this->getTypeMenu( $type ) . "\n" .
75 $this->getUserInput( $user ) . "\n" .
76 $this->getTitleInput( $page ) . "\n" .
77 ( !$wgMiserMode ? ($this->getTitlePattern( $pattern )."\n") : "" ) .
78 Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . "\n" .
79 "</fieldset></form>" );
80 }
81
82 /**
83 * @return string Formatted HTML
84 */
85 private function getTypeMenu( $queryType ) {
86 global $wgLogRestrictions, $wgUser;
87
88 $out = "<select name='type'>\n";
89
90 $validTypes = LogPage::validTypes();
91 $m = array(); // Temporary array
92
93 // First pass to load the log names
94 foreach( $validTypes as $type ) {
95 $text = LogPage::logName( $type );
96 $m[$text] = $type;
97 }
98
99 // Second pass to sort by name
100 ksort($m);
101
102 // Third pass generates sorted XHTML content
103 foreach( $m as $text => $type ) {
104 $selected = ($type == $queryType);
105 // Restricted types
106 if ( isset($wgLogRestrictions[$type]) ) {
107 if ( $wgUser->isAllowed( $wgLogRestrictions[$type] ) ) {
108 $out .= Xml::option( $text, $type, $selected ) . "\n";
109 }
110 } else {
111 $out .= Xml::option( $text, $type, $selected ) . "\n";
112 }
113 }
114
115 $out .= '</select>';
116 return $out;
117 }
118
119 /**
120 * @return string Formatted HTML
121 */
122 private function getUserInput( $user ) {
123 return Xml::inputLabel( wfMsg( 'specialloguserlabel' ), 'user', 'user', 12, $user );
124 }
125
126 /**
127 * @return string Formatted HTML
128 */
129 private function getTitleInput( $title ) {
130 return Xml::inputLabel( wfMsg( 'speciallogtitlelabel' ), 'page', 'page', 20, $title );
131 }
132
133 /**
134 * @return boolean Checkbox
135 */
136 private function getTitlePattern( $pattern ) {
137 return Xml::checkLabel( wfMsg( 'log-title-wildcard' ), 'pattern', 'pattern', $pattern );
138 }
139
140
141 protected function getWrapperElement() {
142 global $wgDateGroupedLogs;
143 return $wgDateGroupedLogs ? 'div' : 'ul';
144 }
145
146 public function beginLogEventsList() {
147 return Xml::openElement( $this->getWrapperElement() ) . "\n";
148 }
149
150 public function endLogEventsList() {
151 return Xml::closeElement( $this->getWrapperElement() ) . "\n";
152 }
153
154 /**
155 * @param Row $row a single row from the result set
156 * @return string Formatted HTML list item
157 * @private
158 */
159 public function logLine( $row ) {
160 global $wgLang, $wgUser, $wgContLang;
161
162 $title = Title::makeTitle( $row->log_namespace, $row->log_title );
163 $time = $wgLang->timeanddate( wfTimestamp(TS_MW, $row->log_timestamp), true );
164 // User links
165 if( self::isDeleted($row,LogPage::DELETED_USER) ) {
166 $userLink = '<span class="history-deleted">' . wfMsgHtml( 'rev-deleted-user' ) . '</span>';
167 } else {
168 $userLink = $this->skin->userLink( $row->log_user, $row->user_name );
169 $this->skin->userToolLinks( $row->log_user, $row->user_name );
170 }
171 // Comment
172 if( self::isDeleted($row,LogPage::DELETED_COMMENT) ) {
173 $comment = '<span class="history-deleted">' . wfMsgHtml('rev-deleted-comment') . '</span>';
174 } else {
175 $comment = $wgContLang->getDirMark() . $this->skin->commentBlock( $row->log_comment );
176 }
177 // Extract extra parameters
178 $paramArray = LogPage::extractParams( $row->log_params );
179 $revert = $del = '';
180 // Some user can hide log items and have review links
181 if( $wgUser->isAllowed( 'deleterevision' ) ) {
182 $del = $this->showhideLinks( $row ) . ' ';
183 }
184 // Add review links and such...
185 if( !($this->flags & self::NO_ACTION_LINK) && !($row->log_deleted & LogPage::DELETED_ACTION) ) {
186 if( $row->log_type == 'move' && isset( $paramArray[0] ) && $wgUser->isAllowed( 'move' ) ) {
187 $destTitle = Title::newFromText( $paramArray[0] );
188 if( $destTitle ) {
189 $revert = '(' . $this->skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Movepage' ),
190 $this->message['revertmove'],
191 'wpOldTitle=' . urlencode( $destTitle->getPrefixedDBkey() ) .
192 '&wpNewTitle=' . urlencode( $title->getPrefixedDBkey() ) .
193 '&wpReason=' . urlencode( wfMsgForContent( 'revertmove' ) ) .
194 '&wpMovetalk=0' ) . ')';
195 }
196 // Show undelete link
197 } else if( $row->log_action == 'delete' && $wgUser->isAllowed( 'delete' ) ) {
198 $revert = '(' . $this->skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Undelete' ),
199 $this->message['undeletelink'], 'target='. urlencode( $title->getPrefixedDBkey() ) ) . ')';
200 // Show unblock link
201 } else if( $row->log_action == 'block' && $wgUser->isAllowed( 'block' ) ) {
202 $revert = '(' . $this->skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Ipblocklist' ),
203 $this->message['unblocklink'],
204 'action=unblock&ip=' . urlencode( $row->log_title ) ) . ')';
205 // Show change protection link
206 } else if( ( $row->log_action == 'protect' || $row->log_action == 'modify' ) && $wgUser->isAllowed( 'protect' ) ) {
207 $revert = '(' . $this->skin->makeKnownLinkObj( $title, $this->message['protect_change'], 'action=unprotect' ) . ')';
208 // Show unmerge link
209 } else if ( $row->log_action == 'merge' ) {
210 $merge = SpecialPage::getTitleFor( 'Mergehistory' );
211 $revert = '(' . $this->skin->makeKnownLinkObj( $merge, $this->message['revertmerge'],
212 wfArrayToCGI(
213 array('target' => $paramArray[0], 'dest' => $title->getPrefixedText(), 'mergepoint' => $paramArray[1] )
214 )
215 ) . ')';
216 // If an edit was hidden from a page give a review link to the history
217 } else if( $row->log_action == 'revision' && $wgUser->isAllowed( 'deleterevision' ) && isset($paramArray[2]) ) {
218 $revdel = SpecialPage::getTitleFor( 'Revisiondelete' );
219 // Different revision types use different URL params...
220 $subtype = isset($paramArray[2]) ? $paramArray[1] : '';
221 // Link to each hidden object ID, $paramArray[1] is the url param. List if several...
222 $Ids = explode( ',', $paramArray[2] );
223 if( count($Ids) == 1 ) {
224 $revert = $this->skin->makeKnownLinkObj( $revdel, $this->message['revdel-restore'],
225 wfArrayToCGI( array('target' => $paramArray[0], $paramArray[1] => $Ids[0] ) ) );
226 } else {
227 $revert .= $this->message['revdel-restore'].':';
228 foreach( $Ids as $n => $id ) {
229 $revert .= ' '.$this->skin->makeKnownLinkObj( $revdel, '#'.($n+1),
230 wfArrayToCGI( array('target' => $paramArray[0], $paramArray[1] => $id ) ) );
231 }
232 }
233 $revert = "($revert)";
234 // Hidden log items, give review link
235 } else if( $row->log_action == 'event' && $wgUser->isAllowed( 'deleterevision' ) && isset($paramArray[0]) ) {
236 $revdel = SpecialPage::getTitleFor( 'Revisiondelete' );
237 $revert .= $this->message['revdel-restore'];
238 $Ids = explode( ',', $paramArray[0] );
239 // Link to each hidden object ID, $paramArray[1] is the url param. List if several...
240 if( count($Ids) == 1 ) {
241 $revert = $this->skin->makeKnownLinkObj( $revdel, $this->message['revdel-restore'],
242 wfArrayToCGI( array('logid' => $Ids[0] ) ) );
243 } else {
244 foreach( $Ids as $n => $id ) {
245 $revert .= $this->skin->makeKnownLinkObj( $revdel, '#'.($n+1),
246 wfArrayToCGI( array('logid' => $id ) ) );
247 }
248 }
249 $revert = "($revert)";
250 } else {
251 wfRunHooks( 'LogLine', array( $row->log_type, $row->log_action, $title, $paramArray,
252 &$comment, &$revert, $row->log_timestamp ) );
253 // wfDebug( "Invoked LogLine hook for " $row->log_type . ", " . $row->log_action . "\n" );
254 // Do nothing. The implementation is handled by the hook modifiying the passed-by-ref parameters.
255 }
256 }
257 // Event description
258 if( self::isDeleted($row,LogPage::DELETED_ACTION) ) {
259 $action = '<span class="history-deleted">' . wfMsgHtml('rev-deleted-event') . '</span>';
260 } else {
261 $action = LogPage::actionText( $row->log_type, $row->log_action, $title, $this->skin, $paramArray, true );
262 }
263
264 global $wgDateGroupedLogs;
265 if ( $wgDateGroupedLogs ) {
266 $time = $wgLang->time( wfTimestamp(TS_MW, $row->log_timestamp), true );
267 $date = $wgLang->date( wfTimestamp(TS_MW, $row->log_timestamp), true );
268 $line = Xml::tags('div', array( 'class' => 'mw-log-entry' ), "$del$time $userLink $action $comment $revert" );
269
270 static $lastdate = false;
271 if ( $date !== $lastdate ) {
272 $lastdate = $date;
273 return Xml::element('h4', null, $date) . "\n" . $line;
274 } else {
275 return $line;
276 }
277 } else {
278 return Xml::tags('li', null, "$del$time $userLink $action $comment $revert" );
279 }
280
281 }
282
283 /**
284 * @param Row $row
285 * @private
286 */
287 private function showhideLinks( $row ) {
288 global $wgAllowLogDeletion;
289
290 if( !$wgAllowLogDeletion )
291 return "";
292
293 $revdel = SpecialPage::getTitleFor( 'Revisiondelete' );
294 // If event was hidden from sysops
295 if( !self::userCan( $row, LogPage::DELETED_RESTRICTED ) ) {
296 $del = $this->message['rev-delundel'];
297 } else if( $row->log_type == 'suppress' ) {
298 // No one should be hiding from the oversight log
299 $del = $this->message['rev-delundel'];
300 } else {
301 $del = $this->skin->makeKnownLinkObj( $revdel, $this->message['rev-delundel'], 'logid='.$row->log_id );
302 // Bolden oversighted content
303 if( self::isDeleted( $row, LogPage::DELETED_RESTRICTED ) )
304 $del = "<strong>$del</strong>";
305 }
306 return "<tt>(<small>$del</small>)</tt>";
307 }
308
309 /**
310 * Determine if the current user is allowed to view a particular
311 * field of this log row, if it's marked as deleted.
312 * @param Row $row
313 * @param int $field
314 * @return bool
315 */
316 public static function userCan( $row, $field ) {
317 if( ( $row->log_deleted & $field ) == $field ) {
318 global $wgUser;
319 $permission = ( $row->log_deleted & LogPage::DELETED_RESTRICTED ) == LogPage::DELETED_RESTRICTED
320 ? 'hiderevision'
321 : 'deleterevision';
322 wfDebug( "Checking for $permission due to $field match on $row->log_deleted\n" );
323 return $wgUser->isAllowed( $permission );
324 } else {
325 return true;
326 }
327 }
328
329 /**
330 * @param Row $row
331 * @param int $field one of DELETED_* bitfield constants
332 * @return bool
333 */
334 public static function isDeleted( $row, $field ) {
335 return ($row->log_deleted & $field) == $field;
336 }
337
338 /**
339 * Quick function to show a short log extract
340 * @param OutputPage $out
341 * @param string $type
342 * @param string $page
343 * @param string $user
344 */
345 public static function showLogExtract( $out, $type='', $page='', $user='' ) {
346 global $wgUser;
347 # Insert list of top 50 or so items
348 $loglist = new LogEventsList( $wgUser->getSkin() );
349 $pager = new LogPager( $loglist, $type, $user, $page, '' );
350 $logBody = $pager->getBody();
351 if( $logBody ) {
352 $out->addHTML(
353 $loglist->beginLogEventsList() .
354 $logBody .
355 $loglist->endLogEventsList()
356 );
357 } else {
358 $out->addWikiMsg( 'logempty' );
359 }
360 }
361
362 /**
363 * SQL clause to skip forbidden log types for this user
364 * @param Database $db
365 * @returns mixed (string or false)
366 */
367 public static function getExcludeClause( $db ) {
368 global $wgLogRestrictions, $wgUser;
369 // Reset the array, clears extra "where" clauses when $par is used
370 $hiddenLogs = array();
371 // Don't show private logs to unprivileged users
372 foreach( $wgLogRestrictions as $logtype => $right ) {
373 if( !$wgUser->isAllowed($right) ) {
374 $safetype = $db->strencode( $logtype );
375 $hiddenLogs[] = $safetype;
376 }
377 }
378 if( count($hiddenLogs) == 1 ) {
379 return 'log_type != ' . $db->addQuotes( $hiddenLogs[0] );
380 } elseif( !empty( $hiddenLogs ) ) {
381 return 'log_type NOT IN (' . $db->makeList($hiddenLogs) . ')';
382 }
383 return false;
384 }
385 }
386
387 /**
388 * @addtogroup Pager
389 */
390 class LogPager extends ReverseChronologicalPager {
391 private $type = '', $user = '', $title = '', $pattern = '';
392 public $mLogEventsList;
393 /**
394 * constructor
395 * @param LogEventsList $loglist,
396 * @param string $type,
397 * @param string $user,
398 * @param string $page,
399 * @param string $pattern
400 * @param array $conds
401 */
402 function __construct( $loglist, $type='', $user='', $title='', $pattern='', $conds = array() ) {
403 parent::__construct();
404 $this->mConds = $conds;
405
406 $this->mLogEventsList = $loglist;
407
408 $this->limitType( $type );
409 $this->limitUser( $user );
410 $this->limitTitle( $title, $pattern );
411 }
412
413 /**
414 * Set the log reader to return only entries of the given type.
415 * Type restrictions enforced here
416 * @param string $type A log type ('upload', 'delete', etc)
417 * @private
418 */
419 private function limitType( $type ) {
420 global $wgLogRestrictions, $wgUser;
421 // Don't even show header for private logs; don't recognize it...
422 if( isset($wgLogRestrictions[$type]) && !$wgUser->isAllowed($wgLogRestrictions[$type]) ) {
423 $type = '';
424 }
425 // Don't show private logs to unpriviledged users
426 $hideLogs = LogEventsList::getExcludeClause( $this->mDb );
427 if( $hideLogs !== false ) {
428 $this->mConds[] = $hideLogs;
429 }
430 if( empty($type) ) {
431 return false;
432 }
433 $this->type = $type;
434 $this->mConds['log_type'] = $type;
435 }
436
437 /**
438 * Set the log reader to return only entries by the given user.
439 * @param string $name (In)valid user name
440 * @private
441 */
442 function limitUser( $name ) {
443 if( $name == '' ) {
444 return false;
445 }
446 $usertitle = Title::makeTitleSafe( NS_USER, $name );
447 if( is_null($usertitle) ) {
448 return false;
449 }
450 $this->user = $usertitle->getText();
451 /* Fetch userid at first, if known, provides awesome query plan afterwards */
452 $userid = User::idFromName( $this->user );
453 if( !$userid ) {
454 /* It should be nicer to abort query at all,
455 but for now it won't pass anywhere behind the optimizer */
456 $this->mConds[] = "NULL";
457 } else {
458 $this->mConds['log_user'] = $userid;
459 }
460 }
461
462 /**
463 * Set the log reader to return only entries affecting the given page.
464 * (For the block and rights logs, this is a user page.)
465 * @param string $page Title name as text
466 * @private
467 */
468 function limitTitle( $page, $pattern ) {
469 global $wgMiserMode;
470
471 $title = Title::newFromText( $page );
472 if( strlen($page) == 0 || !$title instanceof Title )
473 return false;
474
475 $this->title = $title->getPrefixedText();
476 $this->pattern = $pattern;
477 $ns = $title->getNamespace();
478 if( $pattern && !$wgMiserMode ) {
479 # use escapeLike to avoid expensive search patterns like 't%st%'
480 $safetitle = $this->mDb->escapeLike( $title->getDBkey() );
481 $this->mConds['log_namespace'] = $ns;
482 $this->mConds[] = "log_title LIKE '$safetitle%'";
483 } else {
484 $this->mConds['log_namespace'] = $ns;
485 $this->mConds['log_title'] = $title->getDBkey();
486 }
487 }
488
489 function getQueryInfo() {
490 $this->mConds[] = 'user_id = log_user';
491 # Hack this until live
492 global $wgAllowLogDeletion;
493 $log_id = $wgAllowLogDeletion ? 'log_id' : '0 AS log_id';
494 # Don't use the wrong logging index
495 if( $this->title || $this->pattern || $this->user ) {
496 $index = array( 'USE INDEX' => array( 'logging' => array('page_time','user_time') ) );
497 } else if( $this->type ) {
498 $index = array( 'USE INDEX' => array( 'logging' => 'type_time' ) );
499 } else {
500 $index = array( 'USE INDEX' => array( 'logging' => 'times' ) );
501 }
502 return array(
503 'tables' => array( 'logging', 'user' ),
504 'fields' => array( 'log_type', 'log_action', 'log_user', 'log_namespace', 'log_title',
505 'log_params', 'log_comment', $log_id, 'log_deleted', 'log_timestamp', 'user_name' ),
506 'conds' => $this->mConds,
507 'options' => $index
508 );
509 }
510
511 function getIndexField() {
512 return 'log_timestamp';
513 }
514
515 function getStartBody() {
516 wfProfileIn( __METHOD__ );
517 # Do a link batch query
518 $lb = new LinkBatch;
519 while( $row = $this->mResult->fetchObject() ) {
520 $lb->add( $row->log_namespace, $row->log_title );
521 $lb->addObj( Title::makeTitleSafe( NS_USER, $row->user_name ) );
522 $lb->addObj( Title::makeTitleSafe( NS_USER_TALK, $row->user_name ) );
523 }
524 $lb->execute();
525 $this->mResult->seek( 0 );
526 wfProfileOut( __METHOD__ );
527 return '';
528 }
529
530 function formatRow( $row ) {
531 return $this->mLogEventsList->logLine( $row );
532 }
533
534 public function getType() {
535 return $this->type;
536 }
537
538 public function getUser() {
539 return $this->user;
540 }
541
542 public function getPage() {
543 return $this->title;
544 }
545
546 public function getPattern() {
547 return $this->pattern;
548 }
549 }
550
551 /**
552 *
553 * @addtogroup SpecialPage
554 */
555 class LogReader {
556 var $pager;
557 /**
558 * @param WebRequest $request For internal use use a FauxRequest object to pass arbitrary parameters.
559 */
560 function __construct( $request ) {
561 global $wgUser;
562 # Get parameters
563 $type = $request->getVal( 'type' );
564 $user = $request->getText( 'user' );
565 $title = $request->getText( 'page' );
566 $pattern = $request->getBool( 'pattern' );
567
568 $loglist = new LogEventsList( $wgUser->getSkin() );
569 $this->pager = new LogPager( $loglist, $type, $user, $title, $pattern );
570 }
571
572 /**
573 * Is there at least one row?
574 * @return bool
575 */
576 public function hasRows() {
577 return isset($this->pager) ? ($this->pager->getNumRows() > 0) : false;
578 }
579 }
580
581 /**
582 *
583 * @addtogroup SpecialPage
584 */
585 class LogViewer {
586 const NO_ACTION_LINK = 1;
587 /**
588 * @var LogReader $reader
589 */
590 var $reader;
591 /**
592 * @param LogReader &$reader where to get our data from
593 * @param integer $flags Bitwise combination of flags:
594 * LogEventsList::NO_ACTION_LINK Don't show restore/unblock/block links
595 */
596 function __construct( &$reader, $flags = 0 ) {
597 global $wgUser;
598 $this->reader =& $reader;
599 $this->reader->pager->mLogEventsList->flags = $flags;
600 # Aliases for shorter code...
601 $this->pager =& $this->reader->pager;
602 $this->logEventsList =& $this->reader->pager->mLogEventsList;
603 }
604
605 /**
606 * Take over the whole output page in $wgOut with the log display.
607 */
608 public function show() {
609 global $wgOut;
610 # Set title and add header
611 $this->logEventsList->showHeader( $wgOut, $pager->getType() );
612 # Show form options
613 $this->logEventsList->showOptions( $wgOut, $this->pager->getType(), $this->pager->getUser(),
614 $this->pager->getPage(), $this->pager->getPattern() );
615 # Insert list
616 $logBody = $this->pager->getBody();
617 if( $logBody ) {
618 $wgOut->addHTML(
619 $this->pager->getNavigationBar() .
620 $this->logEventsList->beginLogEventsList() .
621 $logBody .
622 $this->logEventsList->endLogEventsList() .
623 $this->pager->getNavigationBar()
624 );
625 } else {
626 $wgOut->addWikiMsg( 'logempty' );
627 }
628 }
629
630 /**
631 * Output just the list of entries given by the linked LogReader,
632 * with extraneous UI elements. Use for displaying log fragments in
633 * another page (eg at Special:Undelete)
634 * @param OutputPage $out where to send output
635 */
636 public function showList( &$out ) {
637 $logBody = $this->pager->getBody();
638 if( $logBody ) {
639 $out->addHTML(
640 $this->logEventsList->beginLogEventsList() .
641 $logBody .
642 $this->logEventsList->endLogEventsList()
643 );
644 } else {
645 $out->addWikiMsg( 'logempty' );
646 }
647 }
648 }
649