* @author Brian Wong * @author Nicolas Peyrussie * @author Jeremy Fowler * @version 04-03-2007 * @package Templates * * Copyright (C) 2005 - 2007 MailZu * License: GPL, see LICENSE */ /** * Print table listing messages in quarantine * This function prints a table of all spam/attachment in quarantine * for the current user. It also * provides a way for them to release and delete * their messages * @param string $content_type 'B', 'S', ... * @param mixed $res array of message data * @param integer $page current page number * @param string $order previous order field * @param string $vert previous vertical order * @param string $numRows total number of rows in table */ function showMessagesTable($content_type, $res, $page, $order, $vert, $numRows = 0) { global $link; global $conf; // grab the display size limit set in config.php $sizeLimit = isset ( $conf['app']['displaySizeLimit'] ) && is_numeric( $conf['app']['displaySizeLimit'] ) ? $conf['app']['displaySizeLimit'] : 50; if ('ASC' == $vert) { $new_vert = 'DESC'; $mouseover_text = translate('Sort by descending order'); } else { $new_vert='ASC'; $mouseover_text = translate('Sort by ascending order'); } // If there are messages in quarantine, draw tables if ( $res ) { // $res is only a subset of the message quarantine // Its number of rows is $sizeLimit $count = $numRows; $start_entry = 0; $end_entry = count($res); $query_string = $_SERVER['QUERY_STRING']; $pager_html = ( $count > $sizeLimit ) ? CmnFns::genMultiPagesLinks( $page, $sizeLimit, $count) : ''; ?>
doLink('javascript: help(\'msg_index\');', '?', '', 'color: #FFFFFF;', translate('Help') . ' - ' . translate('My Quarantine')) ?>
1) || ((Auth::isMailAdmin() || Auth::isDomainAdmin()) && ("Site Quarantine" == $_SESSION['sessionNav'] || "Site Pending Requests" == $_SESSION['sessionNav']) || ("Domain Quarantine" == $_SESSION['sessionNav'] || "Domain Pending Requests" == $_SESSION['sessionNav']) )) { ?> 1) || ((Auth::isMailAdmin() || Auth::isDomainAdmin()) && ( ("Site Quarantine" == $_SESSION['sessionNav'] || "Site Pending Requests" == $_SESSION['sessionNav']) || ("Domain Quarantine" == $_SESSION['sessionNav'] || "Domain Pending Requests" == $_SESSION['sessionNav'])))) { $to = $rs['email'] ? htmlspecialchars($rs['email']) : '(none)'; } $class = ( $rs['content'] == 'V' ? 'cellVirus' : 'cellColor') . ($i%2); echo ""; echo ' '; if ( (count($_SESSION['sessionMail']) > 1) || ((Auth::isMailAdmin() || Auth::isDomainAdmin()) && ( ("Site Quarantine" == $_SESSION['sessionNav'] || "Site Pending Requests" == $_SESSION['sessionNav'])) || ("Domain Quarantine" == $_SESSION['sessionNav'] || "Domain Pending Requests" == $_SESSION['sessionNav']) ) ) { echo ' '; } echo ' '; echo ' '; echo ' '; echo ' '; switch ($rs['content']) { case 'S': $type = translate('Spam'); break; case 'B': $type = translate('Banned'); break; case 'V': $type = translate('Virus'); break; case 'H': $type = translate('Bad Header'); break; } echo ( $rs['content'] == 'V' ? ''; if ( Auth::isMailAdmin() && ("Site Quarantine" == $_SESSION['sessionNav'] || "Site Pending Requests" == $_SESSION['sessionNav']) ) { echo ' '; } echo "\n"; } ?>
  > doLink($_SERVER['PHP_SELF'] . '?' . CmnFns::querystring_exclude_vars( array('order','vert')) . '&order=recip.email&vert=' . $new_vert, translate('To'), '', '', $mouseover_text) ?> > doLink($_SERVER['PHP_SELF'] . '?' . CmnFns::querystring_exclude_vars( array('order','vert')) . '&order=from_addr&vert=' . $new_vert, translate('From'), '', '', $mouseover_text) ?> > doLink($_SERVER['PHP_SELF'] . '?' . CmnFns::querystring_exclude_vars( array('order','vert')) . '&order=msgs.subject&vert=' . $new_vert, translate('Subject'), '', '', $mouseover_text) ?> > doLink($_SERVER['PHP_SELF'] . '?' . CmnFns::querystring_exclude_vars( array('order','vert')) . '&order=msgs.time_num&vert=' . $new_vert, translate('Date'), '', '', $mouseover_text) ?> > doLink($_SERVER['PHP_SELF'] . '?' . CmnFns::querystring_exclude_vars( array('order','vert')) . '&order=spam_level&vert=' . $new_vert, translate('Score'), '', '', $mouseover_text) ?> > doLink($_SERVER['PHP_SELF'] . '?' . CmnFns::querystring_exclude_vars( array('order','vert')) . '&order=msgs.content&vert=' . $new_vert, translate('Content Type'), '', '', $mouseover_text) ?> > doLink($_SERVER['PHP_SELF'] . '?' . CmnFns::querystring_exclude_vars( array('order','vert')) . '&order=mail_id&vert=' . $new_vert, translate('Mail ID'), '', '', $mouseover_text) ?>
