X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=blobdiff_plain;f=ImportMailMessage.php;h=ce4ea30d905b74816b063e3e43e3bb0b7a2ab56b;hp=4dc240aeed198e7cfcb4f0c4580fae06c2e76249;hb=refs%2Fheads%2Fwip_alan_T5884_add_photo_to_report;hpb=849c0a0caffbc3397b1dfa181899548112d8d758 diff --git a/ImportMailMessage.php b/ImportMailMessage.php index 4dc240ae..ce4ea30d 100644 --- a/ImportMailMessage.php +++ b/ImportMailMessage.php @@ -1,8 +1,10 @@ post(); return $this->jerr("not allowed"); } - function post() - { + function post($v) + { if(isset($_REQUEST['_convertToPlain'])) { require_once 'System.php'; @@ -54,9 +56,11 @@ class Pman_Crm_ImportHtml extends Pman_Core_ConvertStyle } require_once 'File/Convert.php'; $fc = new File_Convert($path, 'text/html'); + $plain = $fc->convert('text/plain'); $this->jok(file_get_contents($plain)); } + // Import from URL if(isset($_REQUEST['importUrl'])) { @@ -74,7 +78,7 @@ class Pman_Crm_ImportHtml extends Pman_Core_ConvertStyle 'ontable' =>'crm_mailing_list_message' )); $htmlFile->onUpload(false); - // print_r($htmlFile); + if($htmlFile->mimetype != 'text/html') { $this->jerr('accept html file only!'); @@ -87,6 +91,7 @@ class Pman_Crm_ImportHtml extends Pman_Core_ConvertStyle $data = $this->convertStyle('', $htmlFile->getStoreName(), false); $htmlFile->delete(); + unlink($htmlFile->getStoreName()) or die('Unable to delete the file'); $this->jok($data);