X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fdownload.php;h=bdd2a23c3b45448b5bebc8d64ef4735eceb0715a;hb=2714d4ff9d44c2f27e413f49062247dc25558877;hp=89f7c0430310d840cd8959aa297acbe8c3bf3671;hpb=3530b83b1f8d5d7afe9508ab081e40ac9af8b599;p=squirrelmail.git
diff --git a/src/download.php b/src/download.php
index 89f7c043..bdd2a23c 100644
--- a/src/download.php
+++ b/src/download.php
@@ -3,380 +3,118 @@
/**
* download.php
*
- * Copyright (c) 1999-2002 The SquirrelMail Project Team
+ * Copyright (c) 1999-2004 The SquirrelMail Project Team
* Licensed under the GNU GPL. For full terms see the file COPYING.
*
* Handles attachment downloads to the users computer.
* Also allows displaying of attachments when possible.
*
- * $Id$
+ * @version $Id$
+ * @package squirrelmail
*/
-require_once('../src/validate.php');
-require_once('../functions/imap.php');
-require_once('../functions/mime.php');
-require_once('../functions/date.php');
-require_once('../functions/html.php');
+/**
+ * Path for SquirrelMail required files.
+ * @ignore
+ */
+define('SM_PATH','../');
+
+/* SquirrelMail required files. */
+require_once(SM_PATH . 'include/validate.php');
+require_once(SM_PATH . 'functions/imap.php');
+require_once(SM_PATH . 'functions/mime.php');
header('Pragma: ');
header('Cache-Control: cache');
-function viewText($color, $body, $id, $entid, $mailbox, $type1, $wrap_at, $imapConnection) {
- global $where, $what, $charset;
- global $startMessage;
-
- displayPageHeader($color, 'None');
-
- if ($where && $what) {
- // from a search
- $message_link_str = "". _("View message") . "";
- } else {
- $message_link_str = "". _("View message") . "";
- }
- $urlmailbox = urlencode($mailbox);
-
- echo '
' .
- html_tag( 'table',
- html_tag( 'tr',
- html_tag( 'td',
- '
". - //" |
";
-
- html_tag( 'table',
- html_tag( 'tr',
- html_tag( 'td', '' . $body . '', 'left', $color[4] )
- ) ,
- 'center', '', 'width="98%" border="0" cellspacing="0" cellpadding="2"' );
+/* globals */
+sqgetGlobalVar('key', $key, SQ_COOKIE);
+sqgetGlobalVar('username', $username, SQ_SESSION);
+sqgetGlobalVar('onetimepad', $onetimepad, SQ_SESSION);
+sqgetGlobalVar('messages', $messages, SQ_SESSION);
+sqgetGlobalVar('mailbox', $mailbox, SQ_GET);
+sqgetGlobalVar('ent_id', $ent_id, SQ_GET);
+sqgetGlobalVar('absolute_dl',$absolute_dl, SQ_GET);
+if ( sqgetGlobalVar('passed_id', $temp, SQ_GET) ) {
+ $passed_id = (int) $temp;
}
-function viewMessage($imapConnection, $id, $mailbox, $ent_id, $color, $wrap_at, $extracted) {
- global $startMessage;
-
-
- $msg = sqimap_get_message($imapConnection, $id, $mailbox);
- $msg = getEntity($msg, $ent_id);
-
- $header = sqimap_get_ent_header($imapConnection,$id,$mailbox,$ent_id);
- $header->id = $id;
- $msg->header = $header;
-
- $ent_ar = findDisplayEntity($msg, 0);
- $body = '';
- for ($i = 0; $i < count($ent_ar); $i++) {
- $body .= formatBody($imapConnection, $msg, $color, $wrap_at, $ent_ar[$i], false);
- }
-
- $bodyheader = viewHeader($header, $color);
- displayPageHeader($color, 'None');
-
- echo ' ' . - html_tag( 'table', '', 'center', '', 'width="100%" border="0" cellspacing="0" cellpadding="2"' ); - - if ($extracted) { - echo html_tag( 'tr', - html_tag( 'td', ' Message succesfully extracted". - " |