From 83c6d490e09c9e7361f5f9b13be5861c7c8786bb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Wed, 13 Jun 2007 21:16:15 +0000 Subject: [PATCH] * put the vcard we just read back in. --- ctdlphp/ctdlprotocol.php | 75 ++++++++++++++++++++++++++++++++++++++++ ctdlphp/myinfo.php | 63 +++++++++++++++++---------------- 2 files changed, 109 insertions(+), 29 deletions(-) diff --git a/ctdlphp/ctdlprotocol.php b/ctdlphp/ctdlprotocol.php index 4b921f223..7a332052b 100644 --- a/ctdlphp/ctdlprotocol.php +++ b/ctdlphp/ctdlprotocol.php @@ -8,6 +8,10 @@ include "config_ctdlclient.php"; +define("FMT_CITADEL", 0); +define("FMT_FIXED", 1); +define("FMT_RFC822", 4); + //-------------------------------------------------------------------------------- // internal functions for server communication //-------------------------------------------------------------------------------- @@ -718,5 +722,76 @@ function download_attachment($msgnum, $attindex) } +function enter_message_0($msgHdr, $contentType, $data) +{ + $send = array(); + + if (isset($msgHdr['newusermail'])) + array_unshift($send, $msgHdr['newusermail']); + else + array_unshift($send, ""); + + if (isset($msgHdr['supplied_euid'])) + array_unshift($send, $msgHdr['supplied_euid']); + else + array_unshift($send, ""); + + if (isset($msgHdr['bcc'])) + array_unshift($send, $msgHdr['bcc']); + else + array_unshift($send, ""); + + if (isset($msgHdr['cc'])) + array_unshift($send, $msgHdr['cc']); + else + array_unshift($send, ""); + + if (isset($msgHdr['do_confirm'])) + array_unshift($send, $msgHdr['do_confirm']); + else + array_unshift($send, ""); + + if (isset($msgHdr['newusername'])) + array_unshift($send, $msgHdr['newusername']); + else + array_unshift($send, ""); + + if (isset($msgHdr['subject'])) + array_unshift($send, $msgHdr['subject']); + else + array_unshift($send, ""); + + if (isset($msgHdr['format_type'])) + array_unshift($send, $msgHdr['format_type']); + else + array_unshift($send, ""); + + if (isset($msgHdr['anon_flag'])) + array_unshift($send, $msgHdr['anon_flag']); + else + array_unshift($send, ""); + + if (isset($msgHdr['recp'])) + array_unshift($send, $msgHdr['recp']); + else + array_unshift($send, ""); + + if (isset($msgHdr['post'])) + array_unshift($send, $msgHdr['post']); + else + array_unshift($send, ""); + + $params = implode('|', $send); + serv_puts("ENT0 ".$params); + + $reply=serv_gets(); + if (substr($reply, 0, 1) != 4) + return array(false, array(), array()); + serv_puts("Content-type: ".$contentType); + serv_puts(""); + serv_puts($data."\r\n"); + serv_puts("000"); +} + ?> diff --git a/ctdlphp/myinfo.php b/ctdlphp/myinfo.php index 41007e27e..5f0ebf40e 100644 --- a/ctdlphp/myinfo.php +++ b/ctdlphp/myinfo.php @@ -1,37 +1,42 @@
\n" ; - - echo "" . - "" . - "" . - "" . - "" . - "" ; - - ctdl_goto("My Citadel Config"); - list($num_msgs, $response, $msgs) = ctdl_msgs("", ""); - - echo "num_msgs: " . $num_msgs . "
\n" ; - echo "response: " . htmlspecialchars($response) . "
\n" ; - - if ($num_msgs > 0) foreach ($msgs as $msgnum) { - print_r($msgnum); - $result = get_message_partlist($msgnum); - if (is_array($result) && - ($result[4]=="text/x-vcard")) - { - list($size, $vcard) = download_attachment($msgnum, $result[2]); - } +include "ctdlheader.php"; +bbs_page_header(); + +echo "This is an example of the use of " . +"ctdl_get_registration_info() to display " . +"your personal data.

\n" ; + +echo "
UserRoomHost
" . +"" . +"" . +"" . +"" . +"" ; + +ctdl_goto("My Citadel Config"); +list($num_msgs, $response, $msgs) = ctdl_msgs("", ""); + +echo "num_msgs: " . $num_msgs . "
\n" ; +echo "response: " . htmlspecialchars($response) . "
\n" ; + +if ($num_msgs > 0) foreach ($msgs as $msgnum) { + print_r($msgnum); + $result = get_message_partlist($msgnum); + if (is_array($result) && + ($result[4]=="text/x-vcard")) + { + list($size, $vcard) = download_attachment($msgnum, $result[2]); } +} - echo "
UserRoomHost
\n
\n".$vcard."
"; +echo "\n
\n".$vcard."
"; +echo "putting it back in!"; +$entearray=array(); +$entarray['post']=1; +$entarray['format_type']=FMT_RFC822; +enter_message_0($entarray, "text/x-vcard; charset=UTF-8", $vcard); ?>
Sample links
-- 2.30.2