X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=Images.php;h=68cc36273600ee5f9ed3f4a5167066203c61ccff;hb=692861c958898f425cc365906c092559d7cfc60c;hp=8f51d55c11926c19388d84739151462451657187;hpb=430aaeb380b9ad0443abcbe2dfb6a28b95bceb8b;p=Pman.Core diff --git a/Images.php b/Images.php index 8f51d55c..68cc3627 100644 --- a/Images.php +++ b/Images.php @@ -176,8 +176,6 @@ class Pman_Core_Images extends Pman } - - $img = DB_DataObjecT::factory('Images'); if (!$id || !$img->get($id)) { @@ -196,15 +194,13 @@ class Pman_Core_Images extends Pman if ($comp->comptype != 'OWNER') { $this->imgErr("not-owner-company",$s); } + return $this->serve($img); - } - if(!$this->hasPermission($img)){ $this->imgErr("access to this image/file has been denied.",$s); - } $this->serve($img); @@ -465,7 +461,8 @@ class Pman_Core_Images extends Pman $id = $umatch[2]; $hash = ''; if (!empty($umatch[3]) && strpos($umatch[3],'#')) { - $hash = '#'. array_pop(explode('#',$umatch[3])); + $hh = explode('#',$umatch[3]); + $hash = '#'. array_pop($hh); } @@ -538,15 +535,7 @@ class Pman_Core_Images extends Pman } $ff = HTML_FlexyFramework::get(); - $file = false; - - if (!empty($ff->Pman['storedir'])) { - $file = $ff->Pman['storedir']. '/Events/'. $user. date('/Y/m/d/',strtotime($ev->event_when)). $ev->id . ".json"; - } - // DEPRICATED... - if (!empty($ff->Pman['event_log_dir'])) { - $file = $ff->Pman['event_log_dir']. '/'. $user. date('/Y/m/d/',strtotime($ev->event_when)). $ev->id . ".json"; - } + $file = $ev->logDir() . date('/Y/m/d/',strtotime($ev->event_when)). $ev->id . ".json"; if(!$file || !file_exists($file)){ die("file was not saved"); @@ -559,16 +548,8 @@ class Pman_Core_Images extends Pman continue; } - $src = false; + $src = $file = $ev->logDir() . date('/Y/m/d/', strtotime($ev->event_when)). $f->tmp_name ; - if (!empty($ff->Pman['storedir'])) { - $src = $ff->Pman['storedir']. '/Events/'. $user. date('/Y/m/d/', strtotime($ev->event_when)). $f->tmp_name ; - } - // DEPRICATED... - if (!empty($ff->Pman['event_log_dir'])) { - $src = $ff->Pman['event_log_dir']. '/'. $user. date('/Y/m/d/', strtotime($ev->event_when)). $f->tmp_name ; - } - if (!$src || !file_exists($src)) { die("file was not saved"); }