From: Tomas K. <to...@us...> - 2004-09-07 13:54:26
|
Update of /cvsroot/squirrelmail/squirrelmail/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31444 Modified Files: printer_friendly_bottom.php printer_friendly_main.php printer_friendly_top.php Log Message: removed require_once() calls that are already loaded by include/validate.php converted $_GET's to sqgetGlobalVar's and added validation. Index: printer_friendly_bottom.php =================================================================== RCS file: /cvsroot/squirrelmail/squirrelmail/src/printer_friendly_bottom.php,v retrieving revision 1.36 retrieving revision 1.37 diff -u -w -r1.36 -r1.37 --- printer_friendly_bottom.php 15 Aug 2004 23:18:30 -0000 1.36 +++ printer_friendly_bottom.php 7 Sep 2004 13:54:10 -0000 1.37 @@ -23,12 +23,7 @@ /* SquirrelMail required files. */ require_once(SM_PATH . 'include/validate.php'); -require_once(SM_PATH . 'functions/strings.php'); -require_once(SM_PATH . 'config/config.php'); -require_once(SM_PATH . 'include/load_prefs.php'); require_once(SM_PATH . 'functions/imap.php'); -require_once(SM_PATH . 'functions/page_header.php'); -require_once(SM_PATH . 'functions/html.php'); /* get some of these globals */ sqgetGlobalVar('username', $username, SQ_SESSION); @@ -43,7 +38,7 @@ } /* end globals */ -$pf_cleandisplay = getPref($data_dir, $username, 'pf_cleandisplay'); +$pf_cleandisplay = getPref($data_dir, $username, 'pf_cleandisplay', false); $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); $mbx_response = sqimap_mailbox_select($imapConnection, $mailbox); if (isset($messages[$mbx_response['UIDVALIDITY']][$passed_id])) { @@ -86,7 +81,7 @@ /* now, if they choose to, we clean up the display a bit... */ -if ( empty($pf_cleandisplay) || $pf_cleandisplay != 'no' ) { +if ($pf_cleandisplay) { $num_leading_spaces = 9; // nine leading spaces for indentation @@ -155,7 +150,16 @@ /* --start pf-specific functions-- */ -/* $string = pf_clean_string($string, 9); */ +/** + * Function should clean layout of printed messages when user + * enables "Printer Friendly Clean Display" option. + * + * @param string unclean_string + * @param integer num_leading_spaces + * @return string + * @example $string = pf_clean_string($string, 9); + * @access private + */ function pf_clean_string ( $unclean_string, $num_leading_spaces ) { global $data_dir, $username; $unclean_string = str_replace(' ',' ',$unclean_string); @@ -190,5 +194,4 @@ } /* end pf_clean_string() function */ /* --end pf-specific functions */ - ?> \ No newline at end of file Index: printer_friendly_main.php =================================================================== RCS file: /cvsroot/squirrelmail/squirrelmail/src/printer_friendly_main.php,v retrieving revision 1.18 retrieving revision 1.19 diff -u -w -r1.18 -r1.19 --- printer_friendly_main.php 16 Aug 2004 00:04:29 -0000 1.18 +++ printer_friendly_main.php 7 Sep 2004 13:54:10 -0000 1.19 @@ -1,11 +1,9 @@ <?php - /** - * printer_friendly_main.php - * - * Copyright (c) 1999-2004 The SquirrelMail Project Team - * Licensed under the GNU GPL. For full terms see the file COPYING. + * printer_friendly frameset * + * @copyright (c) 1999-2004 The SquirrelMail Project Team + * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id$ * @package squirrelmail */ @@ -18,21 +16,26 @@ /* SquirrelMail required files. */ require_once(SM_PATH . 'include/validate.php'); -require_once(SM_PATH . 'functions/page_header.php'); - -displayHtmlHeader( _("Printer Friendly"), '', FALSE ); /* get those globals into gear */ -$passed_ent_id = $_GET['passed_ent_id']; -$passed_id = (int) $_GET['passed_id']; -$mailbox = $_GET['mailbox']; +global $color; +if ( ! sqgetGlobalVar('passed_ent_id',$passed_ent_id,SQ_GET)) + $passed_ent_id = 0; +if ( ! sqgetGlobalVar('mailbox',$mailbox,SQ_GET) || + ! sqgetGlobalVar('passed_id',$passed_id,SQ_GET)) { + error_box(_("Invalid URL"),$color); +} else { + $passed_id= (int) $passed_id; /* end globals */ + displayHtmlHeader( _("Printer Friendly"), '', false, true ); + echo '<frameset rows="60, *">' . "\n"; + echo '<frame src="printer_friendly_top.php" name="top_frame" ' + . 'scrolling="no" noresize="noresize" frameborder="0">' . "\n"; + echo '<frame src="printer_friendly_bottom.php?passed_ent_id=' + . urlencode($passed_ent_id) . '&mailbox=' . urlencode($mailbox) + . '&passed_id=' . $passed_id + . '" name="bottom_frame" frameborder="0">' . "\n"; + echo "</frameset>\n"; +} ?> -<frameset rows="60, *" noresize="noresize" border="0"> - <frame src="printer_friendly_top.php" name="top_frame" scrolling="no" /> - <frame src="printer_friendly_bottom.php?passed_ent_id=<?php - echo urlencode($passed_ent_id) . '&mailbox=' . urlencode($mailbox) . - '&passed_id=' . $passed_id; - ?>" name="bottom_frame" /> -</frameset> </html> Index: printer_friendly_top.php =================================================================== RCS file: /cvsroot/squirrelmail/squirrelmail/src/printer_friendly_top.php,v retrieving revision 1.18 retrieving revision 1.19 diff -u -w -r1.18 -r1.19 --- printer_friendly_top.php 16 Aug 2004 00:05:42 -0000 1.18 +++ printer_friendly_top.php 7 Sep 2004 13:54:11 -0000 1.19 @@ -1,14 +1,12 @@ <?php - /** - * printer_friendly_top.php - * - * Copyright (c) 1999-2004 The SquirrelMail Project Team - * Licensed under the GNU GPL. For full terms see the file COPYING. + * printer_friendly top frame * * top frame of printer_friendly_main.php * displays some javascript buttons for printing & closing * + * @copyright (c) 1999-2004 The SquirrelMail Project Team + * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id$ * @package squirrelmail */ @@ -21,11 +19,6 @@ /* SquirrelMail required files. */ require_once(SM_PATH . 'include/validate.php'); -require_once(SM_PATH . 'functions/strings.php'); -require_once(SM_PATH . 'config/config.php'); -require_once(SM_PATH . 'include/load_prefs.php'); -require_once(SM_PATH . 'functions/page_header.php'); -require_once(SM_PATH . 'functions/html.php'); displayHtmlHeader( _("Printer Friendly"), "<script language=\"javascript\" type=\"text/javascript\">\n". |