/**
  * @throws 401
  */
 private function checkTemporaryFileBelongsToCurrentUser(TemporaryFile $file)
 {
     $creator_id = $file->getCreatorId();
     if ($creator_id != $this->user->getId()) {
         $this->raiseError(401, 'This file does not belong to you');
     }
 }
Пример #2
0
 private function removeTemporaryFileFomFileSystem(Tracker_Artifact_Attachment_TemporaryFile $temporary_file)
 {
     $user = $this->user_manager->getUserById($temporary_file->getCreatorId());
     $temporary_file_name = $temporary_file->getTemporaryName();
     $temporary_file_path = $this->getPath($user, $temporary_file_name);
     if ($this->exists($user, $temporary_file_name)) {
         unlink($temporary_file_path);
     }
 }
 private function removeTemporaryFileFomFileSystem(Tracker_Artifact_Attachment_TemporaryFile $temporary_file)
 {
     $temporary_file_name = $temporary_file->getTemporaryName();
     $temporary_file_path = $this->getPath($temporary_file_name);
     if ($this->exists($temporary_file_name)) {
         unlink($temporary_file_path);
     }
 }
Пример #4
0
 public function buildFileInfoData(Tracker_Artifact_Attachment_TemporaryFile $file, $path)
 {
     return array('id' => $file->getTemporaryName(), 'submitted_by' => $file->getCreatorId(), 'description' => $file->getDescription(), 'name' => $file->getName(), 'tmp_name' => $path, 'size' => $file->getSize(), 'type' => $file->getType(), 'error' => UPLOAD_ERR_OK, 'action' => '');
 }