3 * This file processes the messages that were selected
4 * in messagesIndex.php for logged in users.
5 * @author Samuel Tran <stran2005@users.sourceforge.net>
6 * @author Nicolas Peyrussie <peyrouz@users.sourceforge.net>
10 * Copyright (C) 2005 - 2007 MailZu
11 * License: GPL, see LICENSE
14 * Include Template class
16 include_once('lib/Template.class.php');
18 * Include Quarantine functions
20 include_once('lib/Quarantine.lib.php');
22 * Include common output functions
24 include_once('templates/common.template.php');
26 * Include quarantine-specific output functions
28 include_once('templates/quarantine.template.php');
30 if (!Auth
::is_logged_in()) {
31 Auth
::print_login_msg(); // Check if user is logged in
34 //Turn off all error reporting, useless for users
39 $t = new Template(translate('Message Processing'));
41 $t->printHTMLHeader();
45 // Break table into 2 columns, put quick links on left side and all other tables on the right
47 showQuickLinks(); // Print out My Quick Links
48 startDataDisplayCol();
50 $action = CmnFns
::get_action();
51 $content_type = CmnFns
::get_ctype();
52 $query_string = CmnFns
::get_query_string();
53 $mail_id_array = CmnFns
::getGlobalVar('mail_id_array', POST
);
55 switch ( $_SESSION['sessionNav'] ) {
57 $referral = 'messagesIndex.php';
59 case 'Site Quarantine':
60 $referral = 'messagesAdmin.php';
62 case 'My Pending Requests':
63 $referral = 'messagesPending.php';
65 case 'Site Pending Requests':
66 $referral = 'messagesPending.php';
70 // If no message was selected and the action is not "Delete All"
71 if ( ! isset($mail_id_array) && $action != translate('Delete All') )
75 elseif ( isset( $action ) ) {
78 case translate('Release'):
79 case translate('Release/Request release'):
80 $failed_array = releaseMessages($_SESSION['sessionMail'], $mail_id_array);
81 if ( is_array($failed_array) && !empty($failed_array) ) {
82 showFailedMessagesTable($action, $content_type, $failed_array);
84 printReportButtons($query_string, $failed_array, $action);
86 CmnFns
::redirect_js($referral . '?' . $query_string);
89 case translate('Cancel Request'):
90 $failed_array = updateMessages('', $content_type, $_SESSION['sessionMail'], $mail_id_array);
91 if ( is_array($failed_array) && !empty($failed_array) ) {
92 showFailedMessagesTable($action, $content_type, $failed_array);
94 printReportButtons($query_string, $failed_array, $action);
96 CmnFns
::redirect_js($referral . '?' . $query_string);
99 case translate('Delete'):
100 $failed_array = updateMessages('D', $content_type, $_SESSION['sessionMail'], $mail_id_array);
101 if ( is_array($failed_array) && !empty($failed_array) ) {
102 showFailedMessagesTable($action, $content_type, $failed_array);
104 printReportButtons($query_string, $failed_array, $action);
106 CmnFns
::redirect_js($referral . '?' . $query_string);
109 case translate('Delete All'):
110 $failed_array = updateMessages('D', $content_type, $_SESSION['sessionMail'], '', true);
111 if ( is_array($failed_array) && !empty($failed_array) ) {
112 showFailedMessagesTable($action, $content_type, $failed_array);
114 printReportButtons($query_string, $failed_array, $action);
116 CmnFns
::redirect_js($referral . '?' . $query_string);
120 CmnFns
::do_error_box(translate('Unknown action type'), '', false);
127 $t->printHTMLFooter();