Index: typo3conf/ext/em/classes/index.php =================================================================== --- typo3conf/ext/em/classes/index.php (revision 3991) +++ typo3conf/ext/em/classes/index.php (revision ) @@ -1365,7 +1365,13 @@ if (!is_uploaded_file($_FILES['upload_ext_file']['tmp_name'])) { t3lib_div::sysLog('Possible file upload attack: ' . $_FILES['upload_ext_file']['tmp_name'], 'Extension Manager', 3); - return $GLOBALS['LANG']->getLL('ext_import_file_not_uploaded'); + $flashMessage = t3lib_div::makeInstance( + 't3lib_FlashMessage', + $GLOBALS['LANG']->getLL('ext_import_file_not_uploaded'), + '', + t3lib_FlashMessage::ERROR + ); + return $flashMessage->render(); } $uploadedTempFile = t3lib_div::upload_to_tempfile($_FILES['upload_ext_file']['tmp_name']); @@ -1373,7 +1379,13 @@ $fileContent = t3lib_div::getUrl($uploadedTempFile); if (!$fileContent) { - return $GLOBALS['LANG']->getLL('ext_import_file_empty'); + $flashMessage = t3lib_div::makeInstance( + 't3lib_FlashMessage', + $GLOBALS['LANG']->getLL('ext_import_file_empty'), + '', + t3lib_FlashMessage::ERROR + ); + return $flashMessage->render(); } // Decode file data: @@ -1397,13 +1409,31 @@ } // ... else go on, install... } // ... else go on, install... } else { - return $GLOBALS['LANG']->getLL('ext_import_no_key'); + $flashMessage = t3lib_div::makeInstance( + 't3lib_FlashMessage', + $GLOBALS['LANG']->getLL('ext_import_no_key'), + '', + t3lib_FlashMessage::ERROR + ); + return $flashMessage->render(); } } else { - return sprintf($GLOBALS['LANG']->getLL('ext_import_wrong_file_format'), $fetchData); + $flashMessage = t3lib_div::makeInstance( + 't3lib_FlashMessage', + sprintf($GLOBALS['LANG']->getLL('ext_import_wrong_file_format'), $fetchData), + '', + t3lib_FlashMessage::ERROR + ); + return $flashMessage->render(); } } else { - return $GLOBALS['LANG']->getLL('ext_import_no_file'); + $flashMessage = t3lib_div::makeInstance( + 't3lib_FlashMessage', + $GLOBALS['LANG']->getLL('ext_import_no_file'), + '', + t3lib_FlashMessage::ERROR + ); + return $flashMessage->render(); } } else { $this->xmlHandler->searchExtensionsXMLExact($extKey, '', '', true, true); Index: typo3conf/ext/em/classes/install/class.tx_em_install.php =================================================================== --- typo3conf/ext/em/classes/install/class.tx_em_install.php (revision 3967) +++ typo3conf/ext/em/classes/install/class.tx_em_install.php (revision ) @@ -186,8 +186,29 @@ foreach ($writeFiles as $theFile => $fileData) { t3lib_div::writeFile($extDirPath . $theFile, $fileData['content']); if (!@is_file($extDirPath . $theFile)) { + if (!$this->silentMode) { + $flashMessage = t3lib_div::makeInstance( + 't3lib_FlashMessage', + sprintf($GLOBALS['LANG']->getLL('ext_import_file_not_created'), + $extDirPath . $theFile), + '', + t3lib_FlashMessage::ERROR + ); + $content .= $flashMessage->render(); + } else { + if (!$this->silentMode) { + $flashMessage = t3lib_div::makeInstance( + 't3lib_FlashMessage', + sprintf($GLOBALS['LANG']->getLL('ext_import_file_not_created'), $extDirPath . $theFile), + '', + t3lib_FlashMessage::ERROR + ); + $content .= $flashMessage->render(); + } else { - $content .= sprintf($GLOBALS['LANG']->getLL('ext_import_file_not_created'), - $extDirPath . $theFile) . '
'; + $content .= sprintf($GLOBALS['LANG']->getLL('ext_import_file_not_created'), + $extDirPath . $theFile) . '
'; + } + } } elseif (md5(t3lib_div::getUrl($extDirPath . $theFile)) != $fileData['content_md5']) { $content .= sprintf($GLOBALS['LANG']->getLL('ext_import_file_corrupted'), $extDirPath . $theFile) . '
'; @@ -286,28 +307,99 @@ } } } else { + if (!$this->silentMode) { + $flashMessage = t3lib_div::makeInstance( + 't3lib_FlashMessage', + $res, + '', + t3lib_FlashMessage::ERROR + ); + $content = $flashMessage->render(); + } else { - $content = $res; - } + $content = $res; + } + } } else { + if (!$this->silentMode) { + $flashMessage = t3lib_div::makeInstance( + 't3lib_FlashMessage', + sprintf($GLOBALS['LANG']->getLL('ext_import_ext_path_different'), $extDirPath), + '', + t3lib_FlashMessage::ERROR + ); + $content = $flashMessage->render(); + } else { - $content = sprintf($GLOBALS['LANG']->getLL('ext_import_ext_path_different'), $extDirPath); - } + $content = sprintf($GLOBALS['LANG']->getLL('ext_import_ext_path_different'), $extDirPath); + } + } } else { + if (!$this->silentMode) { + $flashMessage = t3lib_div::makeInstance( + 't3lib_FlashMessage', + $res, + '', + t3lib_FlashMessage::ERROR + ); + $content = $flashMessage->render(); + } else { - $content = $res; - } - } + $content = $res; + } + } + } } else { + if (!$this->silentMode) { + $flashMessage = t3lib_div::makeInstance( + 't3lib_FlashMessage', + sprintf($GLOBALS['LANG']->getLL('ext_import_ext_only_here'), + $this->typePaths[$EM_CONF['lockType']], $EM_CONF['lockType']), + '', + t3lib_FlashMessage::ERROR + ); + $content = $flashMessage->render(); + } else { - $content = sprintf($GLOBALS['LANG']->getLL('ext_import_ext_only_here'), - tx_em_Tools::typePath($EM_CONF['lockType']), $EM_CONF['lockType']); - } + $content = sprintf($GLOBALS['LANG']->getLL('ext_import_ext_only_here'), + tx_em_Tools::typePath($EM_CONF['lockType']), $EM_CONF['lockType']); + } + } } else { + if (!$this->silentMode) { + $flashMessage = t3lib_div::makeInstance( + 't3lib_FlashMessage', + $GLOBALS['LANG']->getLL('ext_import_no_ext_key_files'), + '', + t3lib_FlashMessage::ERROR + ); + $content = $flashMessage->render(); + } else { - $content = $GLOBALS['LANG']->getLL('ext_import_no_ext_key_files'); - } + $content = $GLOBALS['LANG']->getLL('ext_import_no_ext_key_files'); + } + } } else { + if (!$this->silentMode) { + $flashMessage = t3lib_div::makeInstance( + 't3lib_FlashMessage', + sprintf($GLOBALS['LANG']->getLL('ext_import_data_transfer'), $fetchData), + '', + t3lib_FlashMessage::ERROR + ); + $content = $flashMessage->render(); + } else { - $content = sprintf($GLOBALS['LANG']->getLL('ext_import_data_transfer'), $fetchData); - } + $content = sprintf($GLOBALS['LANG']->getLL('ext_import_data_transfer'), $fetchData); + } + } } else { + if (!$this->silentMode) { + $flashMessage = t3lib_div::makeInstance( + 't3lib_FlashMessage', + sprintf($GLOBALS['LANG']->getLL('ext_import_no_install_here'), $this->typePaths[$loc]), + '', + t3lib_FlashMessage::ERROR + ); + $content = $flashMessage->render(); + } else { - $content = sprintf($GLOBALS['LANG']->getLL('ext_import_no_install_here'), tx_em_Tools::typePath($loc)); - } + $content = sprintf($GLOBALS['LANG']->getLL('ext_import_no_install_here'), tx_em_Tools::typePath($loc)); + } + } return $content; }