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)) {
$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 {
* $Id$
*/
-global $prefs_are_cached, $prefs_cache;
-
/**
* Check the preferences into the session cache.
*/
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");
$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');
}
/**
* $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() {
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;
}
$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)) {
* 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);
$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);
$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;
}
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;
}
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);
$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;
}
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 ();
}
}
}
- 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;
}
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) {
'</center></small></b>';
$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;
$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