' . $to . '' . $from . '' . // Only allow link to view mail if the mail is stored in SQL ($rs['quar_type'] == 'Q' ? $link->getLink('read_mail.php' . '?mail_id=' . urlencode($rs['mail_id']) . "&recip_email=" . urlencode($rs['email']) . "&$query_string", $subject, '', '', translate('View this message'), ($rs['rs']=='v' || $rs['rs']=='p' ? false : true)) : "$subject") . '' . CmnFns::formatDateTime($rs['time_num']) . '' . ( $rs['content'] == 'S' ? $rs['spam_level'] : 'N/A') . '' : '') . $type . '' . $rs['mail_id'] . '
'; echo '' . translate('There are no matching records.') . ''; echo ''; } } /** * Print White/Black Listing rules table * $param $list */ function showRulesTable($list, $page = 0, $order = "sender", $vert = "ASC", $numRows = 0) { global $conf; global $link; // grab the display size limit set in config.php $sizeLimit = isset ( $conf['app']['displaySizeLimit'] ) && is_numeric( $conf['app']['displaySizeLimit'] ) ? $conf['app']['displaySizeLimit'] : 50; if ('ASC' == $vert) { $new_vert = 'DESC'; $mouseover_text = translate('Sort by descending order'); } else { $new_vert='ASC'; $mouseover_text = translate('Sort by ascending order'); } if ( is_array($list) ) { $count = $numRows; $start_entry = 0; $end_entry = count($list); $query_string = $_SERVER['QUERY_STRING']; $pager_html = ( $count > $sizeLimit ) ? CmnFns::genMultiPagesLinks( $page, $sizeLimit, $count) : ''; echo '
'; echo ''; echo ''; // Draw 'Release', 'Delete' and 'Delete All' buttons //printActionButtons((! CmnFns::didSearch() && ! ("Site Quarantine" == $_SESSION['sessionNav'])) ); // printControlButtons(); // Draw 'Select All, Clear All' and multi pages links printSelectAndPager($pager_html); flush(); echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
' .translate('Showing rules', array( number_format($page*$sizeLimit+1), number_format($page*$sizeLimit+$end_entry), $count )); echo ''; echo '
'; echo '
'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; for ($i = $start_entry; $i < $end_entry; $i++) { $row = $list[$i]; $class = 'cellColor' . ($i%2); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; } echo '
#'; $link->doLink($_SERVER['PHP_SELF'] . '?' . CmnFns::querystring_exclude_vars( array('order','vert')) . '&order=sender&vert=' . $new_vert, translate('From'), '', '', $mouseover_text); echo ''; $link->doLink($_SERVER['PHP_SELF'] . '?' . CmnFns::querystring_exclude_vars( array('order','vert')) . '&order=recipient&vert=' . $new_vert, translate('To'), '', '', $mouseover_text); echo ''; $link->doLink($_SERVER['PHP_SELF'] . '?' . CmnFns::querystring_exclude_vars( array('order','vert')) . '&order=rule&vert=' . $new_vert, translate('Rule'), '', '', $mouseover_text); echo '
'.$row['sender'].''.$row['recipient'].''.($row['rule'] == "W" ? "Whitelisted" : "Blacklisted").'
'; echo '
'.printControlButtons().'
'; echo '
'; } } /** * Print Search Engine * $param $content_type */ function printSearchEngine($content_type, $submit_page, $full_search = false) { global $link; ?>
doLink('javascript: help(\'search\');', '?', '', 'color: #FFFFFF;', translate('Help') . ' - ' . translate('My Re servations')) ?>
 | 

doLink('javascript: history.back();','‹‹ ' . translate('BackMessageIndex'), '', '', translate('BackMessageIndex')); ?>
doLink('javascript: help(\'msg_index\');', '?', '', 'color: #FFFFFF;', translate('Help') ) ?>
" . ' ' . ' ' . ' '; if ( 'S' == $content_type ) echo ' '; echo ' '; echo "\n"; } ?>
' . $rs['from_addr'] . '' . $subject . '' . CmnFns::formatDateTime($rs['time_num']) . '' . $rs['spam_level'] . '' . $rs['status'] . '
doLink('javascript: help(\'search\');', '?', '', 'color: #FFFFFF;', translate('Help') . ' - ' . translate('My Re servations')) ?>