require_once(SM_PATH . 'functions/display_messages.php');
require_once(SM_PATH . 'functions/imap.php');
-$key = $_COOKIE['key'];
-$username = $_SESSION['username'];
-$onetimepad = $_SESSION['onetimepad'];
-
-$message = $_GET['message'];
-$mailbox = $_GET['mailbox'];
+/* get globals */
+sqgetGlobalVar('username', $username, SQ_SESSION);
+sqgetGlobalVar('key', $key, SQ_COOKIE);
+sqgetGlobalVar('onetimepad', $onetimepad, SQ_SESSION);
+
+sqgetGlobalVar('message', $message, SQ_GET);
+sqgetGlobalVar('mailbox', $mailbox, SQ_GET);
+/* end globals */
if (isset($_GET['saved_draft'])) {
$saved_draft = urlencode($_GET['saved_draft']);
/* get those globals */
-$key = $_COOKIE['key'];
-$username = $_SESSION['username'];
-$onetimepad = $_SESSION['onetimepad'];
-$delimiter = $_SESSION['delimiter'];
+sqgetGlobalVar('username', $username, SQ_SESSION);
+sqgetGlobalVar('key', $key, SQ_COOKIE);
+sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION);
+sqgetGlobalVar('onetimepad', $onetimepad, SQ_SESSION);
/* finished globals */
/* get globals we may need */
-$username = $_SESSION['username'];
-$key = $_COOKIE['key'];
-$delimiter = $_SESSION['delimiter'];
-$onetimepad = $_SESSION['onetimepad'];
-if (isset($_GET['success'])) {
- $success = $_GET['success'];
-}
+sqgetGlobalVar('username', $username, SQ_SESSION);
+sqgetGlobalVar('key', $key, SQ_COOKIE);
+sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION);
+sqgetGlobalVar('onetimepad', $onetimepad, SQ_SESSION);
+
+sqgetGlobalVar('success', $success, SQ_GET);
/* end of get globals */
/* -------------------- MAIN ------------------------ */
-$key = $_COOKIE['key'];
-$onetimepad = $_SESSION['onetimepad'];
-$username = $_SESSION['username'];
-$delimiter = $_SESSION['delimiter'];
+/* get globals */
+sqgetGlobalVar('username', $username, SQ_SESSION);
+sqgetGlobalVar('key', $key, SQ_COOKIE);
+sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION);
+sqgetGlobalVar('onetimepad', $onetimepad, SQ_SESSION);
-if (isset($_GET['fold'])) {
- $fold = $_GET['fold'];
-}
-if (isset($_GET['unfold'])) {
- $unfold = $_GET['unfold'];
-}
+sqgetGlobalVar('fold', $fold, SQ_GET);
+sqgetGlobalVar('unfold', $unfold, SQ_GET);
+
+/* end globals */
// open a connection on the imap port (143)
$imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 10); // the 10 is to hide the output
require_once(SM_PATH . 'functions/html.php');
/* get some of these globals */
-$key = $_COOKIE['key'];
-$username = $_SESSION['username'];
-$onetimepad = $_SESSION['onetimepad'];
+sqgetGlobalVar('username', $username, SQ_SESSION);
+sqgetGlobalVar('key', $key, SQ_COOKIE);
+sqgetGlobalVar('onetimepad', $onetimepad, SQ_SESSION);
-$passed_id = (int) $_GET['passed_id'];
-$mailbox = $_GET['mailbox'];
+sqgetGlobalVar('passed_id', $passed_id, SQ_GET);
+sqgetGlobalVar('mailbox', $mailbox, SQ_GET);
-if (!isset($_GET['passed_ent_id'])) {
+if (! sqgetGlobalVar('passed_ent_id', $passed_ent_id, SQ_GET) ) {
$passed_ent_id = '';
-} else {
- $passed_ent_id = $_GET['passed_ent_id'];
-}
+}
/* end globals */
$pf_cleandisplay = getPref($data_dir, $username, 'pf_cleandisplay');
echo html_tag( 'div', '<b>' . $note .'</b>', 'center' ) . "<br>\n";
}
-if (isset($_SESSION['just_logged_in'])) {
- $just_logged_in = $_SESSION['just_logged_in'];
+if ( sqgetGlobalVar('just_logged_in', $just_logged_in, SQ_SESSION) ) {
if ($just_logged_in == true) {
$just_logged_in = false;
/* get globals we may need */
-$key = $_COOKIE['key'];
-$username = $_SESSION['username'];
-$onetimepad = $_SESSION['onetimepad'];
-$delimiter = $_SESSION['delimiter'];
+sqgetGlobalVar('username', $username, SQ_SESSION);
+sqgetGlobalVar('key', $key, SQ_COOKIE);
+sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION);
+sqgetGlobalVar('onetimepad', $onetimepad, SQ_SESSION);
if (isset($_GET['mailbox'])) {
$mailbox = strip_tags($_GET['mailbox']);
$perbox_count = array ();
$recent_count = getPref($data_dir, $username, 'search_memory', 0);
-/* get globals we may need */
-
-$key = $_COOKIE['key'];
-$username = $_SESSION['username'];
-$onetimepad = $_SESSION['onetimepad'];
-$delimiter = $_SESSION['delimiter'];
-
-if (isset($_GET['mailbox'])) {
- $mailbox = strip_tags($_GET['mailbox']);
-}
-if (isset($_GET['submit'])) {
- $submit = strip_tags($_GET['submit']);
-}
-if (isset($_GET['what'])) {
- $what = $_GET['what'];
-}
-if (isset($_GET['where'])) {
- $where = strip_tags($_GET['where']);
-}
-if (isset($_GET['checkall'])) {
- $checkall = strip_tags($_GET['checkall']);
-}
-if (isset($_GET['count'])) {
- $count = strip_tags($_GET['count']);
-}
-
/* get mailbox names */
$imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
$boxes = sqimap_mailbox_list($imapConnection);
/* If a user hits reload on the last page, $base_uri isn't set
* because it was deleted with the session. */
-if (!isset($_SESSION['base_uri'])) {
- if (!function_exists('sqm_baseuri')){
- require_once(SM_PATH . 'functions/display_messages.php');
- }
+if (! sqgetGlobalVar('base_uri', $base_uri, SQ_SESSION) ) {
+ require_once(SM_PATH . 'functions/display_messages.php');
$base_uri = sqm_baseuri();
-} else {
- $base_uri = $_SESSION['base_uri'];
}
do_hook('logout');
require_once(SM_PATH . 'include/load_prefs.php');
/* globals */
-$key = $_COOKIE['key'];
-$username = $_SESSION['username'];
-$onetimepad = $_SESSION['onetimepad'];
-$mailbox = $_GET['mailbox'];
-$passed_id = (int) $_GET['passed_id'];
-$ent_id = $_GET['ent_id'];
-$startMessage = (int) $_GET['startMessage'];
+sqgetGlobalVar('username', $username, SQ_SESSION);
+sqgetGlobalVar('key', $key, SQ_COOKIE);
+sqgetGlobalVar('onetimepad', $onetimepad, SQ_SESSION);
+
+sqgetGlobalVar('passed_id', $passed_id, SQ_GET);
+sqgetGlobalVar('mailbox', $mailbox, SQ_GET);
+sqgetGlobalVar('ent_id', $ent_id, SQ_GET);
+sqgetGlobalVar('startMessage', $startMessage, SQ_GET);
/* end globals */
$imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
session_start();
-if (isset($_SESSION['username'])) {
- $username = $_SESSION['username'];
-}
-if (isset($_SESSION['delimiter'])) {
- $delimiter = $_SESSION['delimiter'];
-}
-if (isset($_SESSION['onetimepad'])) {
- $onetimepad = $_SESSION['onetimepad'];
-}
-if (isset($_GET['right_frame'])) {
- $right_frame = $_GET['right_frame'];
-}
+sqgetGlobalVar('username', $username, SQ_SESSION);
+sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION);
+sqgetGlobalVar('onetimepad', $onetimepad, SQ_SESSION);
+
+sqgetGlobalVar('right_frame', $right_frame, SQ_GET);
+
if ( isset($_SESSION['session_expired_post']) ) {
sqsession_unregister('session_expired_post');
}