From: kink Date: Sat, 21 Sep 2002 15:59:32 +0000 (+0000) Subject: Update function directory to rg=0. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=9eb0fbd4afe1b2f5c3e395d75e4b97ad543c880f;p=squirrelmail.git Update function directory to rg=0. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@3699 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/functions/db_prefs.php b/functions/db_prefs.php index a8a5ba3a..2e2c12e5 100644 --- a/functions/db_prefs.php +++ b/functions/db_prefs.php @@ -44,8 +44,8 @@ function cachePrefValues($username) { return; } - session_unregister('prefs_cache'); - session_unregister('prefs_are_cached'); + sqsession_unregister('prefs_cache'); + sqsession_unregister('prefs_are_cached'); $db = new dbPrefs; if(isset($db->error)) { @@ -63,8 +63,8 @@ function cachePrefValues($username) { $prefs_are_cached = true; - session_register('prefs_cache'); - session_register('prefs_are_cached'); + sqsession_register($prefs_cache, 'prefs_cache'); + sqsession_register($prefs_are_cached, 'prefs_are_cached'); } class dbPrefs { diff --git a/functions/file_prefs.php b/functions/file_prefs.php index 3e594e62..0671b3ef 100644 --- a/functions/file_prefs.php +++ b/functions/file_prefs.php @@ -11,8 +11,6 @@ * $Id$ */ -global $prefs_are_cached, $prefs_cache; - /** * Check the preferences into the session cache. */ @@ -23,8 +21,8 @@ function cachePrefValues($data_dir, $username) { return; } - session_unregister('prefs_cache'); - session_unregister('prefs_are_cached'); + sqsession_unregister('prefs_cache'); + sqsession_unregister('prefs_are_cached'); /* Calculate the filename for the user's preference file */ $filename = getHashedFile($username, $data_dir, "$username.pref"); @@ -70,8 +68,8 @@ function cachePrefValues($data_dir, $username) { $prefs_are_cached = TRUE; - session_register('prefs_cache'); - session_register('prefs_are_cached'); + sqsession_register($prefs_cache, 'prefs_cache'); + sqsession_register($prefs_are_cached, 'prefs_are_cached'); } /** diff --git a/functions/gettext.php b/functions/gettext.php index 4b2cae52..abd05564 100644 --- a/functions/gettext.php +++ b/functions/gettext.php @@ -15,33 +15,35 @@ * $Id$ */ +require_once('../src/global.php'); + global $gettext_php_domain, $gettext_php_dir, $gettext_php_loaded, $gettext_php_translateStrings, $gettext_php_loaded_language, $gettext_php_short_circuit; if (! isset($gettext_php_loaded)) { $gettext_php_loaded = false; - session_register('gettext_php_loaded'); + sqsession_register($gettext_php_loaded, 'gettext_php_loaded'); } if (! isset($gettext_php_domain)) { $gettext_php_domain = ''; - session_register('gettext_php_domain'); + sqsession_register($gettext_php_domain, 'gettext_php_domain'); } if (! isset($gettext_php_dir)) { $gettext_php_dir = ''; - session_register('gettext_php_dir'); + sqsession_register($gettext_php_dir, 'gettext_php_dir'); } if (! isset($gettext_php_translateStrings)) { $gettext_php_translateStrings = array(); - session_register('gettext_php_translateStrings'); + sqsession_register($gettext_php_translateStrings, 'gettext_php_translateStrings'); } if (! isset($gettext_php_loaded_language)) { $gettext_php_loaded_language = ''; - session_register('gettext_php_loaded_language'); + sqsession_register($gettext_php_loaded_language, 'gettext_php_loaded_language'); } if (! isset($gettext_php_short_circuit)) { $gettext_php_short_circuit = false; - session_register('gettext_php_short_circuit'); + sqsession_register($gettext_php_short_circuit, 'gettext_php_short_circuit'); } function gettext_php_load_strings() { diff --git a/functions/i18n.php b/functions/i18n.php index c7b56184..b5ade38f 100644 --- a/functions/i18n.php +++ b/functions/i18n.php @@ -785,7 +785,7 @@ function charset_decode_koi8r ($string) { function set_up_language($sm_language, $do_search = false) { static $SetupAlready = 0; - global $HTTP_ACCEPT_LANGUAGE, $use_gettext, $languages, + global $use_gettext, $languages, $squirrelmail_language, $squirrelmail_default_language, $sm_notAlias; @@ -794,8 +794,8 @@ function set_up_language($sm_language, $do_search = false) { } $SetupAlready = TRUE; - if ($do_search && ! $sm_language && isset($HTTP_ACCEPT_LANGUAGE)) { - $sm_language = substr($HTTP_ACCEPT_LANGUAGE, 0, 2); + if ($do_search && ! $sm_language && isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { + $sm_language = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); } if (!$sm_language && isset($squirrelmail_default_language)) { diff --git a/functions/imap_general.php b/functions/imap_general.php index 24dd45fc..c58f0907 100755 --- a/functions/imap_general.php +++ b/functions/imap_general.php @@ -177,7 +177,7 @@ function sqimap_read_data ($imap_stream, $pre, $handle_errors, &$response, &$mes * will be displayed. This function returns the imap connection handle. */ function sqimap_login ($username, $password, $imap_server_address, $imap_port, $hide) { - global $color, $squirrelmail_language, $HTTP_ACCEPT_LANGUAGE, $onetimepad; + global $color, $squirrelmail_language, $onetimepad; $imap_server_address = sqimap_get_user_server($imap_server_address, $username); diff --git a/functions/imap_messages.php b/functions/imap_messages.php index f50fdee4..4c113dc9 100755 --- a/functions/imap_messages.php +++ b/functions/imap_messages.php @@ -106,7 +106,7 @@ function sqimap_get_sort_order ($imap_stream, $sort, $mbxresponse) { $sent_folder, $mailbox, $uid_support; if (session_is_registered('server_sort_array')) { - session_unregister('server_sort_array'); + sqsession_unregister('server_sort_array'); } $sid = sqimap_session_id($uid_support); @@ -134,7 +134,7 @@ function sqimap_get_sort_order ($imap_stream, $sort, $mbxresponse) { $qty = $mbxresponse['EXISTS']; $server_sort_array = range(1, $qty); } - session_register('server_sort_array'); + sqsession_register($server_sort_array, 'server_sort_array'); return $server_sort_array; } @@ -168,7 +168,7 @@ function sqimap_get_sort_order ($imap_stream, $sort, $mbxresponse) { if (!preg_match("/OK/", $response)) { $server_sort_array = 'no'; } - session_register('server_sort_array'); + sqsession_register($server_sort_array, 'server_sort_array'); return $server_sort_array; } @@ -177,7 +177,7 @@ function sqimap_get_php_sort_order ($imap_stream, $mbxresponse) { global $uid_support; if (session_is_registered('php_sort_array')) { - session_unregister('php_sort_array'); + sqsession_unregister('php_sort_array'); } $sid = sqimap_session_id($uid_support); @@ -204,7 +204,7 @@ function sqimap_get_php_sort_order ($imap_stream, $mbxresponse) { $qty = $mbxresponse['EXISTS']; $php_sort_array = range(1, $qty); } - session_register('php_sort_array'); + sqsession_register($php_sort_array, 'php_sort_array'); return $php_sort_array; } @@ -316,10 +316,10 @@ function get_parent_level ($imap_stream) { function get_thread_sort ($imap_stream) { global $thread_new, $sort_by_ref, $default_charset, $server_sort_array, $uid_support; if (session_is_registered('thread_new')) { - session_unregister('thread_new'); + sqsession_unregister('thread_new'); } if (session_is_registered('server_sort_array')) { - session_unregister('server_sort_array'); + sqsession_unregister('server_sort_array'); } $sid = sqimap_session_id($uid_support); $thread_temp = array (); @@ -373,14 +373,14 @@ function get_thread_sort ($imap_stream) { } } } - session_register('thread_new'); + sqsession_register($thread_new, 'thread_new'); $thread_new = array_reverse($thread_new); $thread_list = implode(" ", $thread_new); $thread_list = str_replace("(", " ", $thread_list); $thread_list = str_replace(")", " ", $thread_list); $thread_list = preg_split("/\s/", $thread_list, -1, PREG_SPLIT_NO_EMPTY); $server_sort_array = $thread_list; - session_register('server_sort_array'); + sqsession_register($server_sort_array, 'server_sort_array'); return $thread_list; } diff --git a/functions/mailbox_display.php b/functions/mailbox_display.php index e91a1c7e..fa5c3b6a 100644 --- a/functions/mailbox_display.php +++ b/functions/mailbox_display.php @@ -380,8 +380,8 @@ function showMessagesForMailbox($imapConnection, $mailbox, $num_msgs, switch ($mode) { case 'thread': - session_unregister('msort'); - session_unregister('msgs'); + sqsession_unregister('msort'); + sqsession_unregister('msgs'); $msgs = getThreadMessages($imapConnection, $start_msg, $show_num, $num_msgs); if ($msgs === false) { @@ -390,13 +390,13 @@ function showMessagesForMailbox($imapConnection, $mailbox, $num_msgs, ''; $thread_sort_messages = 0; $msort = $msgs = array(); - session_register('msort'); - session_register('msgs'); + sqsession_register($msort, 'msort'); + sqsession_register($msgs, 'msgs'); } else { $msort= $msgs; $sort = 6; - session_register('msort'); - session_register('msgs'); + sqsession_register($msort, 'msort'); + sqsession_register($msgs, 'msgs'); } break; @@ -410,25 +410,25 @@ function showMessagesForMailbox($imapConnection, $mailbox, $num_msgs, $sort = $server_sort_order; $allow_server_sort = FALSE; $msort = $msgs = array(); - session_register('msort'); - session_register('msgs'); + sqsession_register($msort, 'msort'); + sqsession_register($msgs, 'msgs'); $id = array(); } else { $sort = 6; $msort = $msgs; - session_register('msort'); - session_register('msgs'); + sqsession_register($msort, 'msort'); + sqsession_register($msgs, 'msgs'); } break; default: if (!$use_cache) { - session_unregister('msgs'); - session_unregister('msort'); + sqsession_unregister('msgs'); + sqsession_unregister('msort'); $msgs= getSelfSortMessages($imapConnection, $start_msg, $show_num, $num_msgs, $sort, $mbxresponse); $msort = calc_msort($msgs, $sort); - session_register('msort'); - session_register('msgs'); + sqsession_register($msort, 'msort'); + sqsession_register($msgs, 'msgs'); } /* !use cache */ break; } // switch