delete_move_next uses GET and POST requests
[squirrelmail.git] / plugins / spamcop / setup.php
index d8779afcb07977efb33cc17e442d4f5b0e219084..34cf415b72a569b1aad1d602411d7be94b671459 100755 (executable)
@@ -2,16 +2,19 @@
    /** 
     **  setup.php -- SpamCop plugin           
     **
-    **  Copyright (c) 1999-2002 The SquirrelMail development team
+    **  Copyright (c) 1999-2003 The SquirrelMail development team
     **  Licensed under the GNU GPL. For full terms see the file COPYING.
     **  
-    **  $Id$                                                         
+    **  $Id$
+    * @package plugins
+    * @subpackage spamcop
     **/
 
+/** @ignore */
 require_once(SM_PATH . 'functions/global.php');
 
 
-/* Initialize the plugin */
+/** Initialize the plugin */
 function squirrelmail_plugin_init_spamcop() {
    global $squirrelmail_plugin_hooks, $data_dir, $username,
       $spamcop_is_composing;
@@ -23,7 +26,7 @@ function squirrelmail_plugin_init_spamcop() {
    $squirrelmail_plugin_hooks['read_body_header_right']['spamcop'] =
       'spamcop_show_link';
 
-   sqextractGlobalVar('spamcop_is_composing');
+    sqgetGlobalVar('spamcop_is_composing' , $spamcop_is_composing);
       
    if (isset($spamcop_is_composing)) {
       $squirrelmail_plugin_hooks['compose_send']['spamcop'] =
@@ -62,33 +65,26 @@ function spamcop_show_link() {
       return;
 
    /* GLOBALS */
-   $passed_id = $_GET['passed_id'];
-   $mailbox = $_GET['mailbox'];
-   $startMessage = $_GET['startMessage'];
+   sqgetGlobalVar('passed_id',    $passed_id,    SQ_FORM);
+   sqgetGlobalVar('mailbox',      $mailbox,      SQ_FORM);
+   sqgetGlobalVar('startMessage', $startMessage, SQ_FORM);
    /* END GLOBALS */
 
    echo "<br>\n";
    
    if ($spamcop_method == 'web_form') {
-?><script language=javascript>
-document.write('<a href="../plugins/spamcop/spamcop.php?passed_id=<?PHP
-echo urlencode($passed_id); ?>&amp;js_web=1&amp;mailbox=<?PHP
-echo urlencode($mailbox); ?>" target="_blank">');
+?><script language="javascript" type="text/javascript">
+document.write('<a href="../plugins/spamcop/spamcop.php?passed_id=<?PHP echo urlencode($passed_id); ?>&amp;js_web=1&amp;mailbox=<?PHP echo urlencode($mailbox); ?>" target="_blank">');
 document.write("<?PHP echo _("Report as Spam"); ?>");
 document.write("</a>");
 </script><noscript>
-<a href="../plugins/spamcop/spamcop.php?passed_id=<?PHP
-echo urlencode($passed_id); ?>&amp;mailbox=<?PHP
-echo urlencode($mailbox); ?>&amp;startMessage=<?PHP
-echo urlencode($startMessage); ?>"><?PHP
-echo _("Report as Spam"); ?></a>
+<a href="../plugins/spamcop/spamcop.php?passed_id=<?PHP echo urlencode($passed_id); ?>&amp;mailbox=<?PHP echo urlencode($mailbox); ?>&amp;startMessage=<?PHP echo urlencode($startMessage); ?>">
+<?PHP echo _("Report as Spam"); ?></a>
 </noscript><?PHP
    } else {
-?><a href="../plugins/spamcop/spamcop.php?passed_id=<?PHP
-echo urlencode($passed_id); ?>&amp;mailbox=<?PHP
-echo urlencode($mailbox); ?>&amp;startMessage=<?PHP
-echo urlencode($startMessage); ?>"><?PHP
-echo _("Report as Spam"); ?></a><?PHP
+?><a href="../plugins/spamcop/spamcop.php?passed_id=<?PHP echo urlencode($passed_id); ?>&amp;mailbox=<?PHP echo urlencode($mailbox); ?>&amp;startMessage=<?PHP echo urlencode($startMessage); ?>">
+<?PHP echo _("Report as Spam"); ?></a>
+<?PHP
    }
 }