Some plugins to rg=0: bug_report message_details newmail sent_subfolders spamcop...
authorkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 23 Sep 2002 10:07:55 +0000 (10:07 +0000)
committerkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 23 Sep 2002 10:07:55 +0000 (10:07 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@3713 7612ce4b-ef26-0410-bec9-ea0150e637f0

14 files changed:
plugins/bug_report/bug_report.php
plugins/bug_report/setup.php
plugins/message_details/message_details_bottom.php
plugins/message_details/message_details_main.php
plugins/message_details/message_details_top.php
plugins/message_details/setup.php
plugins/newmail/setup.php
plugins/newmail/testsound.php
plugins/sent_subfolders/setup.php
plugins/spamcop/options.php
plugins/spamcop/setup.php
plugins/spamcop/spamcop.php
plugins/translate/options.php
plugins/translate/setup.php

index 2cbfe4e1bd297269654b328c16153fabf2888029..ef1c22a06eda46ae005e87521acdf9c764c11661 100644 (file)
  * $Id$
  */
 
-session_start();
 define('SM_PATH','../../');
 
-require_once(SM_PATH . 'config/config.php');
-require_once(SM_PATH . 'functions/strings.php');
-require_once(SM_PATH . 'functions/page_header.php');
-require_once(SM_PATH . 'functions/display_messages.php');
-require_once(SM_PATH . 'functions/imap.php');
-require_once(SM_PATH . 'functions/array.php');
-require_once(SM_PATH . 'functions/i18n.php');
-require_once(SM_PATH . 'include/load_prefs.php');
+require_once(SM_PATH . 'include/validate.php');
+
 displayPageHeader($color, 'None');
 
 
@@ -59,7 +52,7 @@ $body_top = "I subscribe to the squirrelmail-users mailing list.\n" .
                 "(Optional) I got really bored and here's a fix:\n\n\n" .
                 "----------------------------------------------\n" .
             "\nMy browser information:\n" .
-            "  $HTTP_USER_AGENT\n" .
+            '  '.$_SERVER['HTTP_USER_AGENT'] . "\n" .
             "  get_browser() information (List)\n" .
             Show_Array((array) $browser) .
             "\nMy web server information:\n" .
index fcdda93ebe5dc0c03a6061aac38e89d5bd8a955d..7c9ed9ac7e528d314af6f7ac5f7ffeb2c7f236bb 100644 (file)
@@ -41,9 +41,12 @@ function bug_report_button() {
 
 function bug_report_save() {
     global $username,$data_dir;
-    global $bug_report_bug_report_visible;
 
-    if (isset($bug_report_bug_report_visible)) {
+    if ( (float)substr(PHP_VERSION,0,3) < 4.1 ) {
+        global $_POST;
+    }
+    if(isset($_POST['bug_report_bug_report_visible'])) {
         setPref($data_dir, $username, 'bug_report_visible', '1');
     } else {
         setPref($data_dir, $username, 'bug_report_visible', '');
@@ -70,4 +73,4 @@ function bug_report_options() {
     echo '> ' . _("Show button in toolbar") . "</td></tr>\n";
 }
 
-?>
\ No newline at end of file
+?>
index 1593abb3a4ace3e31294d43700a28fe20458a7b9..4695e3c774997119b1dc902904efaa58421c7c85 100644 (file)
@@ -21,6 +21,14 @@ require_once(SM_PATH . 'functions/prefs.php');
 
 global $color, $uid_support;
 
+$passed_id = $_GET['passed_id'];
+$mailbox = $_GET['mailbox'];
+
+$username = $_SESSION['username'];
+$key = $_COOKIE['key'];
+$onetimepad = $_SESSION['onetimepad'];
+
+
 function CalcEntity($entString, $direction) {
     $result = $entString;
     if ($direction == -1) {
index 1310ef70deadbe71be9afb4e00588c095b1ae35b..c55315133836fb1adda1d8e7d71b9353556c277a 100644 (file)
@@ -19,6 +19,9 @@ require_once(SM_PATH . 'functions/strings.php');
 
 displayHtmlHeader( _("Message details"), '', FALSE );
 
+$mailbox = $_GET['mailbox'];
+$passed_id = $_GET['passed_id'];
+
 echo "<frameset rows=\"60, *\" noresize border=\"0\">\n";
 echo '<frame src="message_details_top.php?mailbox=' . urlencode($mailbox) .'&passed_id=' . "$passed_id". '" name="top_frame" scrolling="off">';
 echo '<frame src="message_details_bottom.php?mailbox=' . urlencode($mailbox) .'&passed_id=' . "$passed_id" . '" name="bottom_frame">';
index 2f5aba78e2e346b73a91b7964df06a24d6db9a85..5323939b11a9177c9b7d8d4c95de008248272a24 100644 (file)
@@ -27,6 +27,8 @@ displayHtmlHeader( _("Message details"),
              "-->\n".
              "</script>\n", FALSE );
 
+$passed_id = $_GET['passed_id'];
+$mailbox = $_GET['mailbox'];
 
 echo "<body text=\"$color[8]\" bgcolor=\"$color[3]\" link=\"$color[7]\" vlink=\"$color[7]\" alink=\"$color[7]\">\n" .
      '<center><b>'.
index 085c541dc69b4e6f9cea8f33f4879da70a87c092..9c471c57b04b68cebd9839fe04dcf05c55f5cbf4 100644 (file)
@@ -14,13 +14,12 @@ function squirrelmail_plugin_init_message_details()
 {
   global $squirrelmail_plugin_hooks;
 
-  do_hook("read_body_header_right");
-  $squirrelmail_plugin_hooks['read_body_header_right']['message_details'] = "show_message_details";
+  do_hook('read_body_header_right');
+  $squirrelmail_plugin_hooks['read_body_header_right']['message_details'] = 'show_message_details';
 }
 
 function show_message_details() {
     global $passed_id, $mailbox, $ent_num, $color,
-           $pf_subtle_link,
            $javascript_on;
 
     if (strlen(trim($mailbox)) < 1) {
@@ -33,15 +32,14 @@ function show_message_details() {
 
     $print_text = _("View Message details");
 
-
     $result = '';
     /* Output the link. */
     if ($javascript_on) {
-        $result = '<script language="javascript">' . "\n" .
+        $result = '<script type="text/javascript" language="javascript">' . "\n" .
                 '<!--' . "\n" .
                 "  function MessageSource() {\n" .
                 '    window.open("../plugins/message_details/message_details_main.php' .
-                        $params . '","Print","width=800,height=600");' . "\n".
+                        $params . '","MessageDetails","width=800,height=600");' . "\n".
                 "  }\n" .
                 "// -->\n" .
                 "</script>\n" .
@@ -49,4 +47,5 @@ function show_message_details() {
     } 
     echo $result;
 }
\ No newline at end of file
+?>
index 666ef82a6f57c2623e82143b5f570dde289a06c9..b3241421a48125ef82a7298a95e84efd96cf6f19 100644 (file)
 
     function newmail_sav() {
 
-        global $username,$data_dir;
-        global $submit_newmail,$media_file,$media_reset,$media_enable,$media_popup;
-        global $media_recent,$media_sel;
-        global $media_allbox, $media_changetitle;
-
-        if ( isset($submit_newmail) ) {
-         
-            if(isset($media_enable)) {
-                setPref($data_dir,$username,'newmail_enable',$media_enable);
+        global $data_dir, $username, $_POST;
+     
+        if ( isset($_POST['submit_newmail']) ) {
+
+            if(isset($_POST['media_enable'])) {
+                setPref($data_dir,$username,'newmail_enable',$_POST['media_enable']);
             } else {
                 setPref($data_dir,$username,'newmail_enable','');
             }
-            if(isset($media_popup)) {
-                setPref($data_dir,$username,'newmail_popup',$media_popup);
+            if(isset($_POST['media_popup'])) {
+                setPref($data_dir,$username,'newmail_popup',$_POST['media_popup']);
             } else {
                 setPref($data_dir,$username,'newmail_popup','');
             }
-            if(isset($media_allbox)) {
-                setPref($data_dir,$username,'newmail_allbox',$media_allbox);
+            if(isset($_POST['media_allbox'])) {
+                setPref($data_dir,$username,'newmail_allbox',$_POST['media_allbox']);
             } else {
                 setPref($data_dir,$username,'newmail_allbox','');
             }
-            if(isset($media_recent)) {
-                setPref($data_dir,$username,'newmail_recent',$media_recent);
+            if(isset($_POST['media_recent'])) {
+                setPref($data_dir,$username,'newmail_recent',$_POST['media_recent']);
             } else {
                 setPref($data_dir,$username,'newmail_recent','');
             }
-            if(isset($media_changetitle)) {
-                setPref($data_dir,$username,'newmail_changetitle',$media_changetitle);
+            if(isset($_POST['media_changetitle'])) {
+                setPref($data_dir,$username,'newmail_changetitle',$_POST['media_changetitle']);
             } else {
                 setPref($data_dir,$username,'newmail_changetitle','');
             }
-            if(isset($media_sel)) {
-                if($media_sel == '(local media)') {
-                    setPref($data_dir,$username,'newmail_media',StripSlashes($media_file));
+            if(isset($_POST['media_sel'])) {
+                if($_POST['media_sel'] == '(local media)') {
+                    setPref($data_dir,$username,'newmail_media',StripSlashes($_POST['media_file']));
                 } else {
-                    setPref($data_dir,$username,'newmail_media',$media_sel);
+                    setPref($data_dir,$username,'newmail_media',$_POST['media_sel']);
                 }
             } else {
                 setPref($data_dir,$username,'newmail_media','');
index 4f2331bdbcb0ddeb83e823aec62b9a9f3e6aa5a2..56315ae01494cd1e6c0be4d3eba117c9e57bbfc1 100644 (file)
@@ -6,8 +6,6 @@
  * Copyright (c) 1999-2002 The SquirrelMail Project Team
  * Licensed under the GNU GPL. For full terms see the file COPYING.        
  *
- * Displays all options relating to new mail sounds
- *
  * $Id$
  */
 
@@ -17,7 +15,12 @@ define('SM_PATH','../../');
 require_once(SM_PATH . 'include/validate.php');
 require_once(SM_PATH . 'functions/html.php');
 
-$sound = (!isset($sound) ? 'Click.wav' : $sound);
+if (!isset($_GET['sound'])) {
+    $sound = 'Click.wav';
+} else {
+    $sound = $_GET['sound'];
+}
+
 $sound = str_replace('../plugins/newmail/', '', $sound);
 $sound = str_replace('../', '', $sound);
 $sound = str_replace("..\\", '', $sound);
index 882b9d784222de67b7732d08370478348006da76..c8dba2e5fd3484565a58df4af0762353c9571bc0 100644 (file)
@@ -48,9 +48,13 @@ function squirrelmail_plugin_init_sent_subfolders() {
 
 function sent_subfolders_check_handleAsSent() {
     global $handleAsSent_result, $sent_subfolders_base,
-           $use_sent_subfolders, $delimiter;
+           $use_sent_subfolders;
+    if ( (float)substr(PHP_VERSION,0,3) < 4.1 ) {
+        global $_SESSION;
+    }
     $sent_subfolders_base = 'INBOX.Sent';
     $args = func_get_arg(0);
+    $delimiter = $_SESSION['delimiter'];
 
     /* Only check the folder string if we have been passed a mailbox. */
     if ($use_sent_subfolders && (count($args) > 1)) {
@@ -82,7 +86,13 @@ function sent_subfolders_load_prefs() {
 }
 
 function sent_subfolders_optpage_loadhook_folders() {
-    global $optpage_data, $username, $key, $imapServerAddress, $imapPort;
+    global $optpage_data, $imapServerAddress, $imapPort;
+
+    if ( (float)substr(PHP_VERSION,0,3) < 4.1 ) {
+        global $_SESSION, $_COOKIE;
+    }
+    $username = $_SESSION['username'];
+    $key = $_COOKIE['key'];
 
     /* Get some imap data we need later. */
     $imapConnection =
@@ -144,11 +154,18 @@ function save_option_sent_subfolders_setting($option) {
 }
 
 function sent_subfolders_update_sentfolder() {
-    global $sent_folder, $delimiter, $auto_create_special, $auto_create_done;
+    global $sent_folder, $auto_create_special, $auto_create_done;
     global $sent_subfolders_base, $sent_subfolders_setting;
-    global $username, $data_dir, $key, $imapServerAddress, $imapPort;
+    global $data_dir, $imapServerAddress, $imapPort;
     global $use_sent_subfolders, $move_to_sent, $imap_server_type;
 
+    if ( (float)substr(PHP_VERSION,0,3) < 4.1 ) {
+        global $_SESSION, $_COOKIE;
+    }
+    $username = $_SESSION['username'];
+    $key  = $_COOKIE['key'];
+    $delimiter = $_SESSION['delimiter'];
+
     if ($use_sent_subfolders || $move_to_sent) {
         $year = date('Y');
         $month = date('m');
index 097cadd2f980f9b2cdc1d5f4829ad8d8af79e812..18f1a0a4dbc7c37010ba3ed64327408a07e01050 100755 (executable)
@@ -1,9 +1,25 @@
 <?php
 
+   /**
+    **  options.php -- SpamCop options page
+    **
+    **  Copyright (c) 1999-2002 The SquirrelMail development team
+    **  Licensed under the GNU GPL. For full terms see the file COPYING.
+    **
+    **  $Id$
+    **/
+
 define('SM_PATH','../../');
 require_once(SM_PATH . 'include/validate.php');
 
-displayPageHeader($color, "None");   
+displayPageHeader($color, 'None');
+   
+/* globals */
+sqextractGlobalVar('action');
+sqextractGlobalVar('meth');
+sqextractGlobalVar('ID');
+extract($_SESSION);
+/* end of globals */
 
 $action = (!isset($action) ? '' : $action);
 
index f4d064c65e7fae8a8733108af0b2d016446084bb..6c523a4219a0459e68c5b27b7b1da33710cfbda9 100755 (executable)
@@ -1,5 +1,12 @@
 <?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$                                                         
+    **/
 
 /* Initialize the plugin */
 function squirrelmail_plugin_init_spamcop() {
@@ -12,6 +19,8 @@ function squirrelmail_plugin_init_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'] =
@@ -44,17 +53,17 @@ function spamcop_load() {
 
 // 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') {
index 06168badf1155057cfb2b09d8e33eedb3320f258..511ca33e856dbd09ea51954d18b9e68564ba4f9b 100644 (file)
@@ -1,10 +1,30 @@
 <?php
+   /** 
+    **  spamcop.php -- SpamCop plugin           
+    **
+    **  Copyright (c) 1999-2002 The SquirrelMail development team
+    **  Licensed under the GNU GPL. For full terms see the file COPYING.
+    **  
+    **  $Id$                                                         
+    **/
 
 define('SM_PATH','../../');
 
  /* SquirrelMail required files. */
 require_once(SM_PATH . 'include/validate.php');
 require_once(SM_PATH . 'functions/imap.php');
+
+    /* GLOBALS */
+
+    $username = $_SESSION['username'];
+    $key  = $_COOKIE['key'];
+    $onetimepad = $_SESSION['onetimepad'];
+
+    $mailbox = $_GET['mailbox'];
+    $passed_id = $_GET['passed_id'];
+    $startMessage = $_GET['startMessage'];
+
+    /* END GLOBALS */
     
     displayPageHeader($color, $mailbox);
 
@@ -22,7 +42,7 @@ require_once(SM_PATH . 'functions/imap.php');
        // Use email-based reporting -- save as an attachment
        if(!isset($composesession)) {
         $composesession = 0;
-        session_register('composesession');
+        sqsession_register($composesession, 'composesession');
        }
        if (!isset($session)) {
          $session = "$composesession" +1;
@@ -31,7 +51,7 @@ require_once(SM_PATH . 'functions/imap.php');
 
        if (!isset($attachments)) {
           $attachments = array();
-          session_register('attachments');
+          sqsession_register($attachments, 'attachments');
        }
     
        foreach ($attachments as $info) {
@@ -51,8 +71,10 @@ require_once(SM_PATH . 'functions/imap.php');
        foreach ($read as $line) {
           fputs($fp, $line);
        }
+       sqsession_unregister('attachments');
        $attachments[] = $newAttachment;
-    
+       sqsession_register($attachments , 'attachments');    
+
        $fn = getPref($data_dir, $username, 'full_name');
        $em = getPref($data_dir, $username, 'email_address');
     
index ae55cb997c7d572b605cae7d338b0b622e35bf70..be12b8ac6db5f61fd408e4877ba7b85495a649ea 100644 (file)
@@ -26,32 +26,32 @@ require_once(SM_PATH . 'include/load_prefs.php');
 
     displayPageHeader($color, 'None');
 
-    if (isset($submit_translate) && $submit_translate ) {
-        if (isset($translate_translate_server)) {
-            setPref($data_dir, $username, 'translate_server', $translate_translate_server);
+    if (isset($_POST['submit_translate']) && $_POST['submit_translate'] ) {
+        if (isset($_POST['translate_translate_server'])) {
+            setPref($data_dir, $username, 'translate_server', $_POST['translate_translate_server']);
         } else {
             setPref($data_dir, $username, 'translate_server', 'babelfish');
         }
 
-        if (isset($translate_translate_location)) {
-            setPref($data_dir, $username, 'translate_location', $translate_translate_location);
+        if (isset($_POST['translate_translate_location'])) {
+            setPref($data_dir, $username, 'translate_location', $_POST['translate_translate_location']);
         } else {
             setPref($data_dir, $username, 'translate_location', 'center');
         }
 
-        if (isset($translate_translate_show_read)) {
+        if (isset($_POST['translate_translate_show_read'])) {
             setPref($data_dir, $username, 'translate_show_read', '1');
         } else {
             setPref($data_dir, $username, 'translate_show_read', '');
         }
 
-        if (isset($translate_translate_show_send)) {
+        if (isset($_POST['translate_translate_show_send'])) {
             setPref($data_dir, $username, 'translate_show_send', '1');
         } else {
             setPref($data_dir, $username, 'translate_show_send', '');
         }
 
-        if (isset($translate_translate_same_window)) {
+        if (isset($_POST['translate_translate_same_window'])) {
            setPref($data_dir, $username, 'translate_same_window', '1');
         } else {
             setPref($data_dir, $username, 'translate_same_window', '');
@@ -98,6 +98,10 @@ require_once(SM_PATH . 'include/load_prefs.php');
       <center><b><?php echo _("Options") . ' - '. _("Translator"); ?></b></center>
    </td></tr></table>
 
+    <?php if (isset($_POST['submit_translate']) && $_POST['submit_translate'] ) {
+        print "<center><h4>"._("Saved Translation Options")."</h4></center>\n";
+    }?>
+
    <p><?php echo _("Your server options are as follows:"); ?></p>
 
    <ul>
index 1aa616afc3c48bbc5d9558cb20d0cd7c68f6e16a..33f012e1b4e9a9122b6ebcf70764410172037ddb 100644 (file)
@@ -481,7 +481,7 @@ function translate_form_dictionary($message) {
                             sprintf( _("%s to %s"),
                                      _("Spanish"),
                                      _("English"))) .
-         '<\SELECT>'.
+         '</SELECT>'.
          'Dictionary.com: <INPUT TYPE="submit" VALUE="'._("Translate").'">';
 
   translate_table_end();