Esempio n. 1
0
 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;
 }
Esempio n. 2
0
<?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
{
}
Esempio n. 3
0
 public function getModulePath($module, $includingExternal = false)
 {
     trigger_error("jCoordinator::getModulePath() is deprecated. Use jApp::getModulePath() instead", E_USER_NOTICE);
     return jApp::getModulePath($module, $includingExternal);
 }