diff --git a/gulliver/bin/tasks/pakeGulliver.php b/gulliver/bin/tasks/pakeGulliver.php index 3127e8d58..ce6721b17 100755 --- a/gulliver/bin/tasks/pakeGulliver.php +++ b/gulliver/bin/tasks/pakeGulliver.php @@ -52,8 +52,10 @@ pake_task('new-plugin', 'project_exists'); pake_desc("Update the plugin attributes in all workspaces\n args: "); pake_task("update-plugin-attributes", "project_exists"); +/*----------------------------------********---------------------------------*/ pake_desc("Check disabled code in plugins\n args: [enterprise-plugin|custom-plugin|all|]"); pake_task("check-plugin-disabled-code", "project_exists"); +/*----------------------------------********---------------------------------*/ pake_desc("pack plugin in .tar file \n args: "); pake_task('pack-plugin', 'project_exists'); @@ -2573,8 +2575,8 @@ function checkFileStandardCode ( $file ) { } } - -function checkFolderStandardCode ( $folder, $bSubFolders ) { +/*----------------------------------********---------------------------------*/ +/*function checkFolderStandardCode ( $folder, $bSubFolders ) { global $aFiles; $rootFolder = str_replace ( PATH_TRUNK, '', $folder ); //printf("%s \n", pakeColor::colorize($rootFolder, 'INFO')); @@ -2591,8 +2593,10 @@ function checkFolderStandardCode ( $folder, $bSubFolders ) { } } } -} +}*/ +/*----------------------------------********---------------------------------*/ +/*----------------------------------********---------------------------------*/ function run_check_standard_code ( $task, $options) { global $aFiles; $aFiles = array(); @@ -2619,7 +2623,7 @@ function run_check_standard_code ( $task, $options) { pakeColor::colorize($val['dos'] ? 'dos' : ' ', 'INFO'), $val['file'] ); } } - +/*----------------------------------********---------------------------------*/ function run_update_plugin_attributes($task, $args) { try { diff --git a/workflow/engine/classes/class.case.php b/workflow/engine/classes/class.case.php index 2a1a47f62..b79ea1a1c 100755 --- a/workflow/engine/classes/class.case.php +++ b/workflow/engine/classes/class.case.php @@ -3283,7 +3283,9 @@ class Cases public function executeTriggers($sTasUid, $sStepType, $sStepUidObj, $sTriggerType, $aFields = array()) { + /*----------------------------------********---------------------------------*/ G::LoadClass("codeScanner"); + /*----------------------------------********---------------------------------*/ $aTriggers = $this->loadTriggers($sTasUid, $sStepType, $sStepUidObj, $sTriggerType); @@ -3295,12 +3297,14 @@ class Cases $arraySystemConfiguration = System::getSystemConfiguration(PATH_CONFIG . "env.ini"); + /*----------------------------------********---------------------------------*/ $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 (count($arrayFoundDisabledCode) > 0) { @@ -3313,7 +3317,7 @@ class Cases $strFoundDisabledCode .= "
- " . $aTrigger["TRI_TITLE"] . ": " . $strCodeAndLine; continue; } - + /*----------------------------------********---------------------------------*/ //Execute $bExecute = true; @@ -3327,10 +3331,11 @@ class Cases $oPMScript->execute(); } } - + /*----------------------------------********---------------------------------*/ if ($strFoundDisabledCode != "") { G::SendTemporalMessage(G::LoadTranslation("ID_DISABLED_CODE_TRIGGER_TO_EXECUTE", array($strFoundDisabledCode)), "", "string"); } + /*----------------------------------********---------------------------------*/ return $oPMScript->aFields; } else { diff --git a/workflow/engine/classes/class.processes.php b/workflow/engine/classes/class.processes.php index 6606112b4..8ab163817 100755 --- a/workflow/engine/classes/class.processes.php +++ b/workflow/engine/classes/class.processes.php @@ -4431,13 +4431,16 @@ class Processes public function getDisabledCode($processUid = "") { try { + /*----------------------------------********---------------------------------*/ G::LoadClass("codeScanner"); + /*----------------------------------********---------------------------------*/ $arrayDisabledCode = array(); //Set variables + /*----------------------------------********---------------------------------*/ $cs = new CodeScanner("DISABLED_CODE"); - + /*----------------------------------********---------------------------------*/ $delimiter = DBAdapter::getStringDelimiter(); //Processes diff --git a/workflow/engine/methods/login/retrivePassword.php b/workflow/engine/methods/login/retrivePassword.php index a4db15b51..55f116b30 100755 --- a/workflow/engine/methods/login/retrivePassword.php +++ b/workflow/engine/methods/login/retrivePassword.php @@ -8,6 +8,7 @@ G::LoadClass("system"); $rbacUser = new RbacUsers(); $user = new Users(); +die($data['USR_USERNAME']); $data['USR_USERNAME'] = strip_tags($data['USR_USERNAME']); $userData = $rbacUser->getByUsername($data['USR_USERNAME']); diff --git a/workflow/engine/methods/processes/processes_Import_Ajax.php b/workflow/engine/methods/processes/processes_Import_Ajax.php index 349fcfee3..8e7f1ab1b 100644 --- a/workflow/engine/methods/processes/processes_Import_Ajax.php +++ b/workflow/engine/methods/processes/processes_Import_Ajax.php @@ -40,14 +40,13 @@ if (isset($_FILES["PROCESS_FILENAME"]) && fclose($fh); if (is_object($data) && isset($data->triggers) && is_array($data->triggers) && count($data->triggers) > 0) { + /*----------------------------------********---------------------------------*/ 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) { $arrayTriggerData = $value; @@ -63,7 +62,7 @@ if (isset($_FILES["PROCESS_FILENAME"]) && $strFoundDisabledCode .= (($strFoundDisabledCode != "")? "\n" : "") . "- " . $arrayTriggerData["TRI_TITLE"] . ": " . $strCodeAndLine; } } - + if ($strFoundDisabledCode != "") { $response["status"] = "DISABLED-CODE"; $response["success"] = true; @@ -72,6 +71,7 @@ if (isset($_FILES["PROCESS_FILENAME"]) && echo G::json_encode($response); exit(0); } + /*----------------------------------********---------------------------------*/ } } catch (Exception $e) { $response["status"] = "ERROR"; diff --git a/workflow/engine/methods/setup/pluginsChange.php b/workflow/engine/methods/setup/pluginsChange.php index 68895a2f2..8f070a65a 100755 --- a/workflow/engine/methods/setup/pluginsChange.php +++ b/workflow/engine/methods/setup/pluginsChange.php @@ -48,13 +48,15 @@ if ($handle = opendir( PATH_PLUGINS )) { $pluginName = str_replace(".php", "", $pluginFile); if (is_file(PATH_PLUGINS . $pluginName . ".php") && is_dir(PATH_PLUGINS . $pluginName)) { + /*----------------------------------********---------------------------------*/ //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)); if (count($arrayFoundDisabledCode) > 0) { @@ -65,7 +67,7 @@ if ($handle = opendir( PATH_PLUGINS )) { echo G::json_encode($response); exit(0); } - + /*----------------------------------********---------------------------------*/ //print "change to ENABLED"; require_once(PATH_PLUGINS . $pluginFile); $details = $oPluginRegistry->getPluginDetails($pluginFile); diff --git a/workflow/engine/methods/setup/pluginsImportFile.php b/workflow/engine/methods/setup/pluginsImportFile.php index 16c97ddd8..69a90098e 100755 --- a/workflow/engine/methods/setup/pluginsImportFile.php +++ b/workflow/engine/methods/setup/pluginsImportFile.php @@ -163,12 +163,11 @@ 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" : ""); $arrayFoundDisabledCode = array_merge($cs->checkDisabledCode("FILE", $path . $pluginFile), $cs->checkDisabledCode("PATH", $path . $sClassName)); @@ -176,7 +175,8 @@ try { if (count($arrayFoundDisabledCode) > 0) { 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 5f841c7d1..a36d7ed6c 100755 --- a/workflow/engine/methods/triggers/triggers_Save.php +++ b/workflow/engine/methods/triggers/triggers_Save.php @@ -67,8 +67,9 @@ if (isset( $sfunction ) && $sfunction == 'lookforNameTrigger') { echo $flag; } else { G::LoadClass("processMap"); + /*----------------------------------********---------------------------------*/ G::LoadClass("codeScanner"); - + /*----------------------------------********---------------------------------*/ $response = array(); try { @@ -82,9 +83,9 @@ if (isset( $sfunction ) && $sfunction == 'lookforNameTrigger') { } if (isset($value["TRI_WEBBOT"])) { + /*----------------------------------********---------------------------------*/ //Check disabled code $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"]); @@ -98,6 +99,7 @@ if (isset( $sfunction ) && $sfunction == 'lookforNameTrigger') { throw new Exception(G::LoadTranslation("ID_DISABLED_CODE_TRIGGER", array($strCodeAndLine))); } + /*----------------------------------********---------------------------------*/ } if ($value['TRI_UID'] != '') {