supporto per estensione diversa da .pdf per i pdf

This commit is contained in:
Riccardo Di Dato
2016-03-31 14:14:20 +02:00
parent 05d926d582
commit 6459055567
+2 -2
View File
@@ -10,9 +10,9 @@ if (array_key_exists("id",$_GET)) {
$pdfModel = GlobalVariables::get("dao")->getFirst("MediaModel",array("id"=>$_GET['id']));
$id = $_GET["id"];
if (!is_null($pdfModel)){
$localFilePath = GlobalVariables::get("config")->paths->media."/".$id.".pdf";
$localFilePath = GlobalVariables::get("config")->paths->media."/".$id.".".$pdfModel->extension;
if (SFSManager::fileExists($localFilePath)){
$exposedFilePath = GlobalVariables::get("config")->paths->xsendfile."/".$id.".pdf";
$exposedFilePath = GlobalVariables::get("config")->paths->xsendfile."/".$id.".".$pdfModel->extension;
if (!SFSManager::fileExists($exposedFilePath)){
SystemController::shellExec("ln",'-s "'.$localFilePath.'" "'.$exposedFilePath.'"');
}