diff --git a/web_service/ws/Workspaces.class.inc b/web_service/ws/Workspaces.class.inc index 64d06e54e14b99372c4cb2d54f60ebcf4088445f..41a80bdce7b70978429ccb876b8bfcac63cdd189 100755 --- a/web_service/ws/Workspaces.class.inc +++ b/web_service/ws/Workspaces.class.inc @@ -1064,10 +1064,10 @@ class Workspaces extends GTF { if ($this->aPath[3] == "File") { $aReturn = $this->deleteWorkspaceFile(); $aXmlRacineAttribute['status'] = $aReturn['status']; - if ($aReturn['status'] == 1) { + if ($aReturn['status'] == 1) $sMessage = $this->asDocument('', 'vitis', $this->aValues['sEncoding'], True, $aXmlRacineAttribute, $this->aValues['sSourceEncoding'], $this->aValues['output']); - } else { - $oError = new VitisError(1, 'LICENSE_FILE_INSTALL_ERROR_CONFIGURATION_CONFIGURATION_GTF_LICENSE'); + else { + $oError = new VitisError(1, $aReturn['message']); $sMessage = $oError->asDocument('', 'vitis', $this->aValues['sEncoding'], True, $aXmlRacineAttribute, $this->aValues['sSourceEncoding'], $this->aValues['output']); } } elseif ($this->aPath[3] == "DeleteWidgetFile") { @@ -1226,14 +1226,8 @@ class Workspaces extends GTF { */ function deleteWorkspaceFile() { $aReturn = array('status' => 1, 'message' => ''); - $sFilePath = $this->aProperties['workspace_dir'] . '/' . $this->aValues["my_vitis_id"] . '/fme/' . $this->aValues['file_name']; - // Le fichier existe ? - if (file_exists(utf8_decode($sFilePath))) { - if (!unlink(utf8_decode($sFilePath))) - $aReturn = array('status' => 0, 'message' => 'DELETE_FILE_ERROR_PUBLICATION_WORKSPACE_LOAD_PROJECT_DIRECTORY', 'error_code' => null); - } else - $aReturn = array('status' => 0, 'message' => 'FILE_NOT_FOUND_PUBLICATION_WORKSPACE_LOAD_PROJECT_DIRECTORY', 'error_code' => null); - + if (deleteFileFromWsDataDirTree('gtf', 'workspace', $this->aValues["my_vitis_id"], 'fme', $this->aValues['file_name']) === false) + $aReturn = array('status' => 0, 'message' => 'DELETE_FILE_ERROR_PUBLICATION_WORKSPACE_LOAD_PROJECT_DIRECTORY', 'error_code' => null); return $aReturn; }