diff --git a/pandora_console/godmode/servers/discovery.php b/pandora_console/godmode/servers/discovery.php index 557b7bf5b3..e02d62783e 100755 --- a/pandora_console/godmode/servers/discovery.php +++ b/pandora_console/godmode/servers/discovery.php @@ -1,6 +1,18 @@ url.'&mode=importcsv" alt="importcsv">Importar csv'; + if (extensions_is_enabled_extension('csv_import')) { + echo 'Importar csv'; + } + echo 'Escanear red'; return; } @@ -151,50 +154,27 @@ class HostDevices extends Wizard public function runCSV() { global $config; - echo 'formulario csv'; - if (isset($this->page) === false || $this->page === 0) { - $this->page = 0; - - $test = get_parameter('test', null); - - // Check user answers. - if ($test !== null) { - // $this->process_page_0($respuestas_usuario) - $this->page++; - header( - 'Location: '.$this->url.'&page='.$this->page - ); - } else { - // Mostrar pagina 0. - echo 'Aqui vamos a empezar a construir el formulario.'; - ?> -
- page == 1) { - // Code... - $this->page++; + if (!check_acl($config['id_user'], 0, 'AW') + ) { + db_pandora_audit( + 'ACL Violation', + 'Trying to access db status' + ); + include 'general/noaccess.php'; return; - header('Location: index.php?class=HostDevices&page='.$this->page); - } else if ($this->page == 2) { - // Code... - $this->page++; - header('Location: index.php?class=HostDevices&page='.$this->page); - } else if ($this->page == 3) { - // Code... - $this->page++; - header('Location: /XXX/discovery/index.php?class=HostDevices&page='.$this->page); } - // Page 4, last. - return [ - 'result' => $this->result, - 'id' => $this->id, - 'msg' => $this->msg, - ]; + if (!extensions_is_enabled_extension('csv_import')) { + ui_print_error_message( + [ + 'message' => __('Extension CSV Import is not enabled.'), + 'no_close' => true, + ] + ); + return; + } + include_once $config['homedir'].'/enterprise/extensions/csv_import/main.php'; } @@ -708,7 +688,7 @@ class HostDevices extends Wizard echo ''; ui_require_javascript_file('pandora_modules'); - $a = ` + $javascript = ` `; - echo $a; - return [ - 'result' => $this->result, - 'id' => $this->id, - 'msg' => $this->msg, - ]; + echo $javascript; + + return [ + 'result' => $this->result, + 'id' => $this->id, + 'msg' => $this->msg, + ]; } diff --git a/pandora_console/include/functions_extensions.php b/pandora_console/include/functions_extensions.php index 095af6494c..8efb4c8f36 100755 --- a/pandora_console/include/functions_extensions.php +++ b/pandora_console/include/functions_extensions.php @@ -178,7 +178,8 @@ function extensions_get_extensions($enterprise=false, $rel_path='') function extensions_is_enabled_extension($name) { global $config; - return isset($config['extensions'][$name]); + return isset($config['extensions'][$name]) + || isset($config['extensions'][$name.'.php']); }