diff --git a/manifest.yml b/manifest.yml index 7de205d5..ace024fe 100644 --- a/manifest.yml +++ b/manifest.yml @@ -11,7 +11,7 @@ description: text: WordPress Standalone with built-in kit for choosing optimal application servers and a set of advanced features for running websites and blogs. WordPress CMS deployed as a lightweight standalone container with minimal allocated resources for cost efficiency. short: WordPress Standalone with built-in kit for choosing optimal application servers and a set of advanced features for running websites and blogs -baseUrl: https://raw.githubusercontent.com/jelastic-jps/wordpress/v2.2.0 +baseUrl: https://raw.githubusercontent.com/sych74/wordpress/JE-61517 onBeforeInit: /scripts/beforeInit.js?_r=${fn.random} onBeforeInstall: /scripts/beforeInstall.js?_r=${fn.random} @@ -20,6 +20,7 @@ nodes: definedInOnBeforeInstall skipNodeEmails: true settings: + onBeforeInit: return settings; fields: - caption: Advanced Features type: displayfield diff --git a/scripts/beforeInit.js b/scripts/beforeInit.js index 02585e25..ab214b8d 100644 --- a/scripts/beforeInit.js +++ b/scripts/beforeInit.js @@ -38,7 +38,21 @@ var extIP = "environment.externalip.enabled", extIPperNode = "environment.externalip.maxcount.per.node", markup = "", cur = null, text = "used", LE = true; -var quotas = jelastic.billing.account.GetQuotas(extIP + ";"+extIPperEnv+";" + extIPperNode ).array; +var hasCollaboration = (parseInt('${fn.compareEngine(7.0)}', 10) >= 0), + quotas = [], group; + +if (hasCollaboration) { + quotas = [ + { quota : { name: extIP }, value: parseInt('${quota.environment.externalip.enabled}', 10) }, + { quota : { name: extIPperEnv }, value: parseInt('${quota.environment.externalip.maxcount}', 10) }, + { quota : { name: extIPperNode }, value: parseInt('${quota.environment.externalip.maxcount.per.node}', 10) } + ]; + group = { groupType: '${account.groupType}' }; +} else { + quotas = jelastic.billing.account.GetQuotas(extIP + ";"+extIPperEnv+";" + extIPperNode).array; + group = jelastic.billing.account.GetAccount(appid, session); +} + for (var i = 0; i < quotas.length; i++){ var q = quotas[i], n = toNative(q.quota.name);