/**
* right_main.php
*
- * Copyright (c) 1999-2002 The SquirrelMail Project Team
+ * Copyright (c) 1999-2003 The SquirrelMail Project Team
* Licensed under the GNU GPL. For full terms see the file COPYING.
*
* This is where the mailboxes are listed. This controls most of what
require_once(SM_PATH . 'include/validate.php');
require_once(SM_PATH . 'functions/imap.php');
require_once(SM_PATH . 'functions/date.php');
-require_once(SM_PATH . 'functions/array.php');
require_once(SM_PATH . 'functions/mime.php');
require_once(SM_PATH . 'functions/mailbox_display.php');
require_once(SM_PATH . 'functions/display_messages.php');
/* lets get the global vars we may need */
-$username = $_SESSION['username'];
-$key = $_COOKIE['key'];
-$onetimepad = $_SESSION['onetimepad'];
-$base_uri = $_SESSION['base_uri'];
-$delimiter = $_SESSION['delimiter'];
-
-if (isset($_GET['startMessage'])) {
- $startMessage = $_GET['startMessage'];
-} elseif (isset($_POST['startMessage'])) {
- $startMessage = $_POST['startMessage'];
-}
-if (isset($_GET['mailbox'])) {
- $mailbox = $_GET['mailbox'];
-} else if (isset($_POST['mailbox'])) {
- $mailbox = $_POST['mailbox'];
-}
-if (isset($_GET['PG_SHOWNUM'])) {
- $PG_SHOWNUM = $_GET['PG_SHOWNUM'];
+sqgetGlobalVar('key', $key, SQ_COOKIE);
+sqgetGlobalVar('username', $username, SQ_SESSION);
+sqgetGlobalVar('onetimepad',$onetimepad, SQ_SESSION);
+sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION);
+sqgetGlobalVar('base_uri', $base_uri, SQ_SESSION);
+
+sqgetGlobalVar('mailbox', $mailbox);
+sqgetGlobalVar('lastTargetMailbox', $lastTargetMailbox, SQ_SESSION);
+sqgetGlobalVar('session', $session, SQ_GET);
+sqgetGlobalVar('note', $note, SQ_GET);
+
+if ( sqgetGlobalVar('startMessage', $temp) ) {
+ $startMessage = (int) $temp;
}
-elseif (isset($_SESSION['PG_SHOWNUM'])) {
- $PG_SHOWNUM = $_SESSION['PG_SHOWNUM'];
+if ( sqgetGlobalVar('PG_SHOWNUM', $temp) ) {
+ $PG_SHOWNUM = (int) $temp;
}
-if (isset($_GET['PG_SHOWALL'])) {
- $PG_SHOWALL = $_GET['PG_SHOWALL'];
+if ( sqgetGlobalVar('PG_SHOWALL', $temp, SQ_GET) ) {
+ $PG_SHOWALL = (int) $temp;
}
-if (isset($_GET['newsort'])) {
- $newsort = $_GET['newsort'];
+if ( sqgetGlobalVar('newsort', $temp, SQ_GET) ) {
+ $newsort = (int) $temp;
}
-if (isset($_GET['checkall'])) {
- $checkall = $_GET['checkall'];
+if ( sqgetGlobalVar('checkall', $temp, SQ_GET) ) {
+ $checkall = (int) $temp;
}
-if (isset($_GET['set_thread'])) {
- $set_thread = $_GET['set_thread'];
+if ( sqgetGlobalVar('set_thread', $temp, SQ_GET) ) {
+ $set_thread = (int) $temp;
}
-if (isset($_SESSION['lastTargetMailbox'])) {
- $lastTargetMailbox =$_SESSION['lastTargetMailbox'];
+if ( !sqgetGlobalVar('composenew', $composenew, SQ_GET) ) {
+ $composenew = false;
}
-
/* end of get globals */
sqimap_mailbox_select($imapConnection, $mailbox);
-if (isset($composenew) && $composenew) {
- $comp_uri = '../src/compose.php?mailbox='. urlencode($mailbox).
- "&session=$composesession";
+if ($composenew) {
+ $comp_uri = SM_PATH . 'src/compose.php?mailbox='. urlencode($mailbox).
+ "&session=$session";
displayPageHeader($color, $mailbox, "comp_in_new('$comp_uri');", false);
} else {
displayPageHeader($color, $mailbox);
$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;
}