BxDolStudioInstallerUtils.php 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609
  1. <?php defined('BX_DOL') or die('hack attempt');
  2. /**
  3. * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  4. * CC-BY License - http://creativecommons.org/licenses/by/3.0/
  5. *
  6. * @defgroup TridentStudio Trident Studio
  7. * @{
  8. */
  9. bx_import('BxDolLanguages');
  10. define('BX_DOL_UNITY_URL_ROOT', 'http://www.boonex.com/');
  11. define('BX_DOL_UNITY_URL_MARKET', BX_DOL_UNITY_URL_ROOT . 'market/');
  12. define('BX_DOL_STUDIO_IU_RC_SUCCESS', 0);
  13. define('BX_DOL_STUDIO_IU_RC_FAILED', 1);
  14. define('BX_DOL_STUDIO_IU_RC_SCHEDULED', 2);
  15. class BxDolStudioInstallerUtils extends BxDolInstallerUtils implements iBxDolSingleton
  16. {
  17. protected $bUseFtp;
  18. protected $sAuthorizedAccessClass;
  19. public function __construct()
  20. {
  21. if (isset($GLOBALS['bxDolClasses'][get_class($this)]))
  22. trigger_error ('Multiple instances are not allowed for the class: ' . get_class($this), E_USER_ERROR);
  23. parent::__construct();
  24. $this->bUseFtp = BX_FORCE_USE_FTP_FILE_TRANSFER;
  25. $this->sAuthorizedAccessClass = 'BxDolStudioOAuthPlugin';
  26. }
  27. /**
  28. * Prevent cloning the instance
  29. */
  30. public function __clone()
  31. {
  32. if (isset($GLOBALS['bxDolClasses'][get_class($this)]))
  33. trigger_error('Clone is not allowed for the class: ' . get_class($this), E_USER_ERROR);
  34. }
  35. /**
  36. * Get singleton instance of the class
  37. */
  38. public static function getInstance()
  39. {
  40. if (!isset($GLOBALS['bxDolClasses'][__CLASS__]))
  41. $GLOBALS['bxDolClasses'][__CLASS__] = new BxDolStudioInstallerUtils();
  42. return $GLOBALS['bxDolClasses'][__CLASS__];
  43. }
  44. public static function getNamePerformAction($sParam)
  45. {
  46. return 'sys_perform_action_' . md5($sParam);
  47. }
  48. public static function getNameDownloadFile($sParam)
  49. {
  50. return 'sys_download_file_complete_' . $sParam;
  51. }
  52. public static function getNamePerformModulesUpgrade()
  53. {
  54. return 'sys_upgrade_modules_transient';
  55. }
  56. /*
  57. * Is used to complete Downloading inside Transient Cron Job.
  58. */
  59. public function serviceDownloadFileComplete($sFilePath, $aParams = array())
  60. {
  61. return $this->downloadFileComplete($sFilePath, array_merge($aParams, array('transient' => true)));
  62. }
  63. /*
  64. * Is used to perform action inside Transient Cron Job.
  65. */
  66. public function servicePerformAction($sDirectory, $sOperation, $aParams)
  67. {
  68. return $this->perform($sDirectory, $sOperation, array_merge($aParams, array('transient' => true)));
  69. }
  70. /*
  71. * Is used to perform modules upgrade inside Transient Cron Job.
  72. */
  73. public function servicePerformModulesUpgrade($bEmailNotify)
  74. {
  75. return $this->performModulesUpgrade(true, $bEmailNotify);
  76. }
  77. public function getAccessObject($bAuthorizedAccess)
  78. {
  79. $sClass = $bAuthorizedAccess ? $this->sAuthorizedAccessClass : 'BxDolStudioJson';
  80. bx_import($sClass);
  81. return $sClass::getInstance();
  82. }
  83. public function getModules($bTitleAsKey = true)
  84. {
  85. $aModules = array();
  86. $oTemplate = BxDolStudioTemplate::getInstance();
  87. $aInstalledInfo = $this->getInstalledInfo();
  88. $sPath = BX_DIRECTORY_PATH_MODULES;
  89. if(($rHandleVendor = opendir($sPath)) !== false) {
  90. while(($sVendor = readdir($rHandleVendor)) !== false) {
  91. if(substr($sVendor, 0, 1) == '.' || !is_dir($sPath . $sVendor))
  92. continue;
  93. if(($rHandleModule = opendir($sPath . $sVendor)) !== false) {
  94. while(($sModule = readdir($rHandleModule)) !== false) {
  95. if(!is_dir($sPath . $sVendor . '/' . $sModule) || substr($sModule, 0, 1) == '.')
  96. continue;
  97. $sModulePath = $sVendor . '/' . $sModule . '/';
  98. $aModule = $this->getConfigModule($sPath . $sModulePath . 'install/config.php', !empty($aInstalledInfo[$sModulePath]) ? $aInstalledInfo[$sModulePath] : array());
  99. if(empty($aModule))
  100. continue;
  101. $aModules[$bTitleAsKey ? $aModule['title'] : $aModule['name']] = $aModule;
  102. }
  103. closedir($rHandleModule);
  104. }
  105. }
  106. closedir($rHandleVendor);
  107. }
  108. ksort($aModules);
  109. return $aModules;
  110. }
  111. public function getUpdates()
  112. {
  113. $aUpdates = array();
  114. $oTemplate = BxDolStudioTemplate::getInstance();
  115. $aInstalledInfo = $this->getInstalledInfo();
  116. $sPath = BX_DIRECTORY_PATH_MODULES;
  117. if(($rHandleVendor = opendir($sPath)) !== false) {
  118. while(($sVendor = readdir($rHandleVendor)) !== false) {
  119. if(substr($sVendor, 0, 1) == '.' || !is_dir($sPath . $sVendor))
  120. continue;
  121. if(($rHandleModule = opendir($sPath . $sVendor . '/')) !== false) {
  122. while(($sModule = readdir($rHandleModule)) !== false) {
  123. if(!is_dir($sPath . $sVendor . '/' . $sModule) || substr($sModule, 0, 1) == '.')
  124. continue;
  125. $sModulePath = $sVendor . '/' . $sModule . '/';
  126. if(empty($aInstalledInfo[$sModulePath]))
  127. continue;
  128. $aUpdate = $this->getUpdate($aInstalledInfo[$sModulePath]);
  129. if(!empty($aUpdate))
  130. $aUpdates[$aUpdate['title']] = $aUpdate;
  131. }
  132. closedir($rHandleModule);
  133. }
  134. }
  135. closedir($rHandleVendor);
  136. }
  137. ksort($aUpdates);
  138. return $aUpdates;
  139. }
  140. public function getUpdate($mixedModule)
  141. {
  142. $aResult = array();
  143. if(!is_array($mixedModule))
  144. $mixedModule = BxDolModuleQuery::getInstance()->{is_numeric($mixedModule) ? 'getModuleById' : 'getModuleByName'}($mixedModule);
  145. if(empty($mixedModule) || !is_array($mixedModule))
  146. return $aResult;
  147. $sPathModule = BX_DIRECTORY_PATH_MODULES . $mixedModule['path'];
  148. $sPathUpdates = $sPathModule . 'updates/';
  149. $rHandleUpdate = @opendir($sPathUpdates);
  150. if($rHandleUpdate === false)
  151. return $aResult;
  152. while(($sUpdate = readdir($rHandleUpdate)) !== false) {
  153. $sPathUpdate = $sPathUpdates . $sUpdate . '/';
  154. if(substr($sUpdate, 0, 1) == '.' || !is_dir($sPathUpdate))
  155. continue;
  156. $aUpdate = $this->getConfigUpdate($sPathModule . 'install/config.php', $sPathUpdate . 'install/config.php', $mixedModule);
  157. if(empty($aUpdate) || !is_array($aUpdate) || version_compare($aUpdate['module_version'], $aUpdate['version_from']) != 0)
  158. continue;
  159. $aResult = $aUpdate;
  160. break;
  161. }
  162. closedir($rHandleUpdate);
  163. return $aResult;
  164. }
  165. public function perform($sDirectory, $sOperation, $aParams = array())
  166. {
  167. $bTransient = false;
  168. if(isset($aParams['transient']) && $aParams['transient'] === true) {
  169. $bTransient = true;
  170. unset($aParams['transient']);
  171. }
  172. if(!defined('BX_DOL_CRON_EXECUTE') && !self::isRealOwner() && !in_array($sOperation, array('install', 'uninstall', 'enable', 'disable'))) {
  173. if($this->addTransientJob(self::getNamePerformAction($sDirectory), 'perform_action', array($sDirectory, $sOperation, $aParams)))
  174. return array('code' => BX_DOL_STUDIO_IU_RC_SCHEDULED, 'message' => _t('_adm_mod_msg_process_operation_scheduled'));
  175. else
  176. return array('code' => BX_DOL_STUDIO_IU_RC_FAILED, 'message' => _t('_adm_mod_err_process_operation_failed', $sOperation, $sDirectory));
  177. }
  178. $sConfigFile = 'install/config.php';
  179. $sInstallerFile = 'install/installer.php';
  180. $sInstallerClass = $sOperation == 'update' ? 'Updater' : 'Installer';
  181. $aConfig = self::getModuleConfig(BX_DIRECTORY_PATH_MODULES . $sDirectory . $sConfigFile);
  182. $sPathInstaller = BX_DIRECTORY_PATH_MODULES . $sDirectory . $sInstallerFile;
  183. if(empty($aConfig) || !file_exists($sPathInstaller)) {
  184. $sMessage = _t('_adm_mod_err_process_operation_failed', $sOperation, $sDirectory);
  185. if($bTransient)
  186. $this->emailNotify($sMessage);
  187. return array('code' => BX_DOL_STUDIO_IU_RC_FAILED, 'message' => $sMessage);
  188. }
  189. require_once($sPathInstaller);
  190. $sClassName = $aConfig['class_prefix'] . $sInstallerClass;
  191. $oInstaller = new $sClassName($aConfig);
  192. $aResult = $oInstaller->$sOperation($aParams);
  193. if(!$aResult['result'] && $bTransient)
  194. $this->emailNotify($aResult['message']);
  195. return array('code' => $aResult['result'] ? BX_DOL_STUDIO_IU_RC_SUCCESS : BX_DOL_STUDIO_IU_RC_FAILED, 'message' => $aResult['message']);
  196. }
  197. public function performModulesUpgrade($bDirectly = true, $bEmailNotify = true)
  198. {
  199. if(!defined('BX_DOL_CRON_EXECUTE') && !$bDirectly)
  200. return $this->addTransientJob(self::getNamePerformModulesUpgrade(), 'perform_modules_upgrade', array($bEmailNotify));
  201. $aFailed = array();
  202. $aUpdates = $this->checkUpdates();
  203. foreach($aUpdates as $aUpdate) {
  204. $mixedResult = $this->downloadUpdatePublic($aUpdate['name']);
  205. if($mixedResult !== true) {
  206. $aFailed[$aUpdate['name']] = $mixedResult;
  207. continue;
  208. }
  209. }
  210. $aSuccess = array();
  211. $aUpdates = $this->getUpdates();
  212. foreach($aUpdates as $aUpdate) {
  213. $aResult = $this->perform($aUpdate['dir'], 'update');
  214. if((int)$aResult['code'] != 0) {
  215. $aFailed[$aUpdate['module_name']] = $aResult['message'];
  216. continue;
  217. }
  218. $aSuccess[$aUpdate['module_name']] = $aUpdate['version_to'];
  219. }
  220. if($bEmailNotify && !empty($aSuccess))
  221. $this->emailNotifyModulesUpgrade('success', $aSuccess);
  222. if($bEmailNotify && !empty($aFailed))
  223. $this->emailNotifyModulesUpgrade('failed', $aFailed);
  224. return empty($aFailed);
  225. }
  226. public function checkModules($bAuthorizedAccess = false)
  227. {
  228. if($bAuthorizedAccess)
  229. $aProducts = $this->getAccessObject(true)->loadItems(array('dol_type' => 'purchased_products', 'dol_domain' => BX_DOL_URL_ROOT));
  230. else
  231. $aProducts = $this->getAccessObject(false)->load(BX_DOL_UNITY_URL_MARKET . 'json_browse_purchased', array('key' => getParam('sys_oauth_key')));
  232. $oModuleDb = BxDolModuleQuery::getInstance();
  233. $oModuleDb->updateModule(array('hash' => ''));
  234. if(!empty($aProducts) && is_array($aProducts))
  235. foreach ($aProducts as $aProduct)
  236. $oModuleDb->updateModule(array('hash' => $aProduct['hash']), array('name' => $aProduct['name']));
  237. return $aProducts;
  238. }
  239. public function checkUpdates($bAuthorizedAccess = false)
  240. {
  241. $aModules = BxDolModuleQuery::getInstance()->getModules();
  242. $aProducts = array();
  243. foreach($aModules as $aModule) {
  244. if(empty($aModule['name']))
  245. continue;
  246. $aProducts[] = array(
  247. 'name' => $aModule['name'],
  248. 'version' => $aModule['version'],
  249. 'hash' => $aModule['hash'],
  250. );
  251. }
  252. $sProducts = base64_encode(serialize($aProducts));
  253. if($bAuthorizedAccess)
  254. return $this->getAccessObject(true)->loadItems(array('dol_type' => 'available_updates', 'dol_products' => $sProducts));
  255. return $this->getAccessObject(false)->load(BX_DOL_UNITY_URL_MARKET . 'json_browse_updates', array(
  256. 'key' => getParam('sys_oauth_key'),
  257. 'products' => $sProducts
  258. ));
  259. }
  260. public function downloadFileAuthorized($iFileId)
  261. {
  262. $aItem = $this->getAccessObject(true)->loadItems(array('dol_type' => 'product_file', 'dol_file_id' => $iFileId));
  263. return $this->downloadFileInit($aItem, array('module_name' => $aItem['module_name']));
  264. }
  265. public function downloadUpdatePublic($sModuleName, $bAutoUpdate = false)
  266. {
  267. $aModule = BxDolModuleQuery::getInstance()->getModuleByName($sModuleName);
  268. $aItem = $this->getAccessObject(false)->load(BX_DOL_UNITY_URL_MARKET . 'json_download_update', array(
  269. 'key' => getParam('sys_oauth_key'),
  270. 'product' => base64_encode(serialize(array(
  271. 'name' => $aModule['name'],
  272. 'version' => $aModule['version'],
  273. 'hash' => $aModule['hash'],
  274. ))),
  275. ));
  276. return $this->downloadFileInit($aItem, array('module_name' => $sModuleName, 'auto_action' => $bAutoUpdate ? 'update' : ''));
  277. }
  278. protected function downloadFileInit($aItem, $aParams = array())
  279. {
  280. if(empty($aItem) || !is_array($aItem))
  281. return $aItem;
  282. //--- write ZIP archive.
  283. $sFilePath = '';
  284. $mixedResult = $this->performWrite($aItem, $sFilePath);
  285. if($mixedResult !== true)
  286. return $mixedResult;
  287. return $this->downloadFileComplete($sFilePath, $aParams);
  288. }
  289. protected function downloadFileComplete($sFilePath, $aParams = array())
  290. {
  291. $bTransient = false;
  292. if(isset($aParams['transient']) && $aParams['transient'] === true) {
  293. $bTransient = true;
  294. unset($aParams['transient']);
  295. }
  296. $sAutoAction = isset($aParams['auto_action']) ? $aParams['auto_action'] : '';
  297. $bAutoAction = !empty($sAutoAction);
  298. if(!defined('BX_DOL_CRON_EXECUTE') && !self::isRealOwner()) {
  299. if(!$this->addTransientJob(self::getNameDownloadFile($aParams['module_name']), 'download_file_complete', array($sFilePath, $aParams)))
  300. return _t('_adm_str_err_download_failed');
  301. return array('code' => BX_DOL_STUDIO_IU_RC_SCHEDULED, 'message' => _t('_adm_str_msg_download' . ($bAutoAction ? '_and_install' : '') . '_scheduled'));
  302. }
  303. //--- Unarchive package.
  304. $sPackagePath = '';
  305. $mixedResult = $this->performUnarchive($sFilePath, $sPackagePath);
  306. @unlink($sFilePath);
  307. if($mixedResult !== true) {
  308. if($bTransient)
  309. $this->emailNotify($mixedResult);
  310. return $mixedResult;
  311. }
  312. //--- Copy unarchived package.
  313. $sHomePath = '';
  314. $mixedResult = $this->performCopy($sPackagePath, $sHomePath);
  315. @bx_rrmdir($sPackagePath);
  316. if($mixedResult !== true) {
  317. if($bTransient)
  318. $this->emailNotify($mixedResult);
  319. return $mixedResult;
  320. }
  321. if(!$bAutoAction)
  322. return true;
  323. //--- Autoinstall the downloaded package if it's needed.
  324. $aResult = $this->perform($sHomePath, $sAutoAction, $aParams);
  325. if((int)$aResult['code'] != 0) {
  326. if($bTransient)
  327. $this->emailNotify($aResult['message']);
  328. return $aResult['message'];
  329. }
  330. return true;
  331. }
  332. protected function performWrite($aItem, &$sFilePath)
  333. {
  334. $sFilePath = BX_DIRECTORY_PATH_TMP . $aItem['name'];
  335. if(file_exists($sFilePath))
  336. @unlink($sFilePath);
  337. $iUmaskSave = umask(0);
  338. if(!$rHandler = fopen($sFilePath, 'w')) {
  339. umask($iUmaskSave);
  340. return _t('_adm_str_err_cannot_write');
  341. }
  342. $sContent = urldecode($aItem['content']);
  343. if(!fwrite($rHandler, $sContent, strlen($sContent))) {
  344. umask($iUmaskSave);
  345. return _t('_adm_str_err_cannot_write');
  346. }
  347. fclose($rHandler);
  348. umask($iUmaskSave);
  349. return true;
  350. }
  351. protected function performUnarchive($sFilePath, &$sPackagePath)
  352. {
  353. if(!class_exists('ZipArchive'))
  354. return _t('_adm_str_err_zip_not_available');
  355. $iUmaskSave = umask(0);
  356. $oZip = new ZipArchive();
  357. if($oZip->open($sFilePath) !== true) {
  358. umask($iUmaskSave);
  359. return _t('_adm_str_err_cannot_unzip_package');
  360. }
  361. $sPackageFolder = '';
  362. if($oZip->numFiles > 0)
  363. $sPackageFolder = $oZip->getNameIndex(0);
  364. if(empty($sPackageFolder)) {
  365. umask($iUmaskSave);
  366. return _t('_adm_str_err_cannot_unzip_package');
  367. }
  368. $sPackagePath = BX_DIRECTORY_PATH_TMP . $sPackageFolder;
  369. if(file_exists($sPackagePath)) // remove existing tmp folder with the same name
  370. @bx_rrmdir($sPackagePath);
  371. if(!$oZip->extractTo(BX_DIRECTORY_PATH_TMP)) {
  372. umask($iUmaskSave);
  373. return _t('_adm_str_err_cannot_unzip_package');
  374. }
  375. $oZip->close();
  376. umask($iUmaskSave);
  377. return true;
  378. }
  379. protected function performCopy($sPackagePath, &$sHomePath)
  380. {
  381. if($this->bUseFtp) {
  382. $sLogin = getParam('sys_ftp_login');
  383. $sPassword = getParam('sys_ftp_password');
  384. $sPath = getParam('sys_ftp_dir');
  385. if(empty($sLogin) || empty($sPassword) || empty($sPath))
  386. return _t('_adm_str_err_no_ftp_info');
  387. $oFile = new BxDolFtp($_SERVER['HTTP_HOST'], $sLogin, $sPassword, $sPath);
  388. if(!$oFile->connect())
  389. return _t('_adm_str_err_cannot_connect_to_ftp');
  390. if(!$oFile->isTrident())
  391. return _t('_adm_str_err_destination_not_valid');
  392. }
  393. else
  394. $oFile = BxDolFile::getInstance();
  395. $aConfig = self::getModuleConfig($sPackagePath . 'install/config.php');
  396. if(empty($aConfig) || !is_array($aConfig) || empty($aConfig['home_dir']))
  397. return _t('_adm_str_err_wrong_package_format');
  398. $sHomePath = $aConfig['home_dir'];
  399. if(!$oFile->copy($sPackagePath, 'modules/' . $sHomePath))
  400. return _t('_adm_str_err_files_copy_failed');
  401. return true;
  402. }
  403. protected function getConfigModule($sConfigPath, $aInstalled = array())
  404. {
  405. $aConfig = self::getModuleConfig($sConfigPath);
  406. if(empty($aConfig) || !is_array($aConfig))
  407. return array();
  408. $bInstalled = !empty($aInstalled);
  409. $bEnabled = $bInstalled && (int)$aInstalled['enabled'] == 1;
  410. $sVersion = $bInstalled ? $aInstalled['version'] : $aConfig['version'];
  411. return array(
  412. 'type' => $aConfig['type'],
  413. 'name' => isset($aConfig['name']) ? $aConfig['name'] : $aConfig['home_uri'],
  414. 'title' => bx_process_output($aConfig['title']),
  415. 'vendor' => $aConfig['vendor'],
  416. 'version' => $sVersion,
  417. 'uri' => $aConfig['home_uri'],
  418. 'dir' => $aConfig['home_dir'],
  419. 'note' => isset($aConfig['note']) ? bx_process_output($aConfig['note']) : '',
  420. 'installed' => $bInstalled,
  421. 'enabled' => $bEnabled
  422. );
  423. }
  424. protected function getConfigUpdate($sConfigPathModule, $sConfigPathUpdate, $aInstalledModule = array())
  425. {
  426. $aModule = $this->getConfigModule($sConfigPathModule, $aInstalledModule);
  427. if(empty($aModule) || !$aModule['installed'])
  428. return array();
  429. $aConfig = self::getModuleConfig($sConfigPathUpdate);
  430. if(empty($aConfig) || !is_array($aConfig))
  431. return array();
  432. return array(
  433. 'title' => bx_process_output($aConfig['title']),
  434. 'vendor' => $aConfig['vendor'],
  435. 'version_from' => $aConfig['version_from'],
  436. 'version_to' => $aConfig['version_to'],
  437. 'dir' => $aConfig['home_dir'],
  438. 'module_type' => $aModule['type'],
  439. 'module_name' => $aModule['name'],
  440. 'module_dir' => $aModule['dir'],
  441. 'module_version' => $aModule['version']
  442. );
  443. }
  444. private function getInstalledInfo()
  445. {
  446. $aModules = BxDolModuleQuery::getInstance()->getModules();
  447. $aInstalledInfo = array();
  448. foreach($aModules as $aModule)
  449. $aInstalledInfo[$aModule['path']] = $aModule;
  450. return $aInstalledInfo;
  451. }
  452. private function addTransientJob($sName, $sAction, $aParams)
  453. {
  454. if(BxDolCronQuery::getInstance()->addTransientJobService($sName, array('system', $sAction, $aParams, 'DolStudioInstallerUtils')))
  455. return true;
  456. return false;
  457. }
  458. private function emailNotify($sMessage)
  459. {
  460. sendMailTemplateSystem('t_BgOperationFailed', array (
  461. 'conclusion' => strip_tags($sMessage),
  462. ));
  463. }
  464. private function emailNotifyModulesUpgrade($sResult, $aData)
  465. {
  466. $oModuleQuery = BxDolModuleQuery::getInstance();
  467. $sConclusion = '';
  468. if(!empty($aData))
  469. foreach($aData as $sModule => $sMessage) {
  470. $aModule = $oModuleQuery->getModuleByName($sModule);
  471. $sConclusion .= _t('_sys_et_txt_body_modules_upgrade_' . $sResult, $aModule['title'], $sMessage);
  472. }
  473. sendMailTemplateSystem('t_UpgradeModules' . ucfirst($sResult), array (
  474. 'conclusion' => $sConclusion,
  475. ));
  476. }
  477. }
  478. /** @} */