X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fvcard.php;h=417ea07c3f74158648d6bedb6d663d522963238a;hb=879694a5dec8ecc4fa9156d7fd30eee9788067ac;hp=21b5133861802312ba463d9d5d6a5c76b39d9dec;hpb=24d1619523e7005477feb74d9a54da6a0efc58a6;p=squirrelmail.git diff --git a/src/vcard.php b/src/vcard.php index 21b51338..417ea07c 100644 --- a/src/vcard.php +++ b/src/vcard.php @@ -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 @@ -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 = $_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); @@ -28,8 +43,12 @@ echo '
'; @@ -50,7 +69,7 @@ foreach ($vcard as $l) { if ($attr == 'quoted-printable') $v = quoted_printable_decode($v); else - $k .= ';' . $attr; + $k .= ';' . strtolower($attr); } $v = str_replace(';', "\n", $v); @@ -59,10 +78,15 @@ foreach ($vcard as $l) { if ($vcard_nice['version'] == '2.1') { // get firstname and lastname for sm addressbook - $vcard_nice["firstname"] = substr($vcard_nice["n"], - strpos($vcard_nice["n"], "\n") + 1, strlen($vcard_nice["n"])); - $vcard_nice["lastname"] = substr($vcard_nice["n"], 0, - strpos($vcard_nice["n"], "\n")); + $vcard_nice['firstname'] = substr($vcard_nice['n'], + strpos($vcard_nice['n'], "\n") + 1, strlen($vcard_nice['n'])); + $vcard_nice['lastname'] = substr($vcard_nice['n'], 0, + strpos($vcard_nice['n'], "\n")); + // workaround for Outlook, should be fixed in a better way, + // maybe in new 'vCard' class. + if (isset($vcard_nice['email;pref;internet'])) { + $vcard_nice['email;internet'] = $vcard_nice['email;pref;internet']; + } } else { echo '
' . '
' . _("Viewing a Business Card") . " - "; -$msg_url = 'read_body.php?' . $QUERY_STRING; +$msg_url = 'read_body.php?mailbox='.urlencode($mailbox). + '&startMessage='.$startMessage. + '&passed_id='.$passed_id; + $msg_url = set_url_var($msg_url, 'ent_id', 0); + echo ''. _("View message") . ''; echo '
vCard Version ' . $vcard_nice['version'] . ' is not supported. Some information might not be converted ' . @@ -186,7 +210,7 @@ echo '' . '
' . '' . + '&passed_ent_id=' . urlencode($passed_ent_id) . '">' . _("Download this as a file") . '' . '
' .