2008-12-10 14:33:43 +01:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* This file processes the messages that were selected
|
|
|
|
* in messagesIndex.php for logged in users.
|
|
|
|
* @author Samuel Tran <stran2005@users.sourceforge.net>
|
|
|
|
* @author Nicolas Peyrussie <peyrouz@users.sourceforge.net>
|
|
|
|
* @version 04-03-07
|
|
|
|
* @package MailZu
|
|
|
|
*
|
|
|
|
* Copyright (C) 2005 - 2007 MailZu
|
|
|
|
* License: GPL, see LICENSE
|
|
|
|
*/
|
|
|
|
/**
|
|
|
|
* Include Template class
|
|
|
|
*/
|
2008-12-10 19:19:59 +01:00
|
|
|
|
2008-12-10 14:33:43 +01:00
|
|
|
include_once('lib/Template.class.php');
|
|
|
|
/**
|
|
|
|
* Include Quarantine functions
|
|
|
|
*/
|
|
|
|
include_once('lib/Quarantine.lib.php');
|
|
|
|
/**
|
|
|
|
* Include common output functions
|
|
|
|
*/
|
|
|
|
include_once('templates/common.template.php');
|
|
|
|
/**
|
|
|
|
* Include quarantine-specific output functions
|
|
|
|
*/
|
|
|
|
include_once('templates/quarantine.template.php');
|
|
|
|
|
|
|
|
if (!Auth::is_logged_in()) {
|
|
|
|
Auth::print_login_msg(); // Check if user is logged in
|
|
|
|
}
|
|
|
|
|
|
|
|
//Turn off all error reporting, useless for users
|
|
|
|
error_reporting(0);
|
|
|
|
|
|
|
|
$db = new DBEngine();
|
|
|
|
$t = new Template(translate('Message Processing'));
|
|
|
|
|
|
|
|
$t->printHTMLHeader();
|
|
|
|
$t->printWelcome();
|
|
|
|
$t->startMain();
|
|
|
|
// Break table into 2 columns, put quick links on left side and all other tables on the right
|
|
|
|
startQuickLinksCol();
|
|
|
|
showQuickLinks(); // Print out My Quick Links
|
|
|
|
startDataDisplayCol();
|
2008-12-10 19:19:59 +01:00
|
|
|
global $conf;
|
2008-12-10 14:33:43 +01:00
|
|
|
|
|
|
|
$action = CmnFns::get_action();
|
2008-12-10 19:19:59 +01:00
|
|
|
$w_action = CmnFns::get_wb_action('w_action');
|
|
|
|
$b_action = CmnFns::get_wb_action('b_action');
|
2008-12-10 14:33:43 +01:00
|
|
|
$content_type = CmnFns::get_ctype();
|
|
|
|
$query_string = CmnFns::get_query_string();
|
|
|
|
$mail_id_array = CmnFns::getGlobalVar('mail_id_array', POST);
|
|
|
|
|
2008-12-10 16:41:16 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
echo "<pre>";
|
|
|
|
print_r($mail_id_array);
|
|
|
|
echo "</pre>";
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2008-12-10 14:33:43 +01:00
|
|
|
switch ( $_SESSION['sessionNav'] ) {
|
|
|
|
case 'My Quarantine':
|
|
|
|
$referral = 'messagesIndex.php';
|
|
|
|
break;
|
2008-12-10 16:41:16 +01:00
|
|
|
case 'Domain Quarantine':
|
|
|
|
$referral = 'domainAdmin.php';
|
|
|
|
break;
|
2008-12-10 14:33:43 +01:00
|
|
|
case 'Site Quarantine':
|
|
|
|
$referral = 'messagesAdmin.php';
|
|
|
|
break;
|
|
|
|
case 'My Pending Requests':
|
|
|
|
$referral = 'messagesPending.php';
|
|
|
|
break;
|
2008-12-10 16:41:16 +01:00
|
|
|
case 'Domain Pending Requests':
|
|
|
|
$referral = 'domainPendingAdmin.php';
|
|
|
|
break;
|
2008-12-10 14:33:43 +01:00
|
|
|
case 'Site Pending Requests':
|
|
|
|
$referral = 'messagesPending.php';
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
// If no message was selected and the action is not "Delete All"
|
2008-12-10 16:41:16 +01:00
|
|
|
if ( ! isset($mail_id_array) && $action != translate('Delete All') )
|
|
|
|
|
2008-12-10 14:33:43 +01:00
|
|
|
printNoMesgWarning();
|
|
|
|
|
|
|
|
elseif ( isset( $action ) ) {
|
|
|
|
switch ( $action ) {
|
2008-12-10 21:27:57 +01:00
|
|
|
case translate('Whitelist'):
|
|
|
|
updateWblist('W', $_SESSION['sessionMail'], $mail_id_array, $action);
|
2008-12-10 14:33:43 +01:00
|
|
|
case translate('Release'):
|
|
|
|
case translate('Release/Request release'):
|
2008-12-10 21:27:57 +01:00
|
|
|
if ($w_action != "" && $action != translate('Whitelist') ) {
|
2008-12-10 19:19:59 +01:00
|
|
|
updateWblist('W', $_SESSION['sessionMail'], $mail_id_array, $w_action);
|
|
|
|
}
|
2008-12-10 14:33:43 +01:00
|
|
|
$failed_array = releaseMessages($_SESSION['sessionMail'], $mail_id_array);
|
|
|
|
if ( is_array($failed_array) && !empty($failed_array) ) {
|
|
|
|
showFailedMessagesTable($action, $content_type, $failed_array);
|
|
|
|
printCpanelBr();
|
|
|
|
printReportButtons($query_string, $failed_array, $action);
|
|
|
|
} else {
|
|
|
|
CmnFns::redirect_js($referral . '?' . $query_string);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case translate('Cancel Request'):
|
|
|
|
$failed_array = updateMessages('', $content_type, $_SESSION['sessionMail'], $mail_id_array);
|
|
|
|
if ( is_array($failed_array) && !empty($failed_array) ) {
|
|
|
|
showFailedMessagesTable($action, $content_type, $failed_array);
|
|
|
|
printCpanelBr();
|
|
|
|
printReportButtons($query_string, $failed_array, $action);
|
|
|
|
} else {
|
|
|
|
CmnFns::redirect_js($referral . '?' . $query_string);
|
|
|
|
}
|
|
|
|
break;
|
2008-12-10 19:19:59 +01:00
|
|
|
|
2008-12-10 21:27:57 +01:00
|
|
|
case translate('Blacklist'):
|
|
|
|
updateWblist('B', $_SESSION['sessionMail'], $mail_id_array, $action);
|
2008-12-10 14:33:43 +01:00
|
|
|
case translate('Delete'):
|
2008-12-10 21:27:57 +01:00
|
|
|
if ($b_action != "" && $action != translate('Blacklist') ) {
|
2008-12-10 19:19:59 +01:00
|
|
|
updateWblist('B', $_SESSION['sessionMail'], $mail_id_array, $b_action);
|
|
|
|
}
|
2008-12-10 14:33:43 +01:00
|
|
|
$failed_array = updateMessages('D', $content_type, $_SESSION['sessionMail'], $mail_id_array);
|
|
|
|
if ( is_array($failed_array) && !empty($failed_array) ) {
|
|
|
|
showFailedMessagesTable($action, $content_type, $failed_array);
|
|
|
|
printCpanelBr();
|
|
|
|
printReportButtons($query_string, $failed_array, $action);
|
|
|
|
} else {
|
|
|
|
CmnFns::redirect_js($referral . '?' . $query_string);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case translate('Delete All'):
|
|
|
|
$failed_array = updateMessages('D', $content_type, $_SESSION['sessionMail'], '', true);
|
|
|
|
if ( is_array($failed_array) && !empty($failed_array) ) {
|
|
|
|
showFailedMessagesTable($action, $content_type, $failed_array);
|
|
|
|
printCpanelBr();
|
|
|
|
printReportButtons($query_string, $failed_array, $action);
|
|
|
|
} else {
|
|
|
|
CmnFns::redirect_js($referral . '?' . $query_string);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
CmnFns::do_error_box(translate('Unknown action type'), '', false);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
endDataDisplayCol();
|
|
|
|
$t->endMain();
|
|
|
|
$t->printHTMLFooter();
|
|
|
|
?>
|