diff --git a/controllers/email_attachments_controller.php b/controllers/email_attachments_controller.php index 70e474d1..675d712b 100755 --- a/controllers/email_attachments_controller.php +++ b/controllers/email_attachments_controller.php @@ -11,7 +11,9 @@ function download($id) { header('Content-type: ' . $file['EmailAttachment']['type']); header('Content-length: ' . $file['EmailAttachment']['size']); header('Content-Disposition: attachment; filename="'.$file['EmailAttachment']['name'].'"'); - echo $file['EmailAttachment']['data']; + ob_clean(); + flush(); + readfile($file['EmailAttachment']['filename']); exit(); } diff --git a/vendors/shells/vault.php b/vendors/shells/vault.php index e975e0ed..c7848f2d 100755 --- a/vendors/shells/vault.php +++ b/vendors/shells/vault.php @@ -112,7 +112,7 @@ class VaultShell extends Shell { $this->data['EmailAttachment']['email_id'] = $email_id; $this->data['EmailAttachment']['name'] = $attachment['name']; $this->data['EmailAttachment']['type'] = $attachment['type']; - $this->data['EmailAttachment']['size'] = filesize($email_dir.'/'.$attachment['name']); + $this->data['EmailAttachment']['size'] = filesize($email_dir.'/'.$uniqid.'/'.$attachment['name']); $this->data['EmailAttachment']['filename'] = $email_dir.'/'.$uniqid.'/'.$attachment['name']; if ($this->EmailAttachment->save($this->data)) { echo "Saved file successfully to database\n"; @@ -182,7 +182,7 @@ class VaultShell extends Shell { if(isset($discarded_msgs)) { foreach($discarded_msgs as $msg) { $no = imap_msgno($mbox,$msg); - + $this_header = imap_headerinfo($mbox, $i); echo "Going to discard: $no\t $msg\t".$this_header->subject."\n"; if($testing == 0) { imap_mail_move($mbox,$no, 'INBOX/Discarded'); diff --git a/vendors/xtcpdf.php b/vendors/xtcpdf.php index 39e1f844..d505da97 100755 --- a/vendors/xtcpdf.php +++ b/vendors/xtcpdf.php @@ -392,6 +392,7 @@ ENDPRODUCT; $options = 0; //Toggled to 1 when we encounter an Optional product. Stops the totals being printed. print_r($pageProducts); + // print_r($products); foreach ($pageProducts as $page) { $this->AddPage(); @@ -434,7 +435,7 @@ ENDPRODUCT; foreach($page as $productID) { $product = array_shift($products); - $fullDesc = "".$product[$docType]['title'].'
'.$product[$docType]['description']; + $fullDesc = "".$product['Principle']['name']."
"."".$product[$docType]['title'].'
'.$product[$docType]['description']; if($product[$docType]['option'] == 1) { $options = 1;