PMC-1173
This commit is contained in:
committed by
Paula Quispe
parent
1e4f663a53
commit
bd16aeabfd
@@ -3610,7 +3610,8 @@ class Cases
|
||||
}
|
||||
|
||||
/**
|
||||
* Review the code in the trigger if the feature is enable
|
||||
* If the feature is enable and the code_scanner_scope has the argument trigger the code scanner will check the code
|
||||
* Review in the running cases
|
||||
*
|
||||
* @param CodeScanner $cs
|
||||
* @param string $code
|
||||
@@ -3618,12 +3619,14 @@ class Cases
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @link https://wiki.processmaker.com/Plugin_Trigger_Code_Security_Scanner_v2
|
||||
*/
|
||||
private function codeScannerReview(CodeScanner $cs, $code, $triTitle)
|
||||
{
|
||||
$foundDisabledCode = "";
|
||||
/*----------------------------------********---------------------------------*/
|
||||
if (PMLicensedFeatures::getSingleton()->verifyfeature("B0oWlBLY3hHdWY0YUNpZEtFQm5CeTJhQlIwN3IxMEkwaG4=")) {
|
||||
if (PMLicensedFeatures::getSingleton()->verifyfeature("B0oWlBLY3hHdWY0YUNpZEtFQm5CeTJhQlIwN3IxMEkwaG4=") &&
|
||||
in_array('trigger', $cs->getScope())) {
|
||||
//Check disabled code
|
||||
$arrayFoundDisabledCode = $cs->checkDisabledCode("SOURCE", $code);
|
||||
|
||||
|
||||
@@ -6352,17 +6352,21 @@ class Processes
|
||||
}
|
||||
|
||||
/**
|
||||
* Get disabled code
|
||||
* If the feature is enable and the code_scanner_scope has the arguments for enable code scanner
|
||||
* Review the triggers related to the process
|
||||
*
|
||||
* @param string $processUid Unique id of Process
|
||||
* @param string $workspaceName Workspace name
|
||||
*
|
||||
* @return array Returns an array with disabled code found, array empty otherwise
|
||||
* @return array
|
||||
* @throws Exception
|
||||
*
|
||||
* @link https://wiki.processmaker.com/Plugin_Trigger_Code_Security_Scanner_v2
|
||||
*/
|
||||
public function getDisabledCode($processUid = null, $workspaceName = null)
|
||||
{
|
||||
try {
|
||||
$arrayDisabledCode = array();
|
||||
$arrayDisabledCode = [];
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
if (!PMLicensedFeatures::getSingleton()->verifyfeature("B0oWlBLY3hHdWY0YUNpZEtFQm5CeTJhQlIwN3IxMEkwaG4=")) {
|
||||
@@ -6412,23 +6416,24 @@ class Processes
|
||||
$triggerTitle = $row["TRI_TITLE"];
|
||||
$triggerWebbot = $row["TRI_WEBBOT"];
|
||||
|
||||
//Check disabled code
|
||||
$arrayFoundDisabledCode = [];
|
||||
// @todo: The PO's needs to define the behaviour when the command check-workspace-disabled-code was executed
|
||||
$arrayFoundDisabledCode = $cs->checkDisabledCode("SOURCE", $triggerWebbot);
|
||||
|
||||
if (!empty($arrayFoundDisabledCode)) {
|
||||
if (!isset($arrayDisabledCode[$processUid])) {
|
||||
$arrayDisabledCode[$processUid] = array(
|
||||
$arrayDisabledCode[$processUid] = [
|
||||
"processUid" => $processUid,
|
||||
"processTitle" => $processTitle,
|
||||
"triggers" => array()
|
||||
);
|
||||
"triggers" => []
|
||||
];
|
||||
}
|
||||
|
||||
$arrayDisabledCode[$processUid]["triggers"][] = array(
|
||||
$arrayDisabledCode[$processUid]["triggers"][] = [
|
||||
"triggerUid" => $triggerUid,
|
||||
"triggerTitle" => $triggerTitle,
|
||||
"disabledCode" => $arrayFoundDisabledCode["source"],
|
||||
);
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2464,9 +2464,14 @@ class WorkspaceTools
|
||||
}
|
||||
|
||||
/**
|
||||
* Get disabled code
|
||||
* If the feature is enable and the code_scanner_scope was enable will check in the command
|
||||
* Review when the command check-workspace-disabled-code was executed
|
||||
*
|
||||
* @return array Returns an array with disabled code found, array empty otherwise
|
||||
* @return array
|
||||
* @throws Exception
|
||||
*
|
||||
* @link https://wiki.processmaker.com/3.3/processmaker_command#check-workspace-disabled-code
|
||||
* @uses cliWorkspaces.php
|
||||
*/
|
||||
public function getDisabledCode()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user