X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=src%2Fvcard.php;h=4c3790a273f1d85f5f76c10b2b48109fe1d3e790;hp=8aa55c2d5b32673ef6e283464df5e51d54e69905;hb=0b97a708e71c931153cd1ceee1495c9f4e1e209b;hpb=65c3ec94c897fb098598f3843e371020deb2226b diff --git a/src/vcard.php b/src/vcard.php index 8aa55c2d..4c3790a2 100644 --- a/src/vcard.php +++ b/src/vcard.php @@ -11,11 +11,26 @@ * $Id$ */ -require_once('../src/validate.php'); -require_once('../functions/date.php'); -require_once('../functions/page_header.php'); -require_once('../functions/mime.php'); -require_once('../src/load_prefs.php'); +/* Path for SquirrelMail required files. */ +define('SM_PATH','../'); + +/* SquirrelMail required files. */ +require_once(SM_PATH . 'include/validate.php'); +require_once(SM_PATH . 'functions/date.php'); +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 = $_SESISON['onetimepad']; + +$mailbox = $_GET['mailbox']; +$passed_id = $_GET['passed_id']; +$passed_ent_id = $_GET['passed_ent_id']; + +/* end globals */ $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); sqimap_mailbox_select($imapConnection, $mailbox); @@ -28,23 +43,17 @@ echo '
'; $message = sqimap_get_message($imapConnection, $passed_id, $mailbox); -$entity_vcard = getEntity($message,$passed_ent_id); +$entity_vcard = getEntity($message,$ent_id); -$vcard = mime_fetch_body ($imapConnection, $passed_id, $passed_ent_id); +$vcard = mime_fetch_body ($imapConnection, $passed_id, $ent_id); $vcard = decodeBody($vcard, $entity_vcard->header->encoding); $vcard = explode ("\n",$vcard); foreach ($vcard as $l) { @@ -59,7 +68,7 @@ foreach ($vcard as $l) { $k .= ';' . $attr; } - $v = ereg_replace(';', "\n", $v); + $v = str_replace(';', "\n", $v); $vcard_nice[$k] = $v; } @@ -190,9 +199,9 @@ echo '' . '' . '' . '
' . '
' . _("Viewing a Business Card") . " - "; -if (isset($where) && isset($what)) { - // from a search - echo '' . _("View message") . ''; -} else { - echo '' . _("View message") . ''; -} +$msg_url = 'read_body.php?' . $QUERY_STRING; +$msg_url = set_url_var($msg_url, 'ent_id', 0); +echo ''. _("View message") . ''; + echo '
' . - '' . + '' . _("Download this as a file") . '' . '
' . @@ -201,4 +210,4 @@ echo '' . '' . ''; -?> \ No newline at end of file +?>