PM-1123 Podar features enterprise de la version 3.0 para sacar el beta 3.0

Marcas para la deshabilitar code Scan
This commit is contained in:
norahmollo
2014-12-23 17:22:42 -04:00
parent 76096583c3
commit 6a62837acb
8 changed files with 39 additions and 22 deletions

View File

@@ -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']);

View File

@@ -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";

View File

@@ -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);

View File

@@ -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' );

View File

@@ -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'] != '') {