Source for file right_main.php
Documentation is available at right_main.php
* This is where the mailboxes are listed. This controls most of what
* goes on in SquirrelMail.
* @copyright 1999-2020 The SquirrelMail Project Team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id: right_main.php 14840 2020-01-07 07:42:38Z pdontthink $
/** This is the right_main page */
define('PAGE_NAME', 'right_main');
* Path for SquirrelMail required files.
/* SquirrelMail required files. */
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/mime.php');
require_once(SM_PATH .
'functions/mailbox_display.php');
require_once(SM_PATH .
'functions/display_messages.php');
require_once(SM_PATH .
'functions/html.php');
/***********************************************************
* incoming variables from URL: *
* $sort Direction to sort by date *
* values: 0 - descending order *
* values: 1 - ascending order *
* $startMessage Message to start at *
* $mailbox Full Mailbox name *
* incoming from cookie: *
* incoming from session: *
***********************************************************/
// Disable Browser Caching //
header('Cache-Control: no-cache, no-store, must-revalidate');
header('Expires: Sat, 1 Jan 2000 00:00:00 GMT');
/* lets get the global vars we may need */
$startMessage = (int)
$temp;
$PG_SHOWNUM = (int)
$temp;
$PG_SHOWALL = (int)
$temp;
$set_thread = (int)
$temp;
/* Open a connection on the imap port (143) */
global $imap_stream_options; // in case not defined in config
$imapConnection =
sqimap_login($username, $key, $imapServerAddress, $imapPort, 0, $imap_stream_options);
if (isset
($PG_SHOWALL)) {
else if( isset
( $PG_SHOWNUM ) ) {
if (!isset
($show_num) ||
empty($show_num) ||
($show_num ==
0)) {
setPref($data_dir, $username, 'show_num' , 15);
if (isset
($newsort) &&
$newsort !=
$sort) {
setPref($data_dir, $username, 'sort', $newsort);
/* If the page has been loaded without a specific mailbox, */
/* send them to the inbox */
if (!isset
($startMessage) ||
($startMessage ==
'')) {
/* decide if we are thread sorting or not */
if (!empty($allow_thread_sort) &&
($allow_thread_sort ==
TRUE)) {
if (isset
($set_thread)) {
setPref($data_dir, $username, "thread_$mailbox", 1);
$thread_sort_messages =
'1';
elseif ($set_thread ==
2) {
setPref($data_dir, $username, "thread_$mailbox", 0);
$thread_sort_messages =
'0';
$thread_sort_messages =
getPref($data_dir, $username, "thread_$mailbox");
$thread_sort_messages =
0;
// the preg_match() is a fix for Dovecot wherein UIDs can be bigger than
// normal integers - this isn't in 1.4 yet, but when adding new code, why not...
do_hook('right_main_after_header');
if ($just_logged_in ==
true) {
'', $color[4], 'width="100%" cellpadding="5" cellspacing="1" border="0"' )
'center', $color[9], 'width="70%" cellpadding="0" cellspacing="3" border="0"' );
/*********************************************************************
* Check to see if we can use cache or not. Currently the only time *
* when you will not use it is when a link on the left hand frame is *
* used. Also check to make sure we actually have the array in the *
* registered session data. :) *
*********************************************************************/
if (! isset
($use_mailbox_cache)) {
showMessagesForMailbox($imapConnection, $mailbox, $numMessages, $startMessage, $sort, $color, $show_num, $use_mailbox_cache);
// set 8th argument to false in order to make sure that cache is not used.
$startMessage, $sort, $color, $show_num,
Documentation generated on Mon, 13 Jan 2020 04:25:14 +0100 by phpDocumentor 1.4.3