Images.php
authorChris <chris@roojs.com>
Fri, 12 Oct 2012 12:00:16 +0000 (20:00 +0800)
committerChris <chris@roojs.com>
Fri, 12 Oct 2012 12:00:16 +0000 (20:00 +0800)
Images.php

index 0778244..def39c9 100644 (file)
@@ -79,14 +79,16 @@ class Pman_Core_Images extends Pman
             
         } else if (!empty($bits[0]) && $bits[0] == 'events') {
             $popts = PEAR::getStaticProperty('Pman','options');
-            $file = "{$popts['event_log_dir']}/{$bits[1]}";
+            
             header ('Content-Type: image/jpeg');
             if(!empty($bits[2]) && $bits[2] == 'download'){
+                $file = "{$popts['event_log_dir']}/{$bits[1]}";
                 header("Content-Disposition: attachment; filename=\"".basename($file)."\";" );
                 ob_clean();
                 flush();
                 readfile($file);
             }else{
+                $file = "{$popts['event_log_dir']}/{$bits[1]}.jpg";
                 $fh = fopen($file,'r');
                 echo fread($fh,filesize($file));
             }