Added a check in sqimap_login to verify $onetimepad is set. Not sure why
[squirrelmail.git] / src / vcard.php
index ef0ff40e1e4d0d0dd31cc32f1c7682365adf590f..2560fe6210c2c53d1ca520aef29e7609ae124000 100644 (file)
@@ -3,7 +3,7 @@
 /**
  * vcard.php
  *
- * Copyright (c) 1999-2002 The SquirrelMail Project Team
+ * Copyright (c) 1999-2003 The SquirrelMail Project Team
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  *
  * This file shows an attched vcard
@@ -12,7 +12,7 @@
  */
 
 /* Path for SquirrelMail required files. */
-define('SM_PATH','../');
+Define('SM_PATH','../');
 
 /* SquirrelMail required files. */
 require_once(SM_PATH . 'include/validate.php');
@@ -21,6 +21,17 @@ require_once(SM_PATH . 'functions/page_header.php');
 require_once(SM_PATH . 'functions/mime.php');
 require_once(SM_PATH . 'include/load_prefs.php');
 
+/* globals */
+$key  = $_COOKIE['key'];
+$username = $_SESSION['username'];
+$onetimepad = $_SESSION['onetimepad'];
+$mailbox = decodeHeader($_GET['mailbox']);
+$passed_id = (int) $_GET['passed_id'];
+$ent_id = $_GET['ent_id'];
+$passed_ent_id = $_GET['passed_ent_id'];
+$startMessage = (int) $_GET['startMessage'];
+/* end globals */
+
 $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
 sqimap_mailbox_select($imapConnection, $mailbox);
 
@@ -32,8 +43,12 @@ echo '<br><table width="100%" border="0" cellspacing="0" cellpadding="2" ' .
         '<tr><td bgcolor="' . $color[0] . '">' .
         '<b><center>' .
         _("Viewing a Business Card") . " - ";
-$msg_url = 'read_body.php?' . $QUERY_STRING;
+$msg_url = 'read_body.php?mailbox='.urlencode($mailbox).
+    '&amp;startMessage='.$startMessage.
+    '&amp;passed_id='.$passed_id;
+
 $msg_url = set_url_var($msg_url, 'ent_id', 0);
+
 echo '<a href="'.$msg_url.'">'. _("View message") . '</a>';
 
 echo '</center></b></td></tr>';
@@ -190,7 +205,7 @@ echo '</select>' .
         '<tr><td align=center>' .
         '<a href="../src/download.php?absolute_dl=true&amp;passed_id=' .
         $passed_id . '&amp;mailbox=' . urlencode($mailbox) .
-        '&amp;passed_ent_id=' . $passed_ent_id . '">' .
+        '&amp;passed_ent_id=' . urlencode($passed_ent_id) . '">' .
         _("Download this as a file") . '</A>' .
         '</TD></TR></TABLE>' .