diff --git a/pandora_console/godmode/wizards/HostDevices.class.php b/pandora_console/godmode/wizards/HostDevices.class.php
index e4e0e97fdc..b46828c271 100755
--- a/pandora_console/godmode/wizards/HostDevices.class.php
+++ b/pandora_console/godmode/wizards/HostDevices.class.php
@@ -149,7 +149,8 @@ class HostDevices extends Wizard
),
'label' => __('Discovery'),
],
- ]
+ ],
+ true
);
ui_print_page_header(__('Host & devices'), '', false, '', true, '', false, '', GENERIC_SIZE_TEXT, '', $this->printHeader(true));
@@ -533,7 +534,19 @@ class HostDevices extends Wizard
if ($this->page < $this->maxPagesNetScan) {
// Avoid to print header out of wizard.
$this->prepareBreadcrum($breadcrum);
- ui_print_page_header(__('NetScan'), '', false, '', true, '', false, '', GENERIC_SIZE_TEXT, '', $this->printHeader(true));
+ ui_print_page_header(
+ __('NetScan'),
+ '',
+ false,
+ '',
+ true,
+ '',
+ false,
+ '',
+ GENERIC_SIZE_TEXT,
+ '',
+ $this->printHeader(true)
+ );
}
if (isset($this->page) === true
diff --git a/pandora_console/godmode/wizards/Wizard.main.php b/pandora_console/godmode/wizards/Wizard.main.php
index d8a829e277..f043f143db 100644
--- a/pandora_console/godmode/wizards/Wizard.main.php
+++ b/pandora_console/godmode/wizards/Wizard.main.php
@@ -191,21 +191,20 @@ class Wizard
* Builder for breadcrum
*
* @param array $urls Array of urls to be stored in breadcrum.
- * @param boolean $add True if breadcrum should be added instead of
- * overwrite it.
+ * @param boolean $add True if breadcrum should be added
+ * instead of overwrite it.
*
* @return void
*/
- public function prepareBreadcrum(array $urls, bool $add=false, bool $separator_beginning=false)
- {
+ public function prepareBreadcrum(
+ array $urls,
+ bool $add=false
+ ) {
$bc = [];
$i = 0;
- $count = 0;
- $array_size = count($urls);
+ $array_size = (count($urls) - 1);
foreach ($urls as $url) {
- $count++;
-
if ($url['selected'] == 1) {
$class = 'selected';
} else {
@@ -213,20 +212,10 @@ class Wizard
}
$bc[$i] = '';
-
- if ($separator_beginning === true) {
- $bc[$i] .= ' / ';
- }
-
- $bc[$i] .= '';
- $bc[$i] .= $url['label'];
- $bc[$i] .= '';
- if ($count < $array_size) {
- $bc[$i] .= ' / ';
- }
-
+ $bc[$i] .= '';
+ $bc[$i] .= $url['label'];
+ $bc[$i] .= '';
$bc[$i] .= '';
-
$i++;
}
@@ -235,7 +224,6 @@ class Wizard
} else {
$this->setBreadcrum($bc);
}
-
}
@@ -275,7 +263,10 @@ class Wizard
*/
public function printBreadcrum()
{
- return implode('', $this->breadcrum);
+ return implode(
+ ' / ',
+ $this->breadcrum
+ );
}
diff --git a/pandora_console/include/functions_snmp_browser.php b/pandora_console/include/functions_snmp_browser.php
index fd68b77e54..d22dd5dc1e 100644
--- a/pandora_console/include/functions_snmp_browser.php
+++ b/pandora_console/include/functions_snmp_browser.php
@@ -54,10 +54,13 @@ function snmp_browser_print_tree(
$last=0,
$last_array=[],
$sufix=false,
- $checked=[]
+ $checked=[],
+ $return=false
) {
static $url = false;
+ $output = '';
+
// Get the base URL for images.
if ($url === false) {
$url = ui_get_full_url('operation/tree', false, false, false);
@@ -73,9 +76,9 @@ function snmp_browser_print_tree(
$last_array[$depth] = $last;
if ($depth > 0) {
- echo "\n";
+ $output .= "\n";
} else {
- echo "\n";
+ $output .= "\n";
}
foreach ($tree['__LEAVES__'] as $level => $sub_level) {
@@ -83,73 +86,89 @@ function snmp_browser_print_tree(
$sub_id = time().rand(0, getrandmax());
// Display the branch.
- echo "- ";
+ $output .= "
- ";
// Indent sub branches.
for ($i = 1; $i <= $depth; $i++) {
if ($last_array[$i] == 1) {
- echo '';
+ $output .= '';
} else {
- echo '';
+ $output .= '';
}
}
// Branch.
if (! empty($sub_level['__LEAVES__'])) {
- echo "";
+ $output .= "";
if ($depth == 0 && $count == 0) {
if ($count == $total) {
- echo '';
+ $output .= '';
} else {
- echo '';
+ $output .= '';
}
} else if ($count == $total) {
- echo '';
+ $output .= '';
} else {
- echo '';
+ $output .= '';
}
- echo '';
+ $output .= '';
}
+
// Leave.
else {
if ($depth == 0 && $count == 0) {
if ($count == $total) {
- echo '';
+ $output .= '';
} else {
- echo '';
+ $output .= '';
}
} else if ($count == $total) {
- echo '';
+ $output .= '';
} else {
- echo '';
+ $output .= '';
}
}
// Branch or leave with branches!
if (isset($sub_level['__OID__'])) {
- echo "";
- echo '';
- echo '';
+ $output .= "";
+ $output .= '';
+ $output .= '';
}
$checkbox_name_sufix = ($sufix === true) ? '_'.$level : '';
$checkbox_name = 'create_'.$sub_id.$checkbox_name_sufix;
$status = (!empty($checked) && isset($checked[$level]));
- echo html_print_checkbox($checkbox_name, 0, $status, true, false, '').' '.$level.'';
+ $output .= html_print_checkbox($checkbox_name, 0, $status, true, false, '').' '.$level.'';
if (isset($sub_level['__VALUE__'])) {
- echo ' = '.$sub_level['__VALUE__'].'';
+ $output .= ' = '.$sub_level['__VALUE__'].'';
}
- echo '
';
+ $output .= '';
// Recursively print sub levels.
- snmp_browser_print_tree($sub_level, $sub_id, ($depth + 1), ($count == $total ? 1 : 0), $last_array, $sufix, $checked);
+ $output .= snmp_browser_print_tree(
+ $sub_level,
+ $sub_id,
+ ($depth + 1),
+ ($count == $total ? 1 : 0),
+ $last_array,
+ $sufix,
+ $checked,
+ $return
+ );
$count++;
}
- echo '
';
+ $output .= '
';
+
+ if ($return == false) {
+ echo $output;
+ }
+
+ return $output;
}
diff --git a/pandora_server/lib/PandoraFMS/Recon/Base.pm b/pandora_server/lib/PandoraFMS/Recon/Base.pm
index 97b239ce95..afc677c15a 100644
--- a/pandora_server/lib/PandoraFMS/Recon/Base.pm
+++ b/pandora_server/lib/PandoraFMS/Recon/Base.pm
@@ -1427,9 +1427,9 @@ sub scan_subnet($) {
}
##########################################################################
-# Perform a DB scan.
+# Perform an Application scan.
##########################################################################
-sub db_scan($) {
+sub app_scan($) {
my ($self) = @_;
my ($progress, $step);
@@ -1595,7 +1595,7 @@ sub scan($) {
if ($self->{'task_data'}->{'type'} == DISCOVERY_APP_MYSQL
|| $self->{'task_data'}->{'type'} == DISCOVERY_APP_ORACLE) {
# Database scan.
- return $self->db_scan();
+ return $self->app_scan();
}
}