<?php
+
/**
* Message and Spam Filter Plugin - Filtering 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','../../');
-
-/* SquirrelMail required files. */
-require_once(SM_PATH . 'include/validate.php');
-include_once(SM_PATH . 'functions/imap.php');
+require('../../include/init.php');
+include_once(SM_PATH . 'functions/imap_general.php');
+include_once(SM_PATH . 'functions/forms.php');
include_once(SM_PATH . 'plugins/filters/filters.php');
-displayPageHeader($color, 'None');
+displayPageHeader($color);
/* get globals */
-sqgetGlobalVar('username', $username, SQ_SESSION);
-sqgetGlobalVar('key', $key, SQ_COOKIE);
-sqgetGlobalVar('onetimepad', $onetimepad, SQ_SESSION);
sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION);
sqgetGlobalVar('theid', $theid);
} elseif (sqgetGlobalVar('user_submit',$user_submit,SQ_POST)) {
sqgetGlobalVar('filters_user_scan_set',$filters_user_scan_set,SQ_POST);
setPref($data_dir, $username, 'filters_user_scan', $filters_user_scan_set);
- echo '<br /><center><b>'._("Saved Scan type")."</b></center>\n";
+ echo '<br /><div style="text-align: center;"><b>'._("Saved Scan type")."</b></div>\n";
}
$filters = load_filters();
echo html_tag( 'table',
html_tag( 'tr',
html_tag( 'td',
- '<center><b>' . _("Options") . ' - ' . _("Message Filtering") . '</b></center>' ,
+ '<div style="text-align: center;"><b>' . _("Options") . ' - ' . _("Message Filtering") . '</b></div>' ,
'left', $color[0]
)
),
'center', '', 'width="95%" border="0" cellpadding="2" cellspacing="0"'
) .
'<br /><form method="post" action="options.php">'.
- '<center>'.
- html_tag( 'table', '', '', '', 'border="0" cellpadding="2" cellspacing="0"' ) .
+ html_tag( 'table', '', 'center', '', 'border="0" cellpadding="2" cellspacing="0"' ) .
html_tag( 'tr' ) .
html_tag( 'th', _("What to Scan:"), 'right', '', 'style="white-space: nowrap;"' ) .
html_tag( 'td', '', 'left' ) .
'</td>'.
html_tag( 'td', '<input type="submit" name="user_submit" value="' . _("Save") . '" />', 'left' ) .
'</table>'.
- '</center>'.
'</form>'.
html_tag( 'div', '[<a href="options.php?action=add">' . _("New") .
if (isset($action) && ($action == 'add' || $action == 'edit')) {
- $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
+ $imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0);
$boxes = sqimap_mailbox_list($imapConnection);
for ($a = 0, $cnt = count($boxes); $a < $cnt; $a++) {
html_tag( 'td', '', 'left' ) .
'<input type="text" size="32" name="filter_what" value="';
if (isset($filters[$theid]['what'])) {
- echo $filters[$theid]['what'];
+ echo htmlspecialchars($filters[$theid]['what']);
}
echo '" />'.
'</td>'.
if ( isset($filters[$theid]['folder']) )
$selected = array(strtolower($filters[$theid]['folder']));
echo sqimap_mailbox_option_list(0, $selected, 0, $boxes);
- echo '</tt>'.
- '</select>'.
+ echo '</select>'.
+ '</tt>'.
'</td>'.
'</tr>'.
'</table>'.
}
+if (count($filters)) {
echo html_tag( 'table', '', 'center', '', 'border="0" cellpadding="3" cellspacing="0"' );
for ($i=0, $num = count($filters); $i < $num; $i++) {
printf( _("If %s contains %s then move to %s"),
'<b>'.$filters[$i]['where'].'</b>',
'<b>'.$filters[$i]['what'].'</b>',
- '<b>'.imap_utf7_decode_local($fdr).'</b>');
+ '<b>'.htmlspecialchars(imap_utf7_decode_local($fdr)).'</b>');
echo '</td></tr>';
}
- echo '</table>'.
- html_tag( 'table',
+ echo '</table>';
+}
+ echo html_tag( 'table',
html_tag( 'tr',
html_tag( 'td', ' ', 'left' )
) ,
'center', '', 'width="80%" border="0" cellpadding="2" cellspacing="0"' );
echo '</body></html>';
-?>
\ No newline at end of file