From: cigamit Date: Sun, 31 Oct 2004 23:24:09 +0000 (+0000) Subject: Remove unused globals X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=commitdiff_plain;h=ce68b76bfdef63cbc85d7bc46f7f1d538db9b4a4;hp=bbb92b4c9ae9b0d54216c109437fe7dfadb76b12 Remove unused globals git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@8293 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/class/mime.class.php b/class/mime.class.php index 62c2ebae..40e6ffb0 100644 --- a/class/mime.class.php +++ b/class/mime.class.php @@ -22,4 +22,4 @@ require_once(SM_PATH . 'class/mime/Disposition.class.php'); require_once(SM_PATH . 'class/mime/Language.class.php'); require_once(SM_PATH . 'class/mime/ContentType.class.php'); -?> +?> \ No newline at end of file diff --git a/class/mime/MessageHeader.class.php b/class/mime/MessageHeader.class.php index a06cb387..d8cc46c0 100644 --- a/class/mime/MessageHeader.class.php +++ b/class/mime/MessageHeader.class.php @@ -51,4 +51,4 @@ class MessageHeader { } } -?> +?> \ No newline at end of file diff --git a/class/mime/Rfc822Header.class.php b/class/mime/Rfc822Header.class.php index 40b93913..921b22cc 100644 --- a/class/mime/Rfc822Header.class.php +++ b/class/mime/Rfc822Header.class.php @@ -753,4 +753,4 @@ class Rfc822Header { } } -?> +?> \ No newline at end of file diff --git a/class/mime/SMimeMessage.class.php b/class/mime/SMimeMessage.class.php index 459471cf..819905ed 100644 --- a/class/mime/SMimeMessage.class.php +++ b/class/mime/SMimeMessage.class.php @@ -20,4 +20,4 @@ class SMimeMessage { } -?> +?> \ No newline at end of file diff --git a/functions/attachment_common.php b/functions/attachment_common.php index a26553e9..8b8a7ef2 100644 --- a/functions/attachment_common.php +++ b/functions/attachment_common.php @@ -146,7 +146,7 @@ function attachment_common_link_html(&$Args) { } function attachment_common_link_image(&$Args) { - global $attachment_common_show_images, $attachment_common_show_images_list; + global $attachment_common_show_images_list; sqgetGlobalVar('QUERY_STRING', $QUERY_STRING, SQ_SERVER); diff --git a/functions/imap_general.php b/functions/imap_general.php index f3c1ffaa..0a70f685 100755 --- a/functions/imap_general.php +++ b/functions/imap_general.php @@ -548,7 +548,7 @@ function sqimap_read_data ($imap_stream, $tag_uid, $handle_errors, * @return imap-stream resource identifier */ function sqimap_create_stream($server,$port,$tls=false) { - global $username, $use_imap_tls, $squirrelmail_language; + global $squirrelmail_language; if ($tls == true) { if ((check_php_version(4,3)) and (extension_loaded('openssl'))) { diff --git a/functions/imap_mailbox.php b/functions/imap_mailbox.php index 5eb359e4..ce3503e6 100755 --- a/functions/imap_mailbox.php +++ b/functions/imap_mailbox.php @@ -749,7 +749,7 @@ function sqimap_mailbox_list_all($imap_stream) { } function sqimap_mailbox_tree($imap_stream) { - global $default_folder_prefix, $unseen_notify, $unseen_type; + global $default_folder_prefix; if (true) { global $data_dir, $username, $list_special_folders_first, $folder_prefix, $delimiter, $trash_folder, $move_to_trash, diff --git a/functions/imap_messages.php b/functions/imap_messages.php index 2a0e4e53..6a6c0767 100755 --- a/functions/imap_messages.php +++ b/functions/imap_messages.php @@ -131,8 +131,7 @@ function sqimap_message_list_squisher($messages_array) { * @return array $id sorted uid list */ function sqimap_get_sort_order($imap_stream, $sSortField, $reverse, $search='ALL') { - global $default_charset, - $sent_folder; + global $default_charset; $id = array(); $sort_test = array(); @@ -936,7 +935,7 @@ function sqimap_messages_copy($imap_stream, $start, $end, $mailbox) { * Deprecated !!!!!!! DO NOT USE THIS, use sqimap_msgs_list_delete instead */ function sqimap_messages_delete($imap_stream, $start, $end, $mailbox, $bypass_trash=false) { - global $move_to_trash, $trash_folder, $auto_expunge; + global $move_to_trash, $trash_folder; if (($move_to_trash == true) && ($bypass_trash != true) && (sqimap_mailbox_exists($imap_stream, $trash_folder) && ($mailbox != $trash_folder))) { diff --git a/functions/imap_search.php b/functions/imap_search.php index 7995b30a..90f288a9 100644 --- a/functions/imap_search.php +++ b/functions/imap_search.php @@ -24,9 +24,8 @@ require_once(SM_PATH . 'functions/mime.php'); function sqimap_search($imapConnection, $search_where, $search_what, $mailbox, $color, $search_position = '', $search_all, $count_all) { - global $message_highlight_list, $squirrelmail_language, $languages, - $index_order, $pos, $allow_charset_search, - $imap_server_type; + global $squirrelmail_language, $languages, $pos, $allow_charset_search, + $imap_server_type; $pos = $search_position; diff --git a/functions/mime.php b/functions/mime.php index f411393b..c43b9c77 100644 --- a/functions/mime.php +++ b/functions/mime.php @@ -341,9 +341,8 @@ function formatBody($imap_stream, $message, $color, $wrap_at, $ent_num, $id, $ma * primary message. To add more of them, just put them in the * order that is their priority. */ - global $startMessage, $username, $key, $imapServerAddress, $imapPort, + global $startMessage, $languages, $squirrelmail_language, $show_html_default, $sort, $has_unsafe_images, $passed_ent_id; - global $languages, $squirrelmail_language; if( !sqgetGlobalVar('view_unsafe_images', $view_unsafe_images, SQ_GET) ) { $view_unsafe_images = false; @@ -422,7 +421,6 @@ function formatBody($imap_stream, $message, $color, $wrap_at, $ent_num, $id, $ma function formatAttachments($message, $exclude_id, $mailbox, $id) { global $where, $what, $startMessage, $color, $passed_ent_id; - static $ShownHTML = 0; $att_ar = $message->getAttachments($exclude_id); diff --git a/functions/options.php b/functions/options.php index 93783a6d..8416b5f6 100644 --- a/functions/options.php +++ b/functions/options.php @@ -154,7 +154,7 @@ class SquirrelOption { } function createHTMLWidget() { - global $javascript_on, $color; + global $color; // Use new value if available if (!empty($this->new_value)) { diff --git a/functions/page_header.php b/functions/page_header.php index 5ed8469e..b193b73f 100644 --- a/functions/page_header.php +++ b/functions/page_header.php @@ -124,9 +124,8 @@ function displayPageHeader($color, $mailbox, $xtra='', $session=false) { global $hide_sm_attributions, $PHP_SELF, $frame_top, $compose_new_win, $compose_width, $compose_height, - $attachemessages, $provider_name, $provider_uri, - $javascript_on, $default_use_mdn, $mdn_user_support, - $startMessage; + $provider_name, $provider_uri, $startMessage, + $javascript_on, $default_use_mdn, $mdn_user_support; sqgetGlobalVar('base_uri', $base_uri, SQ_SESSION ); sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION ); @@ -371,7 +370,7 @@ function compose_Header($color, $mailbox) { * Locate the first displayable form element (only when JavaScript on) */ if($javascript_on) { - global $delimiter, $base_uri, $PHP_SELF, $data_dir, $username; + global $base_uri, $PHP_SELF, $data_dir, $username; $module = substr( $PHP_SELF, ( strlen( $PHP_SELF ) - strlen( $base_uri ) ) * -1 ); diff --git a/functions/prefs.php b/functions/prefs.php index aaa12f03..7fe2af27 100644 --- a/functions/prefs.php +++ b/functions/prefs.php @@ -47,7 +47,6 @@ if (isset($prefs_backend) && file_exists(SM_PATH . $prefs_backend)) { * @return string the hashed location of datafile */ function getHashedFile($username, $dir, $datafile, $hash_search = true) { - global $dir_hash_level; /* Remove trailing slash from $dir if found */ if (substr($dir, -1) == '/') { diff --git a/include/options/display.php b/include/options/display.php index 23fef757..cf00a711 100644 --- a/include/options/display.php +++ b/include/options/display.php @@ -47,9 +47,9 @@ if ($use_icons) { * @return array all option information */ function load_optpage_data_display() { - global $theme, $language, $languages, $js_autodetect_results, $javascript_setting, - $compose_new_win, $default_use_mdn, $squirrelmail_language, $allow_thread_sort, - $optmode, $show_alternative_names, $available_languages, $use_icons; + global $theme, $language, $languages, + $default_use_mdn, $squirrelmail_language, $allow_thread_sort, + $show_alternative_names, $available_languages, $use_icons; /* Build a simple array into which we will build options. */ $optgrps = array(); @@ -491,8 +491,6 @@ function save_option_theme($option) { * This function saves the javascript detection option. */ function save_option_javascript_autodetect($option) { - global $data_dir, $username; - save_option($option); checkForJavascript(TRUE); } @@ -519,7 +517,6 @@ function icon_theme_save($option) { * This function saves the reply prefix (body_quote) character(s) */ function save_option_reply_prefix($option) { - global $data_dir, $username, $new_javascript_setting; // save as "NONE" if it was blanked out // diff --git a/plugins/administrator/setup.php b/plugins/administrator/setup.php index 88f24d14..128cea5a 100644 --- a/plugins/administrator/setup.php +++ b/plugins/administrator/setup.php @@ -20,7 +20,7 @@ require_once(SM_PATH . 'plugins/administrator/auth.php'); * @access private */ function squirrelmail_plugin_init_administrator() { - global $squirrelmail_plugin_hooks, $username; + global $squirrelmail_plugin_hooks; if ( adm_check_user() ) { $squirrelmail_plugin_hooks['optpage_register_block']['administrator'] = diff --git a/plugins/bug_report/setup.php b/plugins/bug_report/setup.php index 1c66c675..5c8bb459 100644 --- a/plugins/bug_report/setup.php +++ b/plugins/bug_report/setup.php @@ -37,7 +37,7 @@ function squirrelmail_plugin_init_bug_report() { * @access private */ function bug_report_button() { - global $color, $bug_report_visible; + global $bug_report_visible; if (! $bug_report_visible) { return; diff --git a/plugins/calendar/calendar.php b/plugins/calendar/calendar.php index 098ef000..9c78338c 100644 --- a/plugins/calendar/calendar.php +++ b/plugins/calendar/calendar.php @@ -50,7 +50,7 @@ if (isset($_POST['month'])) { //display upper part of month calendar view function startcalendar() { - global $year, $month, $day, $color; + global $year, $month, $color; $prev_date = mktime(0, 0, 0, $month - 1, 1, $year); $act_date = mktime(0, 0, 0, $month, 1, $year); diff --git a/plugins/change_password/backend/merak.php b/plugins/change_password/backend/merak.php index 7329e318..5bcd69eb 100644 --- a/plugins/change_password/backend/merak.php +++ b/plugins/change_password/backend/merak.php @@ -49,7 +49,7 @@ function cpw_merak_dochange($data) $msgs = array(); - global $merak_url, $merak_selfpage, $merak_action, $use_ssl_for_password_change, $debug; + global $merak_url, $merak_selfpage, $merak_action; if (!function_exists('curl_init')) { diff --git a/plugins/filters/filters.php b/plugins/filters/filters.php index 1a04ce27..135cfda3 100644 --- a/plugins/filters/filters.php +++ b/plugins/filters/filters.php @@ -84,7 +84,7 @@ function filters_LoadCache () { * @access private */ function filters_bulkquery($filters, $IPs) { - global $SpamFilters_YourHop, $attachment_dir, $username, + global $attachment_dir, $username, $SpamFilters_DNScache, $SpamFilters_BulkQuery, $SpamFilters_CacheTTL; @@ -125,8 +125,7 @@ function filters_bulkquery($filters, $IPs) { * @access private */ function start_filters() { - global $mailbox, $imapServerAddress, $imapPort, $imap, - $imap_general, $filters, $imap_stream, $imapConnection, + global $imapServerAddress, $imapPort, $imap_stream, $imapConnection, $UseSeparateImapConnection, $AllowSpamFilters; sqgetGlobalVar('username', $username, SQ_SESSION); @@ -758,7 +757,7 @@ function update_for_folder ($args) { $old_folder = $args[0]; $new_folder = $args[2]; $action = $args[1]; - global $plugins, $data_dir, $username; + global $data_dir, $username; $filters = array(); $filters = load_filters(); $filter_count = count($filters); diff --git a/plugins/info/functions.php b/plugins/info/functions.php index 3a20afb8..8290f2ec 100644 --- a/plugins/info/functions.php +++ b/plugins/info/functions.php @@ -36,7 +36,6 @@ function get_caps($imap_stream) { * @access private */ function imap_test($imap_stream, $string) { - global $default_charset; print "".htmlspecialchars($string).""; $response = sqimap_run_command_list($imap_stream, trim($string),false, $responses, $message,false); array_push($response, $responses . ' ' .$message); diff --git a/plugins/message_details/setup.php b/plugins/message_details/setup.php index 2346b5dc..a090bf9c 100644 --- a/plugins/message_details/setup.php +++ b/plugins/message_details/setup.php @@ -29,7 +29,7 @@ function squirrelmail_plugin_init_message_details() * @access private */ function show_message_details() { - global $passed_id, $mailbox, $ent_num, $color, + global $passed_id, $mailbox, $ent_num, $javascript_on; if (strlen(trim($mailbox)) < 1) { diff --git a/plugins/newmail/setup.php b/plugins/newmail/setup.php index f430cc12..f587cc1c 100644 --- a/plugins/newmail/setup.php +++ b/plugins/newmail/setup.php @@ -33,10 +33,9 @@ function CheckNewMailboxSound($imapConnection, $mailbox, $real_box, $delimeter, $unseen, &$total_new) { - global $folder_prefix, $trash_folder, $sent_folder, - $color, $move_to_sent, $move_to_trash, - $unseen_notify, $unseen_type, $newmail_allbox, - $newmail_recent, $newmail_changetitle; + global $trash_folder, $sent_folder, + $unseen_notify, $newmail_allbox, + $newmail_recent; $mailboxURL = urlencode($real_box); $unseen = $recent = 0; @@ -139,8 +138,7 @@ function newmail_plugin() { - global $username, $key, $imapServerAddress, $imapPort, - $newmail_media, $newmail_enable, $newmail_popup, + global $username, $newmail_media, $newmail_enable, $newmail_popup, $newmail_recent, $newmail_changetitle, $imapConnection, $PHP_SELF; if ($newmail_enable == 'on' || diff --git a/plugins/sent_subfolders/setup.php b/plugins/sent_subfolders/setup.php index 93b7eb5a..6e8517ff 100644 --- a/plugins/sent_subfolders/setup.php +++ b/plugins/sent_subfolders/setup.php @@ -183,10 +183,10 @@ function save_option_sent_subfolders_setting($option) { * creates required imap folders */ function sent_subfolders_update_sentfolder() { - global $sent_folder, $auto_create_special, $auto_create_done; + global $sent_folder; global $sent_subfolders_base, $sent_subfolders_setting; global $data_dir, $imapServerAddress, $imapPort; - global $use_sent_subfolders, $move_to_sent, $imap_server_type; + global $use_sent_subfolders, $move_to_sent; sqgetGlobalVar('username', $username, SQ_SESSION); sqgetGlobalVar('key', $key, SQ_COOKIE); diff --git a/plugins/spamcop/setup.php b/plugins/spamcop/setup.php index 89a57d9d..b472f605 100755 --- a/plugins/spamcop/setup.php +++ b/plugins/spamcop/setup.php @@ -20,8 +20,7 @@ $spamcop_quick_report = false; * @access private */ function squirrelmail_plugin_init_spamcop() { - global $squirrelmail_plugin_hooks, $data_dir, $username, - $spamcop_is_composing; + global $squirrelmail_plugin_hooks, $spamcop_is_composing; $squirrelmail_plugin_hooks['optpage_register_block']['spamcop'] = 'spamcop_options'; diff --git a/plugins/spamcop/spamcop.php b/plugins/spamcop/spamcop.php index 1485be76..b74c4127 100644 --- a/plugins/spamcop/spamcop.php +++ b/plugins/spamcop/spamcop.php @@ -22,7 +22,7 @@ require_once(SM_PATH . 'functions/imap.php'); */ function getMessage_RFC822_Attachment($message, $composeMessage, $passed_id, $passed_ent_id='', $imapConnection) { - global $attachments, $attachment_dir, $username, $data_dir; + global $attachment_dir, $username; $hashed_attachment_dir = getHashedDir($username, $attachment_dir); if (!$passed_ent_id) { diff --git a/plugins/squirrelspell/sqspell_options.php b/plugins/squirrelspell/sqspell_options.php index 623a9e56..39de1293 100644 --- a/plugins/squirrelspell/sqspell_options.php +++ b/plugins/squirrelspell/sqspell_options.php @@ -56,4 +56,4 @@ if(!isset($MOD) || !$MOD) { /* Load the stuff already. */ require_once(SM_PATH . $SQSPELL_DIR . "modules/$MOD.mod"); -?> +?> \ No newline at end of file diff --git a/plugins/translate/functions.php b/plugins/translate/functions.php index 3847af1c..4ae847f4 100644 --- a/plugins/translate/functions.php +++ b/plugins/translate/functions.php @@ -71,12 +71,6 @@ function translate_read_form_function() { global $imapConnection, $wrap_at, $passed_id, $mailbox; global $translate_gpltrans_url; - global $translate_babelfish_enabled, $translate_go_enabled, - $translate_dictionary_enabled, $translate_google_enabled, - $translate_gpltrans_enabled, $translate_intertran_enabled, - $translate_promt_enabled, $translate_otenet_enabled; - global $translate_custom_enabled; - if (!$translate_show_read) { return; } @@ -232,7 +226,7 @@ function translate_showoption() { $translate_dictionary_enabled, $translate_google_enabled, $translate_gpltrans_enabled, $translate_intertran_enabled, $translate_promt_enabled, $translate_otenet_enabled; - global $translate_custom_enabled; + global $translate_custom_enabled, $translate_gpltrans_url; if ($translate_babelfish_enabled) translate_showoption_internal('server','babelfish', 'Babelfish'); if ($translate_go_enabled) translate_showoption_internal('server','go', 'Go.com'); @@ -426,7 +420,7 @@ function translate_lang_opt($from, $to, $value, $text) { * @access private */ function translate_new_form($action) { - global $translate_dir, $translate_new_window, $translate_location; + global $translate_dir, $translate_location; global $color, $translate_same_window; echo '