From 04f6008a45f667d2ce38925f5b2dc4b56076d28e Mon Sep 17 00:00:00 2001 From: kink Date: Mon, 23 Sep 2002 10:07:55 +0000 Subject: [PATCH] Some plugins to rg=0: bug_report message_details newmail sent_subfolders spamcop translate git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@3713 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- plugins/bug_report/bug_report.php | 13 ++----- plugins/bug_report/setup.php | 9 +++-- .../message_details_bottom.php | 8 ++++ .../message_details/message_details_main.php | 3 ++ .../message_details/message_details_top.php | 2 + plugins/message_details/setup.php | 13 +++---- plugins/newmail/setup.php | 39 +++++++++---------- plugins/newmail/testsound.php | 9 +++-- plugins/sent_subfolders/setup.php | 25 ++++++++++-- plugins/spamcop/options.php | 18 ++++++++- plugins/spamcop/setup.php | 25 ++++++++---- plugins/spamcop/spamcop.php | 28 +++++++++++-- plugins/translate/options.php | 20 ++++++---- plugins/translate/setup.php | 2 +- 14 files changed, 145 insertions(+), 69 deletions(-) diff --git a/plugins/bug_report/bug_report.php b/plugins/bug_report/bug_report.php index 2cbfe4e1..ef1c22a0 100644 --- a/plugins/bug_report/bug_report.php +++ b/plugins/bug_report/bug_report.php @@ -16,17 +16,10 @@ * $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" . diff --git a/plugins/bug_report/setup.php b/plugins/bug_report/setup.php index fcdda93e..7c9ed9ac 100644 --- a/plugins/bug_report/setup.php +++ b/plugins/bug_report/setup.php @@ -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") . "\n"; } -?> \ No newline at end of file +?> diff --git a/plugins/message_details/message_details_bottom.php b/plugins/message_details/message_details_bottom.php index 1593abb3..4695e3c7 100644 --- a/plugins/message_details/message_details_bottom.php +++ b/plugins/message_details/message_details_bottom.php @@ -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) { diff --git a/plugins/message_details/message_details_main.php b/plugins/message_details/message_details_main.php index 1310ef70..c5531513 100644 --- a/plugins/message_details/message_details_main.php +++ b/plugins/message_details/message_details_main.php @@ -19,6 +19,9 @@ require_once(SM_PATH . 'functions/strings.php'); displayHtmlHeader( _("Message details"), '', FALSE ); +$mailbox = $_GET['mailbox']; +$passed_id = $_GET['passed_id']; + echo "\n"; echo ''; echo ''; diff --git a/plugins/message_details/message_details_top.php b/plugins/message_details/message_details_top.php index 2f5aba78..5323939b 100644 --- a/plugins/message_details/message_details_top.php +++ b/plugins/message_details/message_details_top.php @@ -27,6 +27,8 @@ displayHtmlHeader( _("Message details"), "-->\n". "\n", FALSE ); +$passed_id = $_GET['passed_id']; +$mailbox = $_GET['mailbox']; echo "\n" . '
'. diff --git a/plugins/message_details/setup.php b/plugins/message_details/setup.php index 085c541d..9c471c57 100644 --- a/plugins/message_details/setup.php +++ b/plugins/message_details/setup.php @@ -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 = '\n" . @@ -49,4 +47,5 @@ function show_message_details() { } echo $result; } - \ No newline at end of file + +?> diff --git a/plugins/newmail/setup.php b/plugins/newmail/setup.php index 666ef82a..b3241421 100644 --- a/plugins/newmail/setup.php +++ b/plugins/newmail/setup.php @@ -86,43 +86,40 @@ 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',''); diff --git a/plugins/newmail/testsound.php b/plugins/newmail/testsound.php index 4f2331bd..56315ae0 100644 --- a/plugins/newmail/testsound.php +++ b/plugins/newmail/testsound.php @@ -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); diff --git a/plugins/sent_subfolders/setup.php b/plugins/sent_subfolders/setup.php index 882b9d78..c8dba2e5 100644 --- a/plugins/sent_subfolders/setup.php +++ b/plugins/sent_subfolders/setup.php @@ -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'); diff --git a/plugins/spamcop/options.php b/plugins/spamcop/options.php index 097cadd2..18f1a0a4 100755 --- a/plugins/spamcop/options.php +++ b/plugins/spamcop/options.php @@ -1,9 +1,25 @@ \n"; if ($spamcop_method == 'web_form') { diff --git a/plugins/spamcop/spamcop.php b/plugins/spamcop/spamcop.php index 06168bad..511ca33e 100644 --- a/plugins/spamcop/spamcop.php +++ b/plugins/spamcop/spamcop.php @@ -1,10 +1,30 @@
+

"._("Saved Translation Options")."

\n"; + }?> +