diff --git a/controllers/email_attachments_controller.php b/controllers/email_attachments_controller.php index 1bcc63bd..141af1a1 100755 --- a/controllers/email_attachments_controller.php +++ b/controllers/email_attachments_controller.php @@ -1,71 +1,71 @@ EmailAttachment->findById($id); + $file = $this->EmailAttachment->findById($id); - $file_path = Configure::read('email_directory'); - if(file_exists($file_path."/".$file['EmailAttachment']['name'])) { + $file_path = Configure::read('email_directory'); + if(file_exists($file_path."/".$file['EmailAttachment']['name'])) { - Configure::write('debug', 0); + Configure::write('debug', 0); - if(!$file['EmailAttachment']['filename']) { - $filename = 'vault_'.time(); - } - else { - $filename = $file['EmailAttachment']['filename']; - } + if(!$file['EmailAttachment']['filename']) { + $filename = 'vault_'.time(); + } + else { + $filename = $file['EmailAttachment']['filename']; + } - header('Content-type: ' . $file['EmailAttachment']['type']); - header('Content-length: ' . $file['EmailAttachment']['size']); - header('Content-Disposition: attachment; filename='.$filename); + header('Content-type: ' . $file['EmailAttachment']['type']); + header('Content-length: ' . $file['EmailAttachment']['size']); + header('Content-Disposition: attachment; filename='.$filename); - readfile($file_path."/".$file['EmailAttachment']['name']); + readfile($file_path."/".$file['EmailAttachment']['name']); + + exit(); + } + else { + echo "ERROR!! : File Not Found"; + echo $file['EmailAttachment']['filename']; + die(); + } + } + + function view($id = null) { + Configure::write('debug', 0); + $this->layout = 'minimal'; + if(!$id) { + return; + } + else { + + $file = $this->EmailAttachment->find('first', array('conditions'=>array('EmailAttachment.id'=>$id))); + //$this->set('attachment', $file); + + $file_path = Configure::read('email_directory'); + + $contents = file_get_contents($file_path."/".$file['EmailAttachment']['name']); + + + if($file['EmailAttachment']['type'] == 'text/plain') { + $contents = nl2br($contents, true); + } + + + $this->set('contents', $contents); - exit(); - } - else { - echo "ERROR!! : File Not Found"; - echo $file['EmailAttachment']['filename']; - die(); - } } - function view($id = null) { - Configure::write('debug', 0); - $this->layout = 'minimal'; - if(!$id) { - return; - } - else { - - $file = $this->EmailAttachment->find('first', array('conditions'=>array('EmailAttachment.id'=>$id))); - //$this->set('attachment', $file); - - $file_path = Configure::read('email_directory'); - - $contents = file_get_contents($file_path."/".$file['EmailAttachment']['name']); - - - if($file['EmailAttachment']['type'] == 'text/plain') { - $contents = nl2br($contents, true); - } - - - $this->set('contents', $contents); - - } - - } + } } diff --git a/webroot/css/quotenik.css b/webroot/css/quotenik.css index 3c70d708..259cd014 100755 --- a/webroot/css/quotenik.css +++ b/webroot/css/quotenik.css @@ -95,6 +95,7 @@ h3 { h3#logo { color: #FFFFFF; + padding-left: 0.5em; } @@ -144,7 +145,6 @@ ul.principle-emails { /* background: #4686c3 url(../img/gradient-blue4.png) repeat-x bottom; */ background: #4686c3; height: 3em; - /* background: #6BBA70; */ padding-bottom: 2%; } @@ -989,6 +989,7 @@ div.actions ul li a:hover { div.related { clear: both; display: block; + margin-bottom: 2em; } div.related h3 {