public function actionTrack() { try { Yii::app()->user->userModel = BaseActionControlUserConfigUtil::getUserToRunAs(); $response = EmailMessageActivityUtil::resolveQueryStringFromUrlAndCreateOrUpdateActivity(); if ($response['redirect']) { $this->redirect($response['url']); } elseif (isset($response['imagePath'])) { $mime = ZurmoFileHelper::getMimeType($response['imagePath']); $size = filesize($response['imagePath']); $name = pathinfo($response['imagePath'], PATHINFO_FILENAME); header('Content-Type: ' . $mime); header('Content-Length: ' . $size); header('Content-Name: ' . $name); readfile($response['imagePath']); Yii::app()->end(0, false); } } catch (NotFoundException $e) { } catch (NotSupportedException $e) { } catch (FailedToSaveModelException $e) { } catch (MissingASuperAdministratorException $e) { } // we do not catch all exceptions because we need Exit and Redirect Exception for unit tests }