function is_logged_in() {
- if ( session_is_registered('user_is_logged_in') ) {
+ if ( sqsession_is_registered('user_is_logged_in') ) {
return;
} else {
global $HTTP_POST_VARS, $PHP_SELF, $session_expired_post,
*/
$session_expired_post = $HTTP_POST_VARS;
$session_expired_location = $PHP_SELF;
- if (!session_is_registered('session_expired_post')) {
+ if (!sqsession_is_registered('session_expired_post')) {
session_register('session_expired_post');
}
- if (!session_is_registered('session_expired_location')) {
+ if (!sqsession_is_registered('session_expired_location')) {
session_register('session_expired_location');
}
include_once( '../functions/display_messages.php' );
}
}
-?>
\ No newline at end of file
+?>
}
function sqsession_register ($var, $name) {
- $rg = ini_get('register_globals');
- if ( (float)substr(PHP_VERSION,0,3) < 4.1 && empty($rg)) {
+ if ( (float)substr(PHP_VERSION,0,3) < 4.1 ) {
global $HTTP_SESSION_VARS;
$HTTP_SESSION_VARS["$name"] = $var;
}
else {
- session_register("$name");
+ $_SESSION["$name"] = $var;
}
}
function sqsession_unregister ($name) {
- $rg = ini_get('register_globals');
- if ( (float)substr(PHP_VERSION,0,3) < 4.1 && empty($rg)) {
- global $HTTP_SESSION_VARS;
+ if ( (float)substr(PHP_VERSION,0,3) < 4.1 ) {
+ global $HTTP_SESSION_VARS;
unset($HTTP_SESSION_VARS["$name"]);
}
else {
- session_unregister("$name");
+ unset($_SESSION["$name"]);
+ }
+}
+function sqsession_is_registered ($name) {
+ $test_name = &$name;
+ $result = false;
+ if ( (float)substr(PHP_VERSION,0,3) < 4.1 ) {
+ global $HTTP_SESSION_VARS;
+ if (isset($HTTP_SESSION_VARS[$test_name])) {
+ $result = true;
+ }
+ }
+ else {
+ if (isset($_SESSION[$test_name])) {
+ $result = true;
+ }
}
+ return $result;
}
+
/**
* Search for the var $name in $_SESSION, $_POST, $_GET
* (in that order) and register it as a global var.
$internal_date_sort, $server_sort_array,
$sent_folder, $mailbox, $uid_support;
- if (session_is_registered('server_sort_array')) {
+ if (sqsession_is_registered('server_sort_array')) {
sqsession_unregister('server_sort_array');
}
function sqimap_get_php_sort_order ($imap_stream, $mbxresponse) {
global $uid_support;
- if (session_is_registered('php_sort_array')) {
+ if (sqsession_is_registered('php_sort_array')) {
sqsession_unregister('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')) {
+ if (sqsession_is_registered('thread_new')) {
sqsession_unregister('thread_new');
}
- if (session_is_registered('server_sort_array')) {
+ if (sqsession_is_registered('server_sort_array')) {
sqsession_unregister('server_sort_array');
}
$sid = sqimap_session_id($uid_support);
$rg = ini_get('register_globals');
-if ( !session_is_registered('prefs_are_cached') ||
+if ( !sqsession_is_registered('prefs_are_cached') ||
!isset( $prefs_cache) ||
!is_array( $prefs_cache) ||
substr( phpversion(), 0, 3 ) == '4.1' ||
*/
//$session_expired = false;
sqsession_unregister('session_expired_post');
-if (false && session_is_registered('session_expired_post')) {
+if (false && sqsession_is_registered('session_expired_post')) {
global $session_expired_post, $session_expired;
/*
* extra check for username so we don't display previous post data from
exit;
}
-if (!session_is_registered('user_is_logged_in')) {
+if (!sqsession_is_registered('user_is_logged_in')) {
do_hook ('login_before');
$onetimepad = OneTimePadCreate(strlen($secretkey));
$use_mailbox_cache = 0;
}
-if ($use_mailbox_cache && session_is_registered('msgs')) {
+if ($use_mailbox_cache && sqsession_is_registered('msgs')) {
showMessagesForMailbox($imapConnection, $mailbox, $numMessages, $startMessage, $sort, $color, $show_num, $use_mailbox_cache);
} else {
- if (session_is_registered('msgs')) {
+ if (sqsession_is_registered('msgs')) {
unset($msgs);
}
- if (session_is_registered('msort')) {
+ if (sqsession_is_registered('msort')) {
unset($msort);
}
- if (session_is_registered('numMessages')) {
+ if (sqsession_is_registered('numMessages')) {
unset($numMessages);
}
$startMessage, $sort, $color, $show_num,
$use_mailbox_cache);
- if (session_is_registered('msgs') && isset($msgs)) {
+ if (sqsession_is_registered('msgs') && isset($msgs)) {
sqsession_register($msgs, 'msgs');
$_SESSION['msgs'] = $msgs;
}
- if (session_is_registered('msort') && isset($msort)) {
+ if (sqsession_is_registered('msort') && isset($msort)) {
sqsession_register($msort, 'msort');
$_SESSION['msort'] = $msort;
}
global $theme, $random_theme_good_themes;
-if (!session_is_registered('random_theme_good_theme')) {
+if (!sqsession_is_registered('random_theme_good_theme')) {
$good_themes = array();
foreach ($theme as $data) {
if (substr($data['PATH'], -18) != '/themes/random.php') {