diff --git a/workflow/engine/methods/login/licenseUpdate.php b/workflow/engine/methods/login/licenseUpdate.php new file mode 100755 index 000000000..4c4eef55a --- /dev/null +++ b/workflow/engine/methods/login/licenseUpdate.php @@ -0,0 +1,77 @@ +installLicense($dir . $aInfoLoadFile["name"], false, false); + + if ($response) { + $licenseManager = new pmLicenseManager(); + preg_match("/^license_(.*).dat$/", $licenseManager->file, $matches); + $realId = urlencode($matches[1]); + + $addonLocation = "http://{$licenseManager->server}/syspmLicenseSrv/en/green/services/addonsStore?action=getInfo&licId=$realId"; + + /////// + $cnn = Propel::getConnection("workflow"); + + $oCriteriaSelect = new Criteria("workflow"); + $oCriteriaSelect->add(AddonsStorePeer::STORE_ID, $licenseManager->id); + + $oCriteriaUpdate = new Criteria("workflow"); + $oCriteriaUpdate->add(AddonsStorePeer::STORE_ID, $licenseManager->id); + $oCriteriaUpdate->add(AddonsStorePeer::STORE_LOCATION, $addonLocation); + + BasePeer::doUpdate($oCriteriaSelect, $oCriteriaUpdate, $cnn); + + //plugin.singleton //are all the plugins that are enabled in the SYS_SYS + $pluginRegistry = &PMPluginRegistry::getSingleton(); + + $arrayAddon = array(); + + //ee //all plugins enterprise installed in /processmaker/workflow/engine/plugins (no matter if they are enabled/disabled) + if (file_exists(PATH_DATA_SITE . "ee")) { + $arrayAddon = unserialize(trim(file_get_contents(PATH_DATA_SITE . "ee"))); + } + + foreach ($arrayAddon as $addon) { + $sFileName = substr($addon["sFilename"], 0, strpos($addon["sFilename"], "-")); + + if (file_exists(PATH_PLUGINS . $sFileName . ".php")) { + $addonDetails = $pluginRegistry->getPluginDetails($sFileName . ".php"); + $enabled = 0; + + if ($addonDetails) { + $enabled = ($addonDetails->enabled)? 1 : 0; + } + + if ($enabled == 1 && !in_array($sFileName, $licenseManager->features)) { + require_once (PATH_PLUGINS . $sFileName . ".php"); + + $pluginRegistry->disablePlugin($sFileName); + } + } + } + + file_put_contents(PATH_DATA_SITE . "plugin.singleton", $pluginRegistry->serializeInstance()); + G::SendTemporalMessage('ID_NLIC', 'info'); + } else { + G::SendTemporalMessage('ID_WARNING_ENTERPRISE_LICENSE_MSG', 'warning'); + } +} + +G::header('Location: ../login/login'); +die(); \ No newline at end of file diff --git a/workflow/engine/xmlform/login/licenseExpired.xml b/workflow/engine/xmlform/login/licenseExpired.xml new file mode 100755 index 000000000..444411421 --- /dev/null +++ b/workflow/engine/xmlform/login/licenseExpired.xml @@ -0,0 +1,12 @@ + + + + + + + License File + + + Update License + + \ No newline at end of file