diff --git a/gulliver/bin/tasks/pakeGulliver.php b/gulliver/bin/tasks/pakeGulliver.php index 747897e4b..a26524f29 100755 --- a/gulliver/bin/tasks/pakeGulliver.php +++ b/gulliver/bin/tasks/pakeGulliver.php @@ -2736,7 +2736,7 @@ function run_check_plugin_disabled_code($task, $args) $arrayFoundDisabledCode = array_merge($cs->checkDisabledCode("FILE", PATH_PLUGINS . $pluginName . ".php"), $cs->checkDisabledCode("PATH", PATH_PLUGINS . $pluginName)); - if (count($arrayFoundDisabledCode) > 0) { + if (!empty($arrayFoundDisabledCode)) { $strFoundDisabledCode .= (($strFoundDisabledCode != "")? "\n\n" : "") . "> " . $pluginName; foreach ($arrayFoundDisabledCode as $key2 => $value2) { diff --git a/gulliver/system/class.codeScanner.php b/gulliver/system/class.codeScanner.php index b02c7dd01..cb12e9a37 100644 --- a/gulliver/system/class.codeScanner.php +++ b/gulliver/system/class.codeScanner.php @@ -80,7 +80,7 @@ class CodeScanner public function existsDisabledCode() { try { - return count($this->arrayDisabledCode) > 0; + return !empty($this->arrayDisabledCode); } catch (Exception $e) { throw $e; } @@ -174,7 +174,7 @@ class CodeScanner $arrayAux = $this->checkDisabledCodeInSource($source); - if (count($arrayAux) > 0) { + if (!empty($arrayAux)) { $arrayFoundCode["source"] = $arrayAux; } break; @@ -202,7 +202,7 @@ class CodeScanner $arrayAux = $this->checkDisabledCodeInSource($source); - if (count($arrayAux) > 0) { + if (!empty($arrayAux)) { $arrayFoundCode[$path] = $arrayAux; } } diff --git a/workflow/engine/bin/tasks/cliWorkspaces.php b/workflow/engine/bin/tasks/cliWorkspaces.php index d019270ef..2b0ba44a7 100755 --- a/workflow/engine/bin/tasks/cliWorkspaces.php +++ b/workflow/engine/bin/tasks/cliWorkspaces.php @@ -595,12 +595,24 @@ function run_check_workspace_disabled_code($args, $opts) foreach ($arrayWorkspace as $value) { $workspace = $value; + if (!defined("SYS_SYS")) { + define("SYS_SYS", $workspace->name); + } + + if (!defined("PATH_DATA_SITE")) { + define("PATH_DATA_SITE", PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP); + } + + if (!$workspace->pmLicensedFeaturesVerifyFeature("B0oWlBLY3hHdWY0YUNpZEtFQm5CeTJhQlIwN3IxMEkwaG4=")) { + throw new Exception("Error: This command cannot be used because your license does not include it."); + } + echo "> Workspace: " . $workspace->name . "\n"; try { $arrayFoundDisabledCode = $workspace->getDisabledCode(); - if (count($arrayFoundDisabledCode) > 0) { + if (!empty($arrayFoundDisabledCode)) { $strFoundDisabledCode = ""; foreach ($arrayFoundDisabledCode as $value2) { @@ -630,6 +642,8 @@ function run_check_workspace_disabled_code($args, $opts) } catch (Exception $e) { echo "Errors to check disabled code: " . CLI::error($e->getMessage()) . "\n\n"; } + + $workspace->close(); } echo "Done!\n"; @@ -672,4 +686,4 @@ function migrate_new_cases_lists($command, $args) { } } } -/*----------------------------------********---------------------------------*/ \ No newline at end of file +/*----------------------------------********---------------------------------*/ diff --git a/workflow/engine/classes/class.case.php b/workflow/engine/classes/class.case.php index 1e3a1dcf9..942ccefe9 100755 --- a/workflow/engine/classes/class.case.php +++ b/workflow/engine/classes/class.case.php @@ -3373,25 +3373,29 @@ class Cases /*----------------------------------********---------------------------------*/ $cs = new CodeScanner((isset($arraySystemConfiguration["enable_blacklist"]) && (int)($arraySystemConfiguration["enable_blacklist"]) == 1)? "DISABLED_CODE" : ""); + $strFoundDisabledCode = ""; /*----------------------------------********---------------------------------*/ foreach ($aTriggers as $aTrigger) { - //Check disabled code /*----------------------------------********---------------------------------*/ - $arrayFoundDisabledCode = $cs->checkDisabledCode("SOURCE", $aTrigger["TRI_WEBBOT"]); + if (PMLicensedFeatures::getSingleton()->verifyfeature("B0oWlBLY3hHdWY0YUNpZEtFQm5CeTJhQlIwN3IxMEkwaG4=")) { + //Check disabled code + $arrayFoundDisabledCode = $cs->checkDisabledCode("SOURCE", $aTrigger["TRI_WEBBOT"]); - if (count($arrayFoundDisabledCode) > 0) { - $strCodeAndLine = ""; + if (!empty($arrayFoundDisabledCode)) { + $strCodeAndLine = ""; - foreach ($arrayFoundDisabledCode["source"] as $key => $value) { - $strCodeAndLine .= (($strCodeAndLine != "")? ", " : "") . G::LoadTranslation("ID_DISABLED_CODE_CODE_AND_LINE", array($key, implode(", ", $value))); + foreach ($arrayFoundDisabledCode["source"] as $key => $value) { + $strCodeAndLine .= (($strCodeAndLine != "")? ", " : "") . G::LoadTranslation("ID_DISABLED_CODE_CODE_AND_LINE", array($key, implode(", ", $value))); + } + + $strFoundDisabledCode .= "
- " . $aTrigger["TRI_TITLE"] . ": " . $strCodeAndLine; + continue; } - - $strFoundDisabledCode .= "
- " . $aTrigger["TRI_TITLE"] . ": " . $strCodeAndLine; - continue; } /*----------------------------------********---------------------------------*/ + //Execute $bExecute = true; @@ -6745,7 +6749,7 @@ class Cases $rows[] = $rs->getRow(); } - if ($PRO_UID != null) { + if ($PRO_UID != null) { //Add supervisor // Users $oCriteria = new Criteria('workflow'); @@ -6765,10 +6769,10 @@ class Cases $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); $flagSupervisors = false; - if ($oDataset->next()) { + if ($oDataset->next()) { if (!in_array($USR_UID,$row)) { $rows[] = $oDataset->getRow(); - } + } $flagSupervisors = true; } @@ -6908,7 +6912,7 @@ class Cases unset($aFields['APP_STATUS']); unset($aFields['APP_PROC_STATUS']); unset($aFields['APP_PROC_CODE']); - unset($aFields['APP_PIN']); + unset($aFields['APP_PIN']); $this->updateCase($aFields['APP_UID'], $aFields); return true; } diff --git a/workflow/engine/classes/class.processes.php b/workflow/engine/classes/class.processes.php index 792e124e8..3076814c7 100755 --- a/workflow/engine/classes/class.processes.php +++ b/workflow/engine/classes/class.processes.php @@ -5085,10 +5085,15 @@ class Processes $arrayDisabledCode = array(); + /*----------------------------------********---------------------------------*/ + if (!PMLicensedFeatures::getSingleton()->verifyfeature("B0oWlBLY3hHdWY0YUNpZEtFQm5CeTJhQlIwN3IxMEkwaG4=")) { + //Return + return $arrayDisabledCode; + } + //Set variables - /*----------------------------------********---------------------------------*/ $cs = new CodeScanner("DISABLED_CODE"); - /*----------------------------------********---------------------------------*/ + $delimiter = DBAdapter::getStringDelimiter(); //Processes @@ -5144,7 +5149,7 @@ class Processes //Check disabled code $arrayFoundDisabledCode = $cs->checkDisabledCode("SOURCE", $triggerWebbot); - if (count($arrayFoundDisabledCode) > 0) { + if (!empty($arrayFoundDisabledCode)) { if (!isset($arrayDisabledCode[$processUid])) { $arrayDisabledCode[$processUid] = array( "processUid" => $processUid, @@ -5161,6 +5166,7 @@ class Processes } } } + /*----------------------------------********---------------------------------*/ //Return return $arrayDisabledCode; diff --git a/workflow/engine/classes/class.wsBase.php b/workflow/engine/classes/class.wsBase.php index ea7aa685b..b33bab65f 100755 --- a/workflow/engine/classes/class.wsBase.php +++ b/workflow/engine/classes/class.wsBase.php @@ -914,31 +914,41 @@ class wsBase $aAttachment = null, $showMessage = true, $delIndex = 0, - $config = array() + $config = array() ) { try { if (!class_exists('System')) { G::LoadClass('system'); } - $licensedFeatures = & PMLicensedFeatures::getSingleton(); + /*----------------------------------********---------------------------------*/ - if (!empty($config) && $licensedFeatures->verifyfeature('nKaNTNuT1MzK0RsMEtXTnYzR09ucHF2WGNuS0hRdDBBak42WXJhNVVOOG1INEVoaU1EaTllbjBBeEJNeG9wRVJ6NmxQelhyVTBvdThzPQ==')) { - if(!is_array($config)){ - $emailServer = new EmailServer(); - $criteria = $emailServer->getSelAllColumns(); - $criteria->add(EmailServerPeer::MESS_UID, $config, CRITERIA::EQUAL); - $criteria = EmailServerPeer::doSelectRS($criteria); - $criteria->setFetchmode(ResultSet::FETCHMODE_ASSOC); - while ($criteria->next()) { - $row = $criteria->getRow(); - $config = $row; - $config['SMTPSecure'] = $row['SMTPSECURE']; + if (PMLicensedFeatures::getSingleton()->verifyfeature("zIKRGpDM3pjcHFsWGplNDN0dTl5bGN3UTNiOWdQU0E5Q05QTksrU1ladWQ0VT0=")) { + $arrayConfigAux = array(); + + if (is_array($config)) { + $arrayConfigAux = $config; + } else { + $emailServer = new \ProcessMaker\BusinessModel\EmailServer(); + + $criteria = $emailServer->getEmailServerCriteria(); + + $criteria->add(EmailServerPeer::MESS_UID, $config, Criteria::EQUAL); + + $rsCriteria = EmailServerPeer::doSelectRS($criteria); + $rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC); + + if ($rsCriteria->next()) { + $row = $rsCriteria->getRow(); + + $arrayConfigAux = $row; + $arrayConfigAux["SMTPSecure"] = $row["SMTPSECURE"]; } } - $aSetup = $config; + + $aSetup = (!empty($arrayConfigAux))? $arrayConfigAux : System::getEmailConfiguration(); } else { /*----------------------------------********---------------------------------*/ - $aSetup = System::getEmailConfiguration(); + $aSetup = (is_array($config) && !empty($config))? $config : System::getEmailConfiguration(); /*----------------------------------********---------------------------------*/ } /*----------------------------------********---------------------------------*/ diff --git a/workflow/engine/classes/class.wsTools.php b/workflow/engine/classes/class.wsTools.php index 944ab1734..27131d0a0 100755 --- a/workflow/engine/classes/class.wsTools.php +++ b/workflow/engine/classes/class.wsTools.php @@ -795,10 +795,11 @@ class workspaceTools //Insert the first record $arrayData = array(); - $emailSever = new \ProcessMaker\BusinessModel\EmailServer(); + $emailSever = new \ProcessMaker\BusinessModel\EmailServer(); + $emailConfiguration = System::getEmailConfiguration(); - if (count($emailConfiguration) > 0) { + if (!empty($emailConfiguration)) { $arrayData["MESS_ENGINE"] = $emailConfiguration["MESS_ENGINE"]; switch ($emailConfiguration["MESS_ENGINE"]) { @@ -830,18 +831,16 @@ class workspaceTools $arrayData = $emailSever->create($arrayData); } else { /*----------------------------------********---------------------------------*/ - if (true) { - // - } else { + if (!PMLicensedFeatures::getSingleton()->verifyfeature("zIKRGpDM3pjcHFsWGplNDN0dTl5bGN3UTNiOWdQU0E5Q05QTksrU1ladWQ0VT0=")) { /*----------------------------------********---------------------------------*/ - $arrayData["MESS_ENGINE"] = "MAIL"; - $arrayData["MESS_SERVER"] = ""; - $arrayData["MESS_ACCOUNT"] = ""; - $arrayData["MESS_PASSWORD"] = ""; - $arrayData["MAIL_TO"] = ""; - $arrayData["MESS_DEFAULT"] = 1; + $arrayData["MESS_ENGINE"] = "MAIL"; + $arrayData["MESS_SERVER"] = ""; + $arrayData["MESS_ACCOUNT"] = ""; + $arrayData["MESS_PASSWORD"] = ""; + $arrayData["MAIL_TO"] = ""; + $arrayData["MESS_DEFAULT"] = 1; - $arrayData = $emailSever->create2($arrayData); + $arrayData = $emailSever->create2($arrayData); /*----------------------------------********---------------------------------*/ } /*----------------------------------********---------------------------------*/ @@ -2202,5 +2201,28 @@ class workspaceTools return true; } } + + /** + * Verify feature + * + * @param string $featureName Feature name + * + * return bool Return true if is valid the feature, false otherwise + */ + public function pmLicensedFeaturesVerifyFeature($featureName) + { + try { + $this->initPropel(true); + + $flag = PMLicensedFeatures::getSingleton()->verifyfeature($featureName); + + $this->close(); + + //Return + return $flag; + } catch (Exception $e) { + throw $e; + } + } } diff --git a/workflow/engine/classes/model/EmailServer.php b/workflow/engine/classes/model/EmailServer.php index 8f0a58caf..f961d4f1a 100644 --- a/workflow/engine/classes/model/EmailServer.php +++ b/workflow/engine/classes/model/EmailServer.php @@ -1,27 +1,5 @@ addSelectColumn( EmailServerPeer::MESS_UID); - $criteria->addSelectColumn( EmailServerPeer::MESS_ENGINE); - $criteria->addSelectColumn( EmailServerPeer::MESS_SERVER); - $criteria->addSelectColumn( EmailServerPeer::MESS_PORT); - $criteria->addSelectColumn( EmailServerPeer::MESS_RAUTH); - $criteria->addSelectColumn( EmailServerPeer::MESS_ACCOUNT); - $criteria->addSelectColumn( EmailServerPeer::MESS_PASSWORD); - $criteria->addSelectColumn( EmailServerPeer::MESS_FROM_MAIL); - $criteria->addSelectColumn( EmailServerPeer::MESS_FROM_NAME); - $criteria->addSelectColumn( EmailServerPeer::SMTPSECURE); - $criteria->addSelectColumn( EmailServerPeer::MESS_TRY_SEND_INMEDIATLY); - $criteria->addSelectColumn( EmailServerPeer::MAIL_TO); - $criteria->addSelectColumn( EmailServerPeer::MESS_DEFAULT); - return $criteria; - } } diff --git a/workflow/engine/controllers/designer.php b/workflow/engine/controllers/designer.php index f0faf373d..ba1c94551 100644 --- a/workflow/engine/controllers/designer.php +++ b/workflow/engine/controllers/designer.php @@ -66,7 +66,7 @@ class Designer extends Controller if ($licensedFeatures->verifyfeature('7TTeDBQeWRoZTZKYjh4eFpYUlRDUUEyVERPU3FxellWank=')) { $consolidated = 1; } - $enterprise = 1; + $enterprise = ($licensedFeatures->verifyfeature("Jb0N3dSZHVhZ1JNOEFZaElqdm15Y050Wmh5S0FEVEI0ckQ="))? 1 : 0; /*----------------------------------********---------------------------------*/ $this->setVar('prj_uid', $proUid); diff --git a/workflow/engine/methods/emailServer/emailServer.php b/workflow/engine/methods/emailServer/emailServer.php index 7f65cf1dd..237f9e136 100644 --- a/workflow/engine/methods/emailServer/emailServer.php +++ b/workflow/engine/methods/emailServer/emailServer.php @@ -18,5 +18,9 @@ $headPublisher->addContent("emailServer/emailServer"); //Adding a HTML file $headPublisher->addExtJsScript("emailServer/emailServer", false); //Adding a JavaScript file $headPublisher->assign("CONFIG", $arrayConfig); +/*----------------------------------********---------------------------------*/ +$headPublisher->assign("EMAILSERVER_LICENSED", (PMLicensedFeatures::getSingleton()->verifyfeature("zIKRGpDM3pjcHFsWGplNDN0dTl5bGN3UTNiOWdQU0E5Q05QTksrU1ladWQ0VT0="))? 1 : 0); +/*----------------------------------********---------------------------------*/ + G::RenderPage("publish", "extJs"); diff --git a/workflow/engine/methods/processes/processes_Import_Ajax.php b/workflow/engine/methods/processes/processes_Import_Ajax.php index a9c75b6e6..392556d99 100644 --- a/workflow/engine/methods/processes/processes_Import_Ajax.php +++ b/workflow/engine/methods/processes/processes_Import_Ajax.php @@ -26,7 +26,9 @@ use \ProcessMaker\Importer\XmlImporter; ini_set("max_execution_time", 0); -if (isset($_FILES["PROCESS_FILENAME"]) && +/*----------------------------------********---------------------------------*/ +if (PMLicensedFeatures::getSingleton()->verifyfeature("B0oWlBLY3hHdWY0YUNpZEtFQm5CeTJhQlIwN3IxMEkwaG4=") && + isset($_FILES["PROCESS_FILENAME"]) && pathinfo($_FILES["PROCESS_FILENAME"]["name"], PATHINFO_EXTENSION) == "pm" && $_FILES["PROCESS_FILENAME"]["error"] == 0 ) { @@ -39,12 +41,13 @@ if (isset($_FILES["PROCESS_FILENAME"]) && $data = unserialize($content); fclose($fh); - if (is_object($data) && isset($data->triggers) && is_array($data->triggers) && count($data->triggers) > 0) { - /*----------------------------------********---------------------------------*/ + if (is_object($data) && isset($data->triggers) && is_array($data->triggers) && !empty($data->triggers)) { G::LoadClass("codeScanner"); $arraySystemConfiguration = System::getSystemConfiguration(PATH_CONFIG . "env.ini"); + $cs = new CodeScanner((isset($arraySystemConfiguration["enable_blacklist"]) && (int)($arraySystemConfiguration["enable_blacklist"]) == 1)? "DISABLED_CODE" : ""); + $strFoundDisabledCode = ""; foreach ($data->triggers as $value) { @@ -52,7 +55,7 @@ if (isset($_FILES["PROCESS_FILENAME"]) && $arrayFoundDisabledCode = $cs->checkDisabledCode("SOURCE", $arrayTriggerData["TRI_WEBBOT"]); - if (count($arrayFoundDisabledCode) > 0) { + if (!empty($arrayFoundDisabledCode)) { $strCodeAndLine = ""; foreach ($arrayFoundDisabledCode["source"] as $key2 => $value2) { @@ -71,7 +74,6 @@ if (isset($_FILES["PROCESS_FILENAME"]) && echo G::json_encode($response); exit(0); } - /*----------------------------------********---------------------------------*/ } } catch (Exception $e) { $response["status"] = "ERROR"; @@ -82,6 +84,7 @@ if (isset($_FILES["PROCESS_FILENAME"]) && exit(0); } } +/*----------------------------------********---------------------------------*/ if (isset($_FILES["PROCESS_FILENAME"]) && pathinfo($_FILES["PROCESS_FILENAME"]["name"], PATHINFO_EXTENSION) == "pmx" @@ -225,7 +228,7 @@ if ($action == "uploadFileNewProcess") { //1 -exist process $result->ExistGroupsInDatabase = ""; //"" -Default //0 -Dont exist process - //1 -exist process + //1 -exist process $optionGroupExistInDatabase = isset( $_REQUEST["optionGroupExistInDatabase"] ) ? $_REQUEST["optionGroupExistInDatabase"] : null; //!Upload file @@ -254,8 +257,8 @@ if ($action == "uploadFileNewProcess") { //if file is a .pm file continues normally the importing if ($processFileType == "pm") { $oData = $oProcess->getProcessData( $path . $filename ); - } - + } + $importer->throwExceptionIfExistsReservedWordsSql($oData); //!Upload file diff --git a/workflow/engine/methods/setup/pluginsChange.php b/workflow/engine/methods/setup/pluginsChange.php index 1ba948ccb..ce87b591d 100755 --- a/workflow/engine/methods/setup/pluginsChange.php +++ b/workflow/engine/methods/setup/pluginsChange.php @@ -52,25 +52,27 @@ if ($handle = opendir( PATH_PLUGINS )) { if (is_file(PATH_PLUGINS . $pluginName . ".php") && is_dir(PATH_PLUGINS . $pluginName)) { /*----------------------------------********---------------------------------*/ - //Check disabled code - G::LoadClass("codeScanner"); - /*----------------------------------********---------------------------------*/ + if (PMLicensedFeatures::getSingleton()->verifyfeature("B0oWlBLY3hHdWY0YUNpZEtFQm5CeTJhQlIwN3IxMEkwaG4=")) { + //Check disabled code + G::LoadClass("codeScanner"); - $arraySystemConfiguration = System::getSystemConfiguration(PATH_CONFIG . "env.ini"); - /*----------------------------------********---------------------------------*/ - $cs = new CodeScanner((isset($arraySystemConfiguration["enable_blacklist"]) && (int)($arraySystemConfiguration["enable_blacklist"]) == 1)? "DISABLED_CODE" : ""); - - $arrayFoundDisabledCode = array_merge($cs->checkDisabledCode("FILE", PATH_PLUGINS . $pluginName . ".php"), $cs->checkDisabledCode("PATH", PATH_PLUGINS . $pluginName)); + $arraySystemConfiguration = System::getSystemConfiguration(PATH_CONFIG . "env.ini"); - if (count($arrayFoundDisabledCode) > 0) { - $response = array(); - $response["status"] = "DISABLED-CODE"; - $response["message"] = G::LoadTranslation("ID_DISABLED_CODE_PLUGIN"); + $cs = new CodeScanner((isset($arraySystemConfiguration["enable_blacklist"]) && (int)($arraySystemConfiguration["enable_blacklist"]) == 1)? "DISABLED_CODE" : ""); - echo G::json_encode($response); - exit(0); + $arrayFoundDisabledCode = array_merge($cs->checkDisabledCode("FILE", PATH_PLUGINS . $pluginName . ".php"), $cs->checkDisabledCode("PATH", PATH_PLUGINS . $pluginName)); + + if (!empty($arrayFoundDisabledCode)) { + $response = array(); + $response["status"] = "DISABLED-CODE"; + $response["message"] = G::LoadTranslation("ID_DISABLED_CODE_PLUGIN"); + + echo G::json_encode($response); + exit(0); + } } /*----------------------------------********---------------------------------*/ + //print "change to ENABLED"; require_once($path); $details = $oPluginRegistry->getPluginDetails($pluginFile); diff --git a/workflow/engine/methods/setup/pluginsImportFile.php b/workflow/engine/methods/setup/pluginsImportFile.php index e5745908d..e391a2358 100755 --- a/workflow/engine/methods/setup/pluginsImportFile.php +++ b/workflow/engine/methods/setup/pluginsImportFile.php @@ -238,20 +238,24 @@ try { unset( $oClass ); } $res = $tar->extract( $path ); + /*----------------------------------********---------------------------------*/ - //Check disabled code - G::LoadClass("codeScanner"); - - $arraySystemConfiguration = System::getSystemConfiguration(PATH_CONFIG . "env.ini"); - $cs = new CodeScanner((isset($arraySystemConfiguration["enable_blacklist"]) && (int)($arraySystemConfiguration["enable_blacklist"]) == 1)? "DISABLED_CODE" : ""); + if (PMLicensedFeatures::getSingleton()->verifyfeature("B0oWlBLY3hHdWY0YUNpZEtFQm5CeTJhQlIwN3IxMEkwaG4=")) { + //Check disabled code + G::LoadClass("codeScanner"); - $arrayFoundDisabledCode = array_merge($cs->checkDisabledCode("FILE", $path . $pluginFile), $cs->checkDisabledCode("PATH", $path . $sClassName)); + $arraySystemConfiguration = System::getSystemConfiguration(PATH_CONFIG . "env.ini"); - if (count($arrayFoundDisabledCode) > 0) { - throw new Exception(G::LoadTranslation("ID_DISABLED_CODE_PLUGIN")); + $cs = new CodeScanner((isset($arraySystemConfiguration["enable_blacklist"]) && (int)($arraySystemConfiguration["enable_blacklist"]) == 1)? "DISABLED_CODE" : ""); + + $arrayFoundDisabledCode = array_merge($cs->checkDisabledCode("FILE", $path . $pluginFile), $cs->checkDisabledCode("PATH", $path . $sClassName)); + + if (!empty($arrayFoundDisabledCode)) { + throw new Exception(G::LoadTranslation("ID_DISABLED_CODE_PLUGIN")); + } } /*----------------------------------********---------------------------------*/ - + //Check if is enterprise plugin $sContent = file_get_contents( $path . $pluginFile ); $chain = preg_quote( 'extends enterprisePlugin' ); diff --git a/workflow/engine/methods/triggers/triggers_Save.php b/workflow/engine/methods/triggers/triggers_Save.php index b7abc6627..7f84e9a8a 100755 --- a/workflow/engine/methods/triggers/triggers_Save.php +++ b/workflow/engine/methods/triggers/triggers_Save.php @@ -67,9 +67,7 @@ if (isset( $sfunction ) && $sfunction == 'lookforNameTrigger') { echo $flag; } else { G::LoadClass("processMap"); - /*----------------------------------********---------------------------------*/ - G::LoadClass("codeScanner"); - /*----------------------------------********---------------------------------*/ + $response = array(); try { @@ -82,15 +80,20 @@ if (isset( $sfunction ) && $sfunction == 'lookforNameTrigger') { $value = $_POST; } - if (isset($value["TRI_WEBBOT"])) { - /*----------------------------------********---------------------------------*/ + /*----------------------------------********---------------------------------*/ + if (PMLicensedFeatures::getSingleton()->verifyfeature("B0oWlBLY3hHdWY0YUNpZEtFQm5CeTJhQlIwN3IxMEkwaG4=") && + isset($value["TRI_WEBBOT"]) + ) { //Check disabled code + G::LoadClass("codeScanner"); + $arraySystemConfiguration = System::getSystemConfiguration(PATH_CONFIG . "env.ini"); + $cs = new CodeScanner((isset($arraySystemConfiguration["enable_blacklist"]) && (int)($arraySystemConfiguration["enable_blacklist"]) == 1)? "DISABLED_CODE" : ""); $arrayFoundDisabledCode = $cs->checkDisabledCode("SOURCE", $value["TRI_WEBBOT"]); - if (count($arrayFoundDisabledCode) > 0) { + if (!empty($arrayFoundDisabledCode)) { $strCodeAndLine = ""; foreach ($arrayFoundDisabledCode["source"] as $key => $value) { @@ -99,8 +102,9 @@ if (isset( $sfunction ) && $sfunction == 'lookforNameTrigger') { throw new Exception(G::LoadTranslation("ID_DISABLED_CODE_TRIGGER", array($strCodeAndLine))); } - /*----------------------------------********---------------------------------*/ } + /*----------------------------------********---------------------------------*/ + $swCreate = true; if ($value['TRI_UID'] != '') { $oTrigger->load( $value['TRI_UID'] ); @@ -108,7 +112,7 @@ if (isset( $sfunction ) && $sfunction == 'lookforNameTrigger') { $oTrigger->create( $value ); $value['TRI_UID'] = $oTrigger->getTriUid(); $swCreate = false; - } + } $oTrigger->update( $value ); if($swCreate){ //Add Audit Log diff --git a/workflow/engine/templates/emailServer/emailServer.js b/workflow/engine/templates/emailServer/emailServer.js index 540afe30b..91bed9ee9 100644 --- a/workflow/engine/templates/emailServer/emailServer.js +++ b/workflow/engine/templates/emailServer/emailServer.js @@ -40,19 +40,18 @@ emailServer.application = { /*----------------------------------********---------------------------------*/ if (Ext.getCmp("chkEmailServerDefault").checked) { - /*----------------------------------********---------------------------------*/ + /*----------------------------------********---------------------------------*/ var emailDefault = 1; - /*----------------------------------********---------------------------------*/ + /*----------------------------------********---------------------------------*/ } else { var emailDefault = 0; } /*----------------------------------********---------------------------------*/ switch (option) { - case "INS": var typeEmailEngine = Ext.getCmp("cboEmailEngine").getValue(); - + if (typeEmailEngine == "PHPMAILER") { var rdoGrpOption = Ext.getCmp("rdoGrpSmtpSecure").getValue(); @@ -301,7 +300,7 @@ emailServer.application = { emailServerSetMailTo(Ext.getCmp("chkSendTestMail").checked); Ext.getCmp("txtMailTo").setValue(record.get("MAIL_TO")); - + /*----------------------------------********---------------------------------*/ if (parseInt(record.get("MESS_DEFAULT")) == 1) { /*----------------------------------********---------------------------------*/ @@ -311,7 +310,7 @@ emailServer.application = { Ext.getCmp("chkEmailServerDefault").setValue(false); } /*----------------------------------********---------------------------------*/ - + winData.setTitle(_("ID_EMAIL_SERVER_EDIT")); winData.setDisabled(false); winData.show(); @@ -610,7 +609,7 @@ emailServer.application = { } }); - + var txtAccountFrom = new Ext.form.TextField({ id: "txtAccountFrom", name: "txtAccountFrom", @@ -619,7 +618,7 @@ emailServer.application = { vtype: "emailUrlValidation" }); - + var txtPassword = new Ext.form.TextField({ id: "txtPassword", name: "txtPassword", @@ -682,14 +681,14 @@ emailServer.application = { hidden: true }); - + var chkEmailServerDefault = new Ext.form.Checkbox({ id: "chkEmailServerDefault", name: "chkEmailServerDefault", boxLabel: _("ID_EMAIL_SERVER_THIS_CONFIGURATION_IS_DEFAULT") }); - + var btnTest = new Ext.Action({ id: "btnTest", text: _("ID_TEST"), @@ -1049,10 +1048,14 @@ emailServer.application = { var arrayAux1 = []; /*----------------------------------********---------------------------------*/ - arrayAux1.push(btnNew); - arrayAux1.push("-"); + if (EMAILSERVER_LICENSED) { + arrayAux1.push(btnNew); + arrayAux1.push("-"); + } /*----------------------------------********---------------------------------*/ + arrayAux1.push(btnEdit); + /*----------------------------------********---------------------------------*/ arrayAux1.push(btnDelete); arrayAux1.push("->"); @@ -1102,6 +1105,7 @@ emailServer.application = { var arrayAux2 = []; arrayAux2.push(btnEdit); + /*----------------------------------********---------------------------------*/ arrayAux2.push(btnDelete); /*----------------------------------********---------------------------------*/