From: <re...@us...> - 2003-07-21 22:28:27
|
Update of /cvsroot/tikiwiki/tiki/lib In directory sc8-pr-cvs1:/tmp/cvs-serv22790/lib Modified Files: Tag: release_eta_carinea_rc1 commentslib.php Log Message: Now "Add messages from this email to the forum" works. Index: commentslib.php =================================================================== RCS file: /cvsroot/tikiwiki/tiki/lib/commentslib.php,v retrieving revision 1.29 retrieving revision 1.29.2.1 diff -u -d -r1.29 -r1.29.2.1 --- commentslib.php 2 Jun 2003 19:49:52 -0000 1.29 +++ commentslib.php 21 Jul 2003 22:28:22 -0000 1.29.2.1 @@ -145,6 +145,7 @@ $ctype = $obj->ctype_primary.'/'.$obj->ctype_secondary; switch($ctype) { case 'text/plain': + case 'TEXT/PLAIN': if(!empty($obj->disposition) AND $obj->disposition == 'attachment') { $names=split(';',$obj->headers["content-disposition"]); $names=split('=',$names[1]); @@ -157,6 +158,7 @@ } break; case 'text/html': + case 'TEXT/HTML': if(!empty($obj->disposition) AND $obj->disposition == 'attachment') { $names=split(';',$obj->headers["content-disposition"]); $names=split('=',$names[1]); @@ -187,7 +189,7 @@ include_once ("lib/webmail/htmlMimeMail.php"); $info = $this->get_forum($forumId); if(!$info["inbound_pop_server"]) return; - $pop3=new POP3($info["inbound_pop_server"],$acc["inbound_pop_user"],$acc["inbound_pop_password"]); + $pop3=new POP3($info["inbound_pop_server"],$info["inbound_pop_user"],$info["inbound_pop_password"]); if(!$pop3) return; $pop3->Open(); $s = $pop3->Stats() ; @@ -197,6 +199,7 @@ if(empty($aux["sender"]["name"])) $aux["sender"]["name"]=$aux["sender"]["email"]; $title = addslashes(trim($aux['subject'])); $email = $aux["sender"]["email"]; + $message=$pop3->GetMessage($i); $full = $message["full"]; $params = array('input' => $full, 'crlf' => "\r\n", @@ -204,13 +207,14 @@ 'decode_headers' => TRUE, 'decode_bodies' => TRUE ); - $output = Mail_mimeDecode::decode($params); - parse_output($output, $parts,0); + $decoder= new Mail_mimeDecode($full); + $output = $decoder->decode($params); + $this->parse_output($output, $parts,0); if(isset($parts["text"][0])) $body=$parts["text"][0]; //Todo: check permissions - $object = md5('forum'.$forumId); + $object = 'forum'.$forumId; // post_new_comment does md5() // Determine if this is a topic or a thread $parentId = $this->getOne("select threadId from tiki_comments where object='$object' and parentId=0 and locate(title,'$title')"); if(!$parentId) $parentId=0; |