* Licensed under the GNU GPL. For full terms see the file COPYING.
*
* with javascript on, it is the bottom frame of printer_friendly_main.php
* Licensed under the GNU GPL. For full terms see the file COPYING.
*
* with javascript on, it is the bottom frame of printer_friendly_main.php
-$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);
$imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
$mbx_response = sqimap_mailbox_select($imapConnection, $mailbox);
if (isset($messages[$mbx_response['UIDVALIDITY']][$passed_id])) {
$imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
$mbx_response = sqimap_mailbox_select($imapConnection, $mailbox);
if (isset($messages[$mbx_response['UIDVALIDITY']][$passed_id])) {
/* headers (we use table because translations are not all the same width) */
html_tag( 'table', '', 'center', '', 'cellspacing="0" cellpadding="0" border="0" width="100%"' ) .
html_tag( 'tr',
html_tag( 'td', _("From").' ', 'left' ,'','valign="top"') .
/* headers (we use table because translations are not all the same width) */
html_tag( 'table', '', 'center', '', 'cellspacing="0" cellpadding="0" border="0" width="100%"' ) .
html_tag( 'tr',
html_tag( 'td', _("From").' ', 'left' ,'','valign="top"') .
) . "\n" .
html_tag( 'tr',
html_tag( 'td', _("Subject").' ', 'left','','valign="top"' ) .
) . "\n" .
html_tag( 'tr',
html_tag( 'td', _("Subject").' ', 'left','','valign="top"' ) .
) . "\n" .
html_tag( 'tr',
html_tag( 'td', _("To").' ', 'left','','valign="top"' ) .
) . "\n" .
html_tag( 'tr',
html_tag( 'td', _("To").' ', 'left','','valign="top"' ) .
if ( strlen($cc) > 0 ) { /* only show CC: if it's there... */
echo html_tag( 'tr',
html_tag( 'td', _("CC").' ', 'left','','valign="top"' ) .
if ( strlen($cc) > 0 ) { /* only show CC: if it's there... */
echo html_tag( 'tr',
html_tag( 'td', _("CC").' ', 'left','','valign="top"' ) .
/* $string = pf_clean_string($string, 9); */
function pf_clean_string ( $unclean_string, $num_leading_spaces ) {
global $data_dir, $username;
/* $string = pf_clean_string($string, 9); */
function pf_clean_string ( $unclean_string, $num_leading_spaces ) {
global $data_dir, $username;
$wrap_at = getPref($data_dir, $username, 'wrap_at', 86);
$wrap_at = $wrap_at - $num_leading_spaces; /* header stuff */
$wrap_at = getPref($data_dir, $username, 'wrap_at', 86);
$wrap_at = $wrap_at - $num_leading_spaces; /* header stuff */
- $clean_string .= substr( $this_line, 0, strrpos( $this_line, ' ' ));
- $clean_string .= "\n" . $leading_spaces;
- $unclean_string = substr($unclean_string, (1+strrpos( $this_line, ' ' )));
- }
+ $i = strrpos( $this_line, ' ');
+ $clean_string .= substr( $this_line, 0, $i);
+ $clean_string .= "\n" . $leading_spaces;
+ $unclean_string = substr($unclean_string, 1+$i);
+ }