Missing files
This commit is contained in:
parent
ce31942198
commit
8f677cca9d
102
rulesAdmin.php
Normal file
102
rulesAdmin.php
Normal file
@ -0,0 +1,102 @@
|
||||
<?php
|
||||
/**
|
||||
* This file is the messages index in quarantine for logged in users.
|
||||
* It provides a listing of all messages corresponding to:
|
||||
* - attachment ('B')
|
||||
* - spam ('S')
|
||||
* @author Samuel Tran
|
||||
* @author Jeremy Fowler <jfowler06@users.sourceforge.net>
|
||||
* @version 04-03-07
|
||||
* @package MailZu
|
||||
*
|
||||
* Copyright (C) 2005 - 2007 MailZu
|
||||
* License: GPL, see LICENSE
|
||||
*/
|
||||
/**
|
||||
* Include Template class
|
||||
*/
|
||||
include_once('lib/Template.class.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
|
||||
}
|
||||
|
||||
// grab the display size limit set in config.php
|
||||
$sizeLimit = isset ( $conf['app']['displaySizeLimit'] ) && is_numeric( $conf['app']['displaySizeLimit'] ) ?
|
||||
$conf['app']['displaySizeLimit'] : 50;
|
||||
|
||||
|
||||
// This is not needed?
|
||||
// Get content type
|
||||
$content_type = (CmnFns::get_ctype() ? CmnFns::get_ctype() : 'A');
|
||||
|
||||
|
||||
|
||||
$order = array('sender', 'recipient', 'rule');
|
||||
// Get current page number
|
||||
$requestedPage = CmnFns::getGlobalVar('page', GET);
|
||||
|
||||
$_SESSION['sessionNav'] = "Site Rules";
|
||||
$t = new Template(translate('Site Rules'));
|
||||
|
||||
$db = new DBEngine();
|
||||
|
||||
$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();
|
||||
|
||||
if (! Auth::isMailAdmin()) {
|
||||
CmnFns::do_error_box(translate('Access Denied'));
|
||||
|
||||
} else {
|
||||
// Draw search engine
|
||||
printRulesSearchEngine($content_type, $_SERVER['PHP_SELF'], 1);
|
||||
echo '<br>';
|
||||
|
||||
if ( CmnFns::getGlobalVar('search_action', GET) == translate('Clear search results') ) {
|
||||
CmnFns::redirect_js($_SERVER['PHP_SELF'] . '?searchOnly=' . $conf['app']['searchOnly']);
|
||||
}
|
||||
|
||||
|
||||
$search_array1 = $db->convertSearch2SQL( 'mailaddr.email', CmnFns::getGlobalVar('f_criterion', GET), CmnFns::getGlobalVar('f_string', GET) );
|
||||
$search_array2 = $db->convertSearch2SQL( 'recip.email', CmnFns::getGlobalVar('t_criterion', GET), CmnFns::getGlobalVar('t_string', GET) );
|
||||
$search_array = array_merge( $search_array1, $search_array2 );
|
||||
|
||||
// Print a loading message until database returns...
|
||||
printMessage(translate('Retrieving Messages...'));
|
||||
|
||||
$list_items = $db->get_user_control_list( $_SESSION['sessionMail'], CmnFns::get_value_order($order), CmnFns::get_vert_order(), $search_array, $requestedPage, 1);
|
||||
|
||||
// Compute maximum number of pages
|
||||
$maxPage = (ceil($db->numRows/$sizeLimit)-1);
|
||||
|
||||
// If $requestedPage > $maxPage, then redirect to $maxPage instead of $requestedPage
|
||||
if ( $requestedPage > $maxPage ) {
|
||||
$query_string = CmnFns::array_to_query_string( $_GET, array( 'page' ) );
|
||||
$query_string = str_replace ( '&', '&', $query_string );
|
||||
CmnFns::redirect_js($_SERVER['PHP_SELF'].'?'.$query_string.'&page='.$maxPage);
|
||||
}
|
||||
|
||||
showRulesTable($list_items, $requestedPage, CmnFns::get_value_order($order), CmnFns::get_vert_order(), $db->numRows);
|
||||
|
||||
|
||||
// Hide the message after the table loads.
|
||||
hideMessage(translate('Retrieving Messages...'));
|
||||
}
|
||||
endDataDisplayCol();
|
||||
$t->endMain();
|
||||
$t->printHTMLFooter();
|
||||
?>
|
110
rulesIndex.php
Normal file
110
rulesIndex.php
Normal file
@ -0,0 +1,110 @@
|
||||
<?php
|
||||
/**
|
||||
* This file is the messages index in quarantine for logged in users.
|
||||
* It provides a listing of all messages corresponding to:
|
||||
* - attachment ('B')
|
||||
* - spam ('S')
|
||||
* @author Samuel Tran
|
||||
* @author Jeremy Fowler <jfowler06@users.sourceforge.net>
|
||||
* @version 04-03-07
|
||||
* @package MailZu
|
||||
*
|
||||
* Copyright (C) 2005 - 2007 MailZu
|
||||
* License: GPL, see LICENSE
|
||||
*/
|
||||
/**
|
||||
* Include Template class
|
||||
*/
|
||||
include_once('lib/Template.class.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
|
||||
}
|
||||
|
||||
// grab the display size limit set in config.php
|
||||
$sizeLimit = isset ( $conf['app']['displaySizeLimit'] ) && is_numeric( $conf['app']['displaySizeLimit'] ) ?
|
||||
$conf['app']['displaySizeLimit'] : 50;
|
||||
|
||||
|
||||
// This is not needed?
|
||||
// Get content type
|
||||
$content_type = (CmnFns::get_ctype() ? CmnFns::get_ctype() : 'A');
|
||||
|
||||
|
||||
|
||||
$order = array('sender', 'recipient', 'rule');
|
||||
// Get current page number
|
||||
$requestedPage = CmnFns::getGlobalVar('page', GET);
|
||||
|
||||
$_SESSION['sessionNav'] = "My rules";
|
||||
$t = new Template(translate('My rules'));
|
||||
|
||||
$db = new DBEngine();
|
||||
|
||||
$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();
|
||||
|
||||
|
||||
|
||||
// Draw search engine
|
||||
printRulesSearchEngine($content_type, $_SERVER['PHP_SELF'], (count($_SESSION['sessionMail']) > 1));
|
||||
echo '<br>';
|
||||
|
||||
|
||||
if ( CmnFns::getGlobalVar('search_action', GET) == translate('Clear search results') ) CmnFns::redirect_js($_SERVER['PHP_SELF']);
|
||||
|
||||
$search_array1 = $db->convertSearch2SQL( 'mailaddr.email', CmnFns::getGlobalVar('f_criterion', GET), CmnFns::getGlobalVar('f_string', GET) );
|
||||
$search_array2 = $db->convertSearch2SQL( 'recip.email', CmnFns::getGlobalVar('t_criterion', GET), CmnFns::getGlobalVar('t_string', GET) );
|
||||
$search_array = array_merge( $search_array1, $search_array2 );
|
||||
|
||||
// Print a loading message until database returns...
|
||||
printMessage(translate('Retrieving Messages...'));
|
||||
|
||||
|
||||
|
||||
/*
|
||||
$messages = $db->get_user_messages($content_type, $_SESSION['sessionMail'], CmnFns::get_value_order($order), CmnFns::get_vert_order(), $search_array, 0, 0, $requestedPage);
|
||||
*/
|
||||
$list_items = $db->get_user_control_list( $_SESSION['sessionMail'], CmnFns::get_value_order($order), CmnFns::get_vert_order(), $search_array, $requestedPage, 0);
|
||||
|
||||
// Compute maximum number of pages
|
||||
$maxPage = (ceil($db->numRows/$sizeLimit)-1);
|
||||
|
||||
// If $requestedPage > $maxPage, then redirect to $maxPage instead of $requestedPage
|
||||
if ( $requestedPage > $maxPage ) {
|
||||
$query_string = CmnFns::array_to_query_string( $_GET, array( 'page' ) );
|
||||
$query_string = str_replace ( '&', '&', $query_string );
|
||||
CmnFns::redirect_js($_SERVER['PHP_SELF'].'?'.$query_string.'&page='.$maxPage);
|
||||
}
|
||||
/*
|
||||
showMessagesTable( $content_type, $messages, $requestedPage, CmnFns::get_value_order($order), CmnFns::get_vert_order(), $db->numRows );
|
||||
|
||||
|
||||
*/
|
||||
|
||||
showRulesTable($list_items, $requestedPage, CmnFns::get_value_order($order), CmnFns::get_vert_order(), $db->numRows);
|
||||
|
||||
|
||||
|
||||
|
||||
// Hide the message after the table loads.
|
||||
hideMessage(translate('Retrieving Messages...'));
|
||||
|
||||
endDataDisplayCol();
|
||||
$t->endMain();
|
||||
$t->printHTMLFooter();
|
||||
?>
|
86
rulesProcessing.php
Normal file
86
rulesProcessing.php
Normal file
@ -0,0 +1,86 @@
|
||||
<?php
|
||||
/**
|
||||
* This file processes the rules that were selected
|
||||
* in rulesIndex.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
|
||||
*/
|
||||
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('Rules 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();
|
||||
global $conf;
|
||||
$action = CmnFns::get_action();
|
||||
$content_type = CmnFns::get_ctype();
|
||||
$query_string = CmnFns::get_query_string();
|
||||
$wblist_rule_array = CmnFns::getGlobalVar('wblist_rule_array', POST);
|
||||
|
||||
switch ( $_SESSION['sessionNav'] ) {
|
||||
case 'My rules':
|
||||
$referral = 'rulesIndex.php';
|
||||
break;
|
||||
case 'Site Rules':
|
||||
$referral = 'rulesAdmin.php';
|
||||
break;
|
||||
}
|
||||
|
||||
// If no message was selected and the action is not "Delete All"
|
||||
if ( ! isset($wblist_rule_array))
|
||||
printNoMesgWarning();
|
||||
|
||||
elseif ( isset( $action ) ) {
|
||||
|
||||
switch ( $action ) {
|
||||
case translate('Delete'):
|
||||
foreach ($wblist_rule_array AS $row) {
|
||||
list( $from, $to, $rule ) = explode( "_", $row );
|
||||
$db->wbdelete($rule,$to,$from);
|
||||
}
|
||||
CmnFns::redirect_js($referral . '?' . $query_string);
|
||||
break;
|
||||
default:
|
||||
CmnFns::do_error_box(translate('Unknown action type'), '', false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
endDataDisplayCol();
|
||||
$t->endMain();
|
||||
$t->printHTMLFooter();
|
||||
?>
|
Loading…
Reference in New Issue
Block a user