Some fixes

(cherry picked from commit 5b7de4b4d8)
This commit is contained in:
mdtrooper 2014-11-07 18:01:47 +01:00
parent 1018edcffd
commit 49f35f0a66
1 changed files with 56 additions and 9 deletions

View File

@ -131,7 +131,7 @@ function pluginreg_extension_main () {
$macro = array(); $macro = array();
$macro['macro'] = '_field' . $total_macros . '_'; $macro['macro'] = '_field' . $total_macros . '_';
$macro['desc'] = 'Target IP'; $macro['desc'] = 'Target IP from net';
$macro['help'] = ''; $macro['help'] = '';
$macro['value'] = ''; $macro['value'] = '';
@ -141,9 +141,39 @@ function pluginreg_extension_main () {
$macros[(string)$total_macros] = $macro; $macros[(string)$total_macros] = $macro;
} }
if ($values['ip_opt'] != "") {
$total_macros++;
$macro = array();
$macro['macro'] = '_field' . $total_macros . '_';
$macro['desc'] = 'Target IP';
$macro['help'] = '';
$macro['value'] = '';
$values['parameters'] .=
$values['ip_opt'] . ' _field' . $total_macros . '_ ';
$macros[(string)$total_macros] = $macro;
}
if ($values['net_port_opt'] != "") { if ($values['net_port_opt'] != "") {
$total_macros++; $total_macros++;
$macro = array();
$macro['macro'] = '_field' . $total_macros . '_';
$macro['desc'] = 'Port from net';
$macro['help'] = '';
$macro['value'] = '';
$values['parameters'] .=
$values['net_port_opt'] . ' _field' . $total_macros . '_ ';
$macros[(string)$total_macros] = $macro;
}
if ($values['port_opt'] != "") {
$total_macros++;
$macro = array(); $macro = array();
$macro['macro'] = '_field' . $total_macros . '_'; $macro['macro'] = '_field' . $total_macros . '_';
$macro['desc'] = 'Port'; $macro['desc'] = 'Port';
@ -151,7 +181,7 @@ function pluginreg_extension_main () {
$macro['value'] = ''; $macro['value'] = '';
$values['parameters'] .= $values['parameters'] .=
$values['net_port_opt'] . ' _field' . $total_macros . '_ '; $values['port_opt'] . ' _field' . $total_macros . '_ ';
$macros[(string)$total_macros] = $macro; $macros[(string)$total_macros] = $macro;
} }
@ -246,7 +276,7 @@ function pluginreg_extension_main () {
$plugin_pass = $ini_array[$label]["plugin_pass"]; $plugin_pass = $ini_array[$label]["plugin_pass"];
$plugin_parameter = ""; $plugin_parameter = "";
if (isset($ini_array[$label]["plugin_parameter"])) if (isset($ini_array[$label]["plugin_parameter"]))
$plugin_pass = $ini_array[$label]["plugin_parameter"]; $plugin_parameter = $ini_array[$label]["plugin_parameter"];
$unit = ""; $unit = "";
if (isset($ini_array[$label]["unit"])) if (isset($ini_array[$label]["unit"]))
$unit = $ini_array[$label]["unit"]; $unit = $ini_array[$label]["unit"];
@ -286,29 +316,46 @@ function pluginreg_extension_main () {
// the dinamic parameters of pandoras 5 // the dinamic parameters of pandoras 5
foreach ($macros_component as $key => $macro) { foreach ($macros_component as $key => $macro) {
if ($macro['desc'] == 'Target IP from net') {
if (!empty($values['ip_target'])) {
$macros_component[$key]['value'] =
io_safe_input($values['ip_target']);
}
}
if ($macro['desc'] == 'Target IP') { if ($macro['desc'] == 'Target IP') {
if (!empty($values['ip_target'])) { if (!empty($values['ip_target'])) {
$macros_component[$key]['value'] = $values['ip_target']; $macros_component[$key]['value'] =
io_safe_input($values['ip_target']);
}
}
else if ($macro['desc'] == 'Port from net') {
if (!empty($values['tcp_port'])) {
$macros_component[$key]['value'] =
io_safe_input($values['tcp_port']);
} }
} }
else if ($macro['desc'] == 'Port') { else if ($macro['desc'] == 'Port') {
if (!empty($values['tcp_port'])) { if (!empty($values['tcp_port'])) {
$macros_component[$key]['value'] = $values['tcp_port']; $macros_component[$key]['value'] =
io_safe_input($values['tcp_port']);
} }
} }
else if ($macro['desc'] == 'Username') { else if ($macro['desc'] == 'Username') {
if (!empty($values['plugin_user'])) { if (!empty($values['plugin_user'])) {
$macros_component[$key]['value'] = $values['plugin_user']; $macros_component[$key]['value'] =
io_safe_input($values['plugin_user']);
} }
} }
else if ($macro['desc'] == 'Password') { else if ($macro['desc'] == 'Password') {
if (!empty($values['plugin_pass'])) { if (!empty($values['plugin_pass'])) {
$macros_component[$key]['value'] = $values['plugin_pass']; $macros_component[$key]['value'] =
io_safe_input($values['plugin_pass']);
} }
} }
else if ($macro['desc'] == 'Plug-in Parameters') { else if ($macro['desc'] == 'Plug-in Parameters') {
if (!empty($values['plugin_parameter'])) { if (!empty($values['plugin_parameter'])) {
$macros_component[$key]['value'] = $values['plugin_parameter']; $macros_component[$key]['value'] =
io_safe_input($values['plugin_parameter']);
} }
} }
} }
@ -321,7 +368,7 @@ function pluginreg_extension_main () {
// Set the value or use the default // Set the value or use the default
if (isset($ini_array[$label][$macro])) { if (isset($ini_array[$label][$macro])) {
$macros_component[(string)$it_macros]['value'] = $macros_component[(string)$it_macros]['value'] =
$ini_array[$label][$macro]; io_safe_input($ini_array[$label][$macro]);
} }
} }
} }