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 2cbfe4e..ef1c22a 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 fcdda93..7c9ed9a 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 1593abb..4695e3c 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 1310ef7..c553151 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 2f5aba7..5323939 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 085c541..9c471c5 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 666ef82..b324142 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 4f2331b..56315ae 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 882b9d7..c8dba2e 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 097cadd..18f1a0a 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 f4d064c..6c523a4 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 06168ba..511ca33 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 ae55cb9..be12b8a 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 1aa616a..33f012e 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();