<?php
+
/**
* Message and Spam Filter Plugin - Spam Options
*
- * @version $Id$
- * @copyright (c) 1999-2005 The SquirrelMail Project Team
+ * @copyright © 1999-2007 The SquirrelMail Project Team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ * @version $Id$
* @package plugins
* @subpackage filters
*/
/**
- * Path for SquirrelMail required files.
- * @ignore
+ * Include the SquirrelMail initialization file.
*/
-define('SM_PATH','../../');
+require('../../include/init.php');
-/* SquirrelMail required files. */
-require_once(SM_PATH . 'include/validate.php');
-include_once(SM_PATH . 'functions/imap.php');
+include_once(SM_PATH . 'functions/imap_general.php');
+include_once(SM_PATH . 'functions/imap_messages.php');
include_once(SM_PATH . 'plugins/filters/filters.php');
/* get globals */
-sqgetGlobalVar('username', $username, SQ_SESSION);
-sqgetGlobalVar('key', $key, SQ_COOKIE);
-sqgetGlobalVar('onetimepad', $onetimepad, SQ_SESSION);
sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION);
sqgetGlobalVar('action', $action, SQ_GET);
/* end globals */
-displayPageHeader($color, 'None');
+displayPageHeader($color);
if (sqgetGlobalVar('spam_submit',$spam_submit,SQ_POST)) {
$spam_filters = load_spam_filters();
if (isset($action) && $action == 'spam') {
- $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
+ $imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0);
$boxes = sqimap_mailbox_list($imapConnection);
sqimap_logout($imapConnection);
$numboxes = count($boxes);
}
echo '<form method="post" action="spamoptions.php">'.
- '<center>'.
+ '<div style="text-align: center;">'.
html_tag( 'table', '', '', '', 'width="85%" border="0" cellpadding="2" cellspacing="0"' ) .
html_tag( 'tr' ) .
html_tag( 'th', _("Move spam to:"), 'right', '', 'style="white-space: nowrap;"' ) .
html_tag( 'td', '<input type="submit" name="spam_submit" value="' . _("Save") . '" />', 'center', '', 'colspan="2"' )
) . "\n" .
'</table>'.
- '</center>'.
+ '</div>'.
'</form>';
} else {
// action is not set or action is not spam
echo html_tag( 'p', '', 'center' ) .
'[<a href="spamoptions.php?action=spam">' . _("Edit") . '</a>]' .
- ' - [<a href="../../src/options.php">' . _("Done") . '</a>]</center><br /><br />';
+ ' - [<a href="../../src/options.php">' . _("Done") . '</a>]</div><br /><br />';
printf( _("Spam is sent to %s."), ($filters_spam_folder?'<b>'.htmlspecialchars(imap_utf7_decode_local($filters_spam_folder)).'</b>':'[<i>'._("not set yet").'</i>]' ) );
echo '<br />';
printf( _("Spam scan is limited to %s."), '<b>' . ( ($filters_spam_scan == 'new')?_("Unread messages only"):_("All messages") ) . '</b>' );