<?php
+ /**
+ ** setup.php -- SpamCop plugin
+ **
+ ** Copyright (c) 1999-2002 The SquirrelMail development team
+ ** Licensed under the GNU GPL. For full terms see the file COPYING.
+ **
+ ** $Id$
+ **/
+
+require_once(SM_PATH . 'functions/global.php');
/* Initialize the plugin */
global $squirrelmail_plugin_hooks, $data_dir, $username,
$spamcop_is_composing;
- $squirrelmail_plugin_hooks['options_register']['spamcop'] =
+ $squirrelmail_plugin_hooks['optpage_register_block']['spamcop'] =
'spamcop_options';
$squirrelmail_plugin_hooks['loading_prefs']['spamcop'] =
'spamcop_load';
$squirrelmail_plugin_hooks['read_body_header_right']['spamcop'] =
'spamcop_show_link';
+
+ sqextractGlobalVar('spamcop_is_composing');
if (isset($spamcop_is_composing)) {
$squirrelmail_plugin_hooks['compose_send']['spamcop'] =
// Show the link on the read-a-message screen
function spamcop_show_link() {
- global $passed_id, $mailbox, $ent_num, $spamcop_enabled, $startMessage,
- $spamcop_method;
-
- // This was stolen from printer_friendly
- // Do I really need/want it?
- if (!trim($mailbox))
- $mailbox = 'INBOX';
+ global $spamcop_enabled, $spamcop_method;
if (! $spamcop_enabled)
return;
+ /* GLOBALS */
+ $passed_id = $_GET['passed_id'];
+ $mailbox = $_GET['mailbox'];
+ $startMessage = $_GET['startMessage'];
+ /* END GLOBALS */
+
echo "<br>\n";
if ($spamcop_method == 'web_form') {
document.write("<?PHP echo _("Report as Spam"); ?>");
document.write("</a>");
</script><noscript>
-<a href="../plugins/spamcop/spamcop_web.php?passed_id=<?PHP
+<a href="../plugins/spamcop/spamcop.php?passed_id=<?PHP
echo urlencode($passed_id); ?>&mailbox=<?PHP
echo urlencode($mailbox); ?>&startMessage=<?PHP
echo urlencode($startMessage); ?>"><?PHP
echo _("Report as Spam"); ?></a>
</noscript><?PHP
} else {
-?><a href="../plugins/spamcop/spamcop_web.php?passed_id=<?PHP
+?><a href="../plugins/spamcop/spamcop.php?passed_id=<?PHP
echo urlencode($passed_id); ?>&mailbox=<?PHP
echo urlencode($mailbox); ?>&startMessage=<?PHP
echo urlencode($startMessage); ?>"><?PHP
// Show the link to our own custom options page
function spamcop_options()
{
- global $optionpages;
+ global $optpage_blocks;
- $optionpages[] = array(
+ $optpage_blocks[] = array(
'name' => _("SpamCop - Spam Reporting"),
'url' => '../plugins/spamcop/options.php',
'desc' => _("Help fight the battle against unsolicited email. SpamCop reads the spam email and determines the correct addresses to send complaints to. Quite fast, really smart, and easy to use."),