public function getfile() { $module = $this->param('targetmodule'); if (!jApp::isModuleEnabled($module) || jApp::config()->modules[$module . '.access'] < 2) { throw new jException('jelix~errors.module.untrusted', $module); } $dir = jApp::getModulePath($module) . 'www/'; $filename = realpath($dir . str_replace('..', '', $this->param('file'))); if (!is_file($filename)) { $rep = $this->getResponse('html', true); $rep->bodyTpl = 'jelix~404.html'; $rep->setHttpStatus('404', 'Not Found'); return $rep; } $rep = $this->getResponse('binary'); $dateModif = new DateTime(); $dateModif->setTimestamp(filemtime($fileName)); if ($rep->isValidCache($dateModif)) { return $rep; } $rep->doDownload = false; $rep->fileName = $filename; $rep->mimeType = \Jelix\FileUtilities\File::getMimeTypeFromFilename($rep->fileName); return $rep; }
<?php /** * Displays the list of projects for ajax request * @package lizmap * @subpackage view * @author 3liz * @copyright 2012 3liz * @link http://3liz.com * @license Mozilla Public License : http://www.mozilla.org/MPL/ */ include jApp::getModulePath('view') . 'controllers/lizAjax.classic.php'; class ajaxCtrl extends lizAjaxCtrl { }
public function getModulePath($module, $includingExternal = false) { trigger_error("jCoordinator::getModulePath() is deprecated. Use jApp::getModulePath() instead", E_USER_NOTICE); return jApp::getModulePath($module, $includingExternal); }