diff --git a/extras/docker/centos8/base/Dockerfile b/extras/docker/centos8/base/Dockerfile index 2e66972229..c27b2db723 100644 --- a/extras/docker/centos8/base/Dockerfile +++ b/extras/docker/centos8/base/Dockerfile @@ -1,14 +1,14 @@ #docker build -t pandorafms/pandorafms-open-base-el8 -f $HOME/code/pandorafms/extras/docker/centos8/base/Dockerfile $HOME/code/pandorafms/extras/docker/centos8/base/ #docker push pandorafms/pandorafms-open-base-el8 -FROM centos:8 +FROM rockylinux:8 RUN dnf install -y --setopt=tsflags=nodocs \ epel-release \ dnf-utils \ http://rpms.remirepo.net/enterprise/remi-release-8.rpm -RUN dnf module reset -y php && dnf module install -y php:remi-7.3 +RUN dnf module reset -y php && dnf module install -y php:remi-7.4 RUN dnf config-manager --set-enabled powertools # Install console dependencies diff --git a/pandora_agents/pc/Win32/help/images/1.jpg b/pandora_agents/pc/Win32/help/images/1.jpg deleted file mode 100644 index c8c0a354bd..0000000000 Binary files a/pandora_agents/pc/Win32/help/images/1.jpg and /dev/null differ diff --git a/pandora_agents/pc/Win32/help/images/2.jpg b/pandora_agents/pc/Win32/help/images/2.jpg deleted file mode 100644 index 39535209f7..0000000000 Binary files a/pandora_agents/pc/Win32/help/images/2.jpg and /dev/null differ diff --git a/pandora_agents/pc/Win32/help/images/3.jpg b/pandora_agents/pc/Win32/help/images/3.jpg deleted file mode 100644 index d0c243271a..0000000000 Binary files a/pandora_agents/pc/Win32/help/images/3.jpg and /dev/null differ diff --git a/pandora_agents/pc/Win32/help/images/4.jpg b/pandora_agents/pc/Win32/help/images/4.jpg deleted file mode 100644 index 14ef867c25..0000000000 Binary files a/pandora_agents/pc/Win32/help/images/4.jpg and /dev/null differ diff --git a/pandora_agents/pc/Win32/help/images/5.jpg b/pandora_agents/pc/Win32/help/images/5.jpg deleted file mode 100644 index d918a4effa..0000000000 Binary files a/pandora_agents/pc/Win32/help/images/5.jpg and /dev/null differ diff --git a/pandora_agents/pc/Win32/help/images/6.jpg b/pandora_agents/pc/Win32/help/images/6.jpg deleted file mode 100644 index 2b6835708b..0000000000 Binary files a/pandora_agents/pc/Win32/help/images/6.jpg and /dev/null differ diff --git a/pandora_agents/pc/Win32/help/images/logo.png b/pandora_agents/pc/Win32/help/images/logo.png deleted file mode 100644 index 79ad33260b..0000000000 Binary files a/pandora_agents/pc/Win32/help/images/logo.png and /dev/null differ diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index df44d3748a..92cc7efb2b 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.759-211217 +Version: 7.0NG.759-220125 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index 6a01a6a4eb..7fac24aa11 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.759-211217" +pandora_version="7.0NG.759-220125" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 8cbdd7bc7f..361eb971de 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1015,7 +1015,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.759'; -use constant AGENT_BUILD => '211217'; +use constant AGENT_BUILD => '220125'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index f1ee3030fd..37532911d4 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.759 -%define release 211217 +%define release 220125 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 2001271d23..670384af51 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.759 -%define release 211217 +%define release 220125 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index 69b51e0878..057d1fb651 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.759" -PI_BUILD="211217" +PI_BUILD="220125" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/bin/help/how_to_keys.html b/pandora_agents/win32/bin/help/how_to_keys.html deleted file mode 100644 index d3c0a6cdf2..0000000000 --- a/pandora_agents/win32/bin/help/how_to_keys.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - Fandora FMS - Generate SSH keys step-by-step - - - - - - - -
- -
- -

Step-by-step generating SSH keys

- - From - Pandora FMS FAQ. - -
    -
  1. - Go to .\util of your Pandora FMS agent for Windows and run - puttygen.exe.
    - Generate keys, SSH-2_DSA, 1024:

    -

    -
  2. -
  3. - Press Generate
    - Export key to OpenSSH key (Cygwin uses a port of OpenSSH)

    -

    -
  4. -
  5. - We have no chosen password, so press YES:

    -

    -
  6. -
  7. - Save it as c:\pandora\keys\id_dsa:

    -

    -
  8. -
  9. - Now let's copy the public key to clipboard:

    -

    -
  10. -
  11. - and paste it as c:\pandora_agent\keys\id_dsa.pub, and also - to the /home/pandora/.ssh/authorized_keys file. -

    -

    -
  12. -
- - diff --git a/pandora_agents/win32/bin/help/how_to_keys_es.html b/pandora_agents/win32/bin/help/how_to_keys_es.html deleted file mode 100644 index 1422add077..0000000000 --- a/pandora_agents/win32/bin/help/how_to_keys_es.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - Pandora FMS - Generación de claves SSH en Windows paso por paso - - - - - - - - -
- -
-

Generación de claves SSH en Windows paso por paso

- - Extraído de las - - FAQ. - -
    -
  1. - Desde el directorio .\util del agente Pandora FMS para - windows ejecutamos puttygen.exe.
    - Generamos claves SSH-2_DSA, 1024:

    -

    -
  2. -
  3. - Pulsamos «Generate» para generar la clave.
    - Exportamos la clave a formato OpenSSH

    -

    -
  4. -
  5. - No elegimos contraseña, con lo cual pulsamos «Sí»:

    -

    -
  6. -
  7. - Guardamos la clave como C:\pandora\keys\id_dsa:

    -

    -
  8. -
  9. - Ahora copiamos la clave pública al portapapeles:

    -

    -
  10. -
  11. - Pegamos la clave en un nuevo fichero - C:\pandora_agent\keys\id_dsa.pub, y debemos también - añadirla al fichero /home/pandora/.ssh/authorized_keys. -

    -

    -
  12. -
- - diff --git a/pandora_agents/win32/bin/help/images/1.jpg b/pandora_agents/win32/bin/help/images/1.jpg deleted file mode 100644 index c8c0a354bd..0000000000 Binary files a/pandora_agents/win32/bin/help/images/1.jpg and /dev/null differ diff --git a/pandora_agents/win32/bin/help/images/2.jpg b/pandora_agents/win32/bin/help/images/2.jpg deleted file mode 100644 index 39535209f7..0000000000 Binary files a/pandora_agents/win32/bin/help/images/2.jpg and /dev/null differ diff --git a/pandora_agents/win32/bin/help/images/3.jpg b/pandora_agents/win32/bin/help/images/3.jpg deleted file mode 100644 index d0c243271a..0000000000 Binary files a/pandora_agents/win32/bin/help/images/3.jpg and /dev/null differ diff --git a/pandora_agents/win32/bin/help/images/4.jpg b/pandora_agents/win32/bin/help/images/4.jpg deleted file mode 100644 index 14ef867c25..0000000000 Binary files a/pandora_agents/win32/bin/help/images/4.jpg and /dev/null differ diff --git a/pandora_agents/win32/bin/help/images/5.jpg b/pandora_agents/win32/bin/help/images/5.jpg deleted file mode 100644 index d918a4effa..0000000000 Binary files a/pandora_agents/win32/bin/help/images/5.jpg and /dev/null differ diff --git a/pandora_agents/win32/bin/help/images/6.jpg b/pandora_agents/win32/bin/help/images/6.jpg deleted file mode 100644 index 2b6835708b..0000000000 Binary files a/pandora_agents/win32/bin/help/images/6.jpg and /dev/null differ diff --git a/pandora_agents/win32/bin/help/images/logo.png b/pandora_agents/win32/bin/help/images/logo.png deleted file mode 100644 index 79ad33260b..0000000000 Binary files a/pandora_agents/win32/bin/help/images/logo.png and /dev/null differ diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 95b20572a3..f9f5aa8c01 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{211217} +{220125} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 5eaa2990d6..2b4e91a163 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.759 Build 211217") +#define PANDORA_VERSION ("7.0NG.759 Build 220125") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 4a8e5501a0..f8ac4f45be 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.759(Build 211217))" + VALUE "ProductVersion", "(7.0NG.759(Build 220125))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index c94bf51a3a..b7d8475b9c 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.759-211217 +Version: 7.0NG.759-220125 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 21548b330f..8ae81efb99 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.759-211217" +pandora_version="7.0NG.759-220125" package_pear=0 package_pandora=1 diff --git a/pandora_console/extensions/api_checker.php b/pandora_console/extensions/api_checker.php index 14aa4c8191..49f742217e 100755 --- a/pandora_console/extensions/api_checker.php +++ b/pandora_console/extensions/api_checker.php @@ -202,9 +202,7 @@ function extension_api_checker() echo ''; echo "
"; echo '
'; - echo ''; - echo "
"; echo '
'; echo ''.__('Custom URL').''; html_print_table($table3); diff --git a/pandora_console/extras/delete_files/delete_files.txt b/pandora_console/extras/delete_files/delete_files.txt index 50f79eb02f..f5db52a42a 100644 --- a/pandora_console/extras/delete_files/delete_files.txt +++ b/pandora_console/extras/delete_files/delete_files.txt @@ -114,4 +114,7 @@ enterprise/include/javascript/tooltipster.bundle.min.js enterprise/include/styles/tooltipster.bundle.min.css mobile/include/javascript/jquery.mobile-1.3.1.js mobile/include/style/jquery.mobile-1.3.1.css -godmode/alerts/configure_alert_special_days.php \ No newline at end of file +godmode/alerts/configure_alert_special_days.php +godmode/admin_access_logs.php +enterprise/extensions/backup/main.php +enterprise/extensions/backup.php \ No newline at end of file diff --git a/pandora_console/extras/mr/52.sql b/pandora_console/extras/mr/52.sql new file mode 100644 index 0000000000..d2d5e1be65 --- /dev/null +++ b/pandora_console/extras/mr/52.sql @@ -0,0 +1,5 @@ +START TRANSACTION; +ALTER TABLE `tpolicy_queue` MODIFY COLUMN `progress` int(10) NOT NULL default '0'; +CREATE INDEX `IDX_tservice_element` ON `tservice_element`(`id_service`,`id_agente_modulo`); + +COMMIT; \ No newline at end of file diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index 20d5ba6324..d6db1ad76e 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -480,7 +480,8 @@ CREATE TABLE IF NOT EXISTS `tservice_element` ( `id_agent` int(10) unsigned NOT NULL default 0, `id_service_child` int(10) unsigned NOT NULL default 0, `id_server_meta` int(10) unsigned NOT NULL default 0, - PRIMARY KEY (`id`) + PRIMARY KEY (`id`), + INDEX `IDX_tservice_element` (`id_service`,`id_agente_modulo`) ) ENGINE=InnoDB COMMENT = 'Table to define the modules and the weights of the modules that define a service' DEFAULT CHARSET=utf8; @@ -578,7 +579,7 @@ CREATE TABLE IF NOT EXISTS `tpolicy_queue` ( `id_policy` int(10) unsigned NOT NULL default '0', `id_agent` int(10) unsigned NOT NULL default '0', `operation` varchar(15) default '', - `progress` int(10) unsigned NOT NULL default '0', + `progress` int(10) NOT NULL default '0', `end_utimestamp` int(10) unsigned NOT NULL default 0, `priority` int(10) unsigned NOT NULL default '0', PRIMARY KEY (`id`) @@ -1450,13 +1451,13 @@ ALTER TABLE `ttag` MODIFY COLUMN `name` text NOT NULL default ''; INSERT INTO `tconfig` (`token`, `value`) VALUES ('big_operation_step_datos_purge', '100'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('small_operation_step_datos_purge', '1000'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('days_autodisable_deletion', '30'); -INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 50); +INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 51); INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_docs_logo', 'default_docs.png'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_support_logo', 'default_support.png'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_logo_white_bg_preview', 'pandora_logo_head_white_bg.png'); UPDATE tconfig SET value = 'https://licensing.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager'; DELETE FROM `tconfig` WHERE `token` = 'current_package_enterprise'; -INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package', 758); +INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package', 759); INSERT INTO `tconfig` (`token`, `value`) VALUES ('status_monitor_fields', 'policy,agent,data_type,module_name,server_type,interval,status,graph,warn,data,timestamp'); UPDATE `tconfig` SET `value` = 'mini_severity,evento,id_agente,estado,timestamp' WHERE `token` LIKE 'event_fields'; DELETE FROM `tconfig` WHERE `token` LIKE 'integria_api_password'; diff --git a/pandora_console/general/login_page.php b/pandora_console/general/login_page.php index 88bd581f2c..6d7a9864ce 100755 --- a/pandora_console/general/login_page.php +++ b/pandora_console/general/login_page.php @@ -330,8 +330,30 @@ if ($config['enterprise_installed']) { $reset_pass_link = 'reset_pass.php'; // Reset password link. echo '
'; - echo ''.__('Forgot your password?'); - echo ''; + if ((!$config['centralized_management'])) { + echo ''.__('Forgot your password?'); + echo ''; + } else { + echo ''.__('Forgot your password?'); + echo ''; + + echo ''; + } + echo '
'; } } @@ -826,5 +848,23 @@ html_print_div(['id' => 'forced_title_layer', 'class' => 'forced_title_layer', ' }); }); + function centralized_mode_reset_dialog() { + $("#centralized_mode_reset_dialog").dialog({ + resizable: true, + draggable: true, + modal: true, + height: 220, + width: 528, + overlay: { + opacity: 0.5, + background: "black" + } + }); + + $("#submit-centralized_mode_reset_button").click (function () { + $("#centralized_mode_reset_dialog").dialog('close'); + }); + } + /* ]]> */ diff --git a/pandora_console/godmode/admin_access_logs.php b/pandora_console/godmode/admin_access_logs.php deleted file mode 100644 index f635e945c3..0000000000 --- a/pandora_console/godmode/admin_access_logs.php +++ /dev/null @@ -1,277 +0,0 @@ - __( - 'Export to CSV' - ),'class' => 'invert_filter', - ] -); -$header_buttons = [ - 'csv' => [ - 'active' => false, - 'text' => ''.$csv_img.'', - ], -]; - -ui_print_page_header(__('%s audit', get_product_name()).' » '.__('Review Logs'), 'images/gm_log.png', false, '', true, $header_buttons); - -$table = new stdClass(); -$table->class = 'databox filters'; -$table->cellstyle = []; -$table->cellstyle[0] = []; -$table->cellstyle[1] = []; -$table->cellstyle[0][0] = 'text-align: right;'; -$table->cellstyle[0][1] = 'text-align: left;'; -$table->cellstyle[0][2] = 'text-align: right;'; -$table->cellstyle[0][3] = 'text-align: left;'; -$table->cellstyle[0][4] = 'text-align: right;'; -$table->cellstyle[0][5] = 'text-align: left;'; -$table->cellstyle[1][0] = 'text-align: right;'; -$table->cellstyle[1][1] = 'text-align: left;'; -$table->cellstyle[1][2] = 'text-align: right;'; -$table->cellstyle[1][3] = 'text-align: left;'; -$table->cellstyle[1][5] = 'text-align: right;'; -$table->data = []; - -$data = []; - -$data[0] = ''.__('Search').''; -$data[1] = html_print_input_text('filter_text', $filter_text, __('Free text for search (*)'), 20, 40, true); - -$data[2] = ''.__('Max. hours old').''; -$data[3] = html_print_input_text('filter_period', $filter_period, __('Max. hours old'), 3, 6, true); - -$data[4] = ''.__('IP').''; -$data[5] = html_print_input_text('filter_ip', $filter_ip, __('IP'), 15, 15, true); - -$table->data[0] = $data; -$data = []; - -$actions_sql = 'SELECT DISTINCT(accion), accion AS text FROM tsesion'; -$data[0] = ''.__('Action').''; -$data[1] = html_print_select_from_sql($actions_sql, 'filter_type', $filter_type, '', __('All'), '', true); - -$users_sql = 'SELECT id_user, id_user AS text FROM tusuario'; -$data[2] = ''.__('User').''; -$data[3] = html_print_select_from_sql($users_sql, 'filter_user', $filter_user, '', __('All'), '', true); - -$data[4] = ''; -$data[5] = html_print_submit_button(__('Filter'), 'filter', false, 'class="sub search"', true); - -$table->data[1] = $data; - -$form = ''; -$form .= html_print_table($table, true); -$form .= ''; -ui_toggle($form, __('Filter'), '', '', false); - -$filter = '1=1'; - -if (!empty($filter_type)) { - $filter .= sprintf(" AND accion = '%s'", $filter_type); -} - -if (!empty($filter_user)) { - $filter .= sprintf(" AND id_usuario = '%s'", $filter_user); -} - -if (!empty($filter_text)) { - $filter .= sprintf(" AND (accion LIKE '%%%s%%' OR descripcion LIKE '%%%s%%')", $filter_text, $filter_text); -} - -if (!empty($filter_ip)) { - $filter .= sprintf(" AND ip_origen LIKE '%%%s%%'", $filter_ip); -} - -if (!empty($filter_period)) { - switch ($config['dbtype']) { - case 'mysql': - $filter .= ' AND fecha >= DATE_ADD(NOW(), INTERVAL -'.$filter_period.' HOUR)'; - break; - - case 'postgresql': - $filter .= ' AND fecha >= NOW() - INTERVAL \''.$filter_period.' HOUR \''; - break; - - case 'oracle': - $filter .= ' AND fecha >= (SYSTIMESTAMP - INTERVAL \''.$filter_period.'\' HOUR)'; - break; - } -} - -$count_sql = sprintf('SELECT COUNT(*) FROM tsesion WHERE %s', $filter); -$count = (int) db_get_value_sql($count_sql); -$url = 'index.php?sec=godmode&sec2=godmode/admin_access_logs'.$filter_query; -ui_pagination($count, $url); - -switch ($config['dbtype']) { - case 'mysql': - $sql = sprintf( - 'SELECT * - FROM tsesion - WHERE %s - ORDER BY fecha DESC - LIMIT %d, %d', - $filter, - $offset, - $config['block_size'] - ); - break; - - case 'postgresql': - $sql = sprintf( - 'SELECT * - FROM tsesion - WHERE %s - ORDER BY fecha DESC - LIMIT %d OFFSET %d', - $filter, - $config['block_size'], - $offset - ); - break; - - case 'oracle': - $set = []; - $set['limit'] = $config['block_size']; - $set['offset'] = $offset; - $sql = sprintf( - 'SELECT * - FROM tsesion - WHERE %s - ORDER BY fecha DESC', - $filter - ); - $result = oracle_recode_query($sql, $set); - break; -} - -$result = db_get_all_rows_sql($sql); -if (empty($result)) { - $result = []; -} - -$table = new stdClass(); -$table->cellpadding = 0; -$table->cellspacing = 0; -$table->width = '100%'; -$table->class = 'info_table'; -$table->size = []; -$table->data = []; -$table->head = []; -$table->align = []; -$table->rowclass = []; - -$table->head[0] = __('User'); -$table->head[1] = __('Action'); -$table->head[2] = __('Date'); -$table->head[3] = __('Source IP'); -$table->head[4] = __('Comments'); -if ($enterprise_include !== ENTERPRISE_NOT_HOOK) { - $table->head[5] = enterprise_hook('tableHeadEnterpriseAudit', ['title1']); - $table->head[6] = enterprise_hook('tableHeadEnterpriseAudit', ['title2']); -} - -$table->size[0] = 80; -$table->size[2] = 130; -$table->size[3] = 100; -$table->size[4] = 200; -if ($enterprise_include !== ENTERPRISE_NOT_HOOK) { - $table->size[5] = enterprise_hook('tableHeadEnterpriseAudit', ['size1']); - $table->size[6] = enterprise_hook('tableHeadEnterpriseAudit', ['size2']); - $table->align[5] = enterprise_hook('tableHeadEnterpriseAudit', ['align']); - $table->align[6] = enterprise_hook('tableHeadEnterpriseAudit', ['align2']); -} - -$table->colspan = []; -$table->rowstyle = []; - -$rowPair = true; -$iterator = 0; - -// Get data -foreach ($result as $row) { - $iterator++; - - $table->rowclass[] = $rowPair ? 'rowPair' : 'rowOdd'; - $rowPair = !$rowPair; - - $data = []; - $data[0] = io_safe_output($row['id_usuario']); - $data[1] = ui_print_session_action_icon($row['accion'], true).$row['accion']; - $data[2] = ui_print_help_tip(date($config['date_format'], $row['utimestamp']), true).ui_print_timestamp($row['utimestamp'], true); - $data[3] = io_safe_output($row['ip_origen']); - $data[4] = io_safe_output($row['descripcion']); - - if ($enterprise_include !== ENTERPRISE_NOT_HOOK) { - $data[5] = enterprise_hook('cell1EntepriseAudit', [$row['id_sesion']]); - $data[6] = enterprise_hook('cell2EntepriseAudit', [$row['id_sesion']]); - } - - $table->data[] = $data; - - if ($enterprise_include !== ENTERPRISE_NOT_HOOK) { - rowEnterpriseAudit($table, $iterator, $row['id_sesion']); - } -} - -foreach ($table->rowclass as $key => $value) { - if (strpos($value, 'limit_scroll') !== false) { - $table->colspan[$key] = [7]; - } else { - if ($enterprise_include !== ENTERPRISE_NOT_HOOK) { - $table->cellclass[$key][6] = 'action_buttons'; - } - } -} - -html_print_table($table); -ui_pagination($count, $url, 0, 0, false, 'offset', true, 'pagination-bottom'); - -if ($enterprise_include !== ENTERPRISE_NOT_HOOK) { - enterprise_hook('enterpriseAuditFooter'); -} diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index b23bbaaa54..7965dbc566 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -1385,9 +1385,15 @@ if ($update_module || $create_module) { $custom_integer_2_default = $module['custom_integer_2']; } - if ($id_module_type == 25) { + if ($id_module_type === 25) { // Web analysis, from MODULE_WUX. - $custom_string_1 = base64_encode((string) get_parameter('custom_string_1', $custom_string_1_default)); + $custom_string_1 = base64_encode((string) get_parameter('custom_string_1')); + // If the custom_string_1 parameter come empty, set the content + // of the module (it is base64_encoded). + if (empty($custom_string_1) === true) { + $custom_string_1 = $custom_string_1_default; + } + $custom_integer_1 = (int) get_parameter('custom_integer_1', $custom_integer_1_default); } else { $custom_string_1 = (string) get_parameter('custom_string_1', $custom_string_1_default); @@ -1402,7 +1408,7 @@ if ($update_module || $create_module) { $macros = (string) get_parameter('macros'); $macros_names = (array) get_parameter('macro_name', []); - if (!empty($macros)) { + if (empty($macros) === false) { $macros = json_decode(base64_decode($macros), true); foreach ($macros as $k => $m) { @@ -2422,7 +2428,7 @@ switch ($tab) { var aget_id_os = ''; - if('' != $('#text-name').val() && + if('' != $('#text-name').val() && '' == 19){ event.preventDefault(); @@ -2456,7 +2462,7 @@ switch ($tab) { var module_type_snmp = ''; - if('' != $('#text-name').val() && ( + if('' != $('#text-name').val() && ( module_type_snmp == 15 || module_type_snmp == 16 || module_type_snmp == 17 || module_type_snmp == 18)){ event.preventDefault(); diff --git a/pandora_console/godmode/agentes/module_manager.php b/pandora_console/godmode/agentes/module_manager.php index f37d7a77bd..1d39f0525a 100644 --- a/pandora_console/godmode/agentes/module_manager.php +++ b/pandora_console/godmode/agentes/module_manager.php @@ -253,6 +253,7 @@ $module_action = (string) get_parameter('module_action'); if ($module_action === 'delete') { $id_agent_modules_delete = (array) get_parameter('id_delete'); + $print_result_msg = true; $count_correct_delete_modules = 0; foreach ($id_agent_modules_delete as $id_agent_module_del) { $id_grupo = (int) agents_get_agent_group($id_agente); @@ -268,12 +269,19 @@ if ($module_action === 'delete') { } if ($id_agent_module_del < 1) { - db_pandora_audit( - 'HACK Attempt', - 'Expected variable from form is not correct' - ); - die(__('Nice try buddy')); - exit; + if (count($id_agent_modules_delete) === 1) { + ui_print_error_message( + __('No modules selected') + ); + + $print_result_msg = false; + } else { + ui_print_error_message( + __('There was a problem completing the operation') + ); + } + + continue; } enterprise_include_once('include/functions_config_agents.php'); @@ -421,25 +429,27 @@ if ($module_action === 'delete') { } } - $count_modules_to_delete = count($id_agent_modules_delete); - if ($count_correct_delete_modules == 0) { - ui_print_error_message( - sprintf( - __('There was a problem completing the operation. Applied to 0/%d modules.'), - $count_modules_to_delete - ) - ); - } else { - if ($count_correct_delete_modules == $count_modules_to_delete) { - ui_print_success_message(__('Operation finished successfully.')); - } else { + if ($print_result_msg === true) { + $count_modules_to_delete = count($id_agent_modules_delete); + if ($count_correct_delete_modules == 0) { ui_print_error_message( sprintf( - __('There was a problem completing the operation. Applied to %d/%d modules.'), - $count_correct_delete_modules, + __('There was a problem completing the operation. Applied to 0/%d modules.'), $count_modules_to_delete ) ); + } else { + if ($count_correct_delete_modules == $count_modules_to_delete) { + ui_print_success_message(__('Operation finished successfully.')); + } else { + ui_print_error_message( + sprintf( + __('There was a problem completing the operation. Applied to %d/%d modules.'), + $count_correct_delete_modules, + $count_modules_to_delete + ) + ); + } } } } else if ($module_action === 'disable') { diff --git a/pandora_console/godmode/agentes/planned_downtime.editor.php b/pandora_console/godmode/agentes/planned_downtime.editor.php index 2891272be4..616777ad6e 100644 --- a/pandora_console/godmode/agentes/planned_downtime.editor.php +++ b/pandora_console/godmode/agentes/planned_downtime.editor.php @@ -250,6 +250,7 @@ if ($create_downtime || $update_downtime) { } else if ($type_execution == 'periodically' && $type_periodicity == 'monthly' && $periodically_day_from == $periodically_day_to + && $periodically_time_from >= $periodically_time_to ) { ui_print_error_message( __('Not created. Error inserting data').'. '.__('The end time must be higher than the start time') @@ -627,20 +628,20 @@ $table->data[5][1] = " ".ui_get_using_system_timezone_warning().' '.__('Type Periodicity:').' '.html_print_select( - [ - 'weekly' => __('Weekly'), - 'monthly' => __('Monthly'), - ], - 'type_periodicity', - $type_periodicity, - 'change_type_periodicity();', - '', - 0, - true, - false, - true, - '', - $disabled_in_execution + [ + 'weekly' => __('Weekly'), + 'monthly' => __('Monthly'), + ], + 'type_periodicity', + $type_periodicity, + 'change_type_periodicity();', + '', + 0, + true, + false, + true, + '', + $disabled_in_execution )." @@ -660,31 +661,31 @@ $table->data[5][1] = " ".__('From day:').' '.html_print_select( - $days, - 'periodically_day_from', - $periodically_day_from, - '', - '', - 0, - true, - false, - true, - '', - $disabled_in_execution + $days, + 'periodically_day_from', + $periodically_day_from, + '', + '', + 0, + true, + false, + true, + '', + $disabled_in_execution ).' '.__('To day:').' '.html_print_select( - $days, - 'periodically_day_to', - $periodically_day_to, - '', - '', - 0, - true, - false, - true, - '', - $disabled_in_execution + $days, + 'periodically_day_to', + $periodically_day_to, + '', + '', + 0, + true, + false, + true, + '', + $disabled_in_execution ).' '.ui_print_help_tip(__('The end day must be higher than the start day'), true).' @@ -693,26 +694,26 @@ $table->data[5][1] = " '.__('From hour:').' '.html_print_input_text( - 'periodically_time_from', - $periodically_time_from, - '', - 7, - 7, - true, - $disabled_in_execution + 'periodically_time_from', + $periodically_time_from, + '', + 7, + 7, + true, + $disabled_in_execution ).ui_print_help_tip( __('The end time must be higher than the start time'), true ).' '.__('To hour:').' '.html_print_input_text( - 'periodically_time_to', - $periodically_time_to, - '', - 7, - 7, - true, - $disabled_in_execution + 'periodically_time_to', + $periodically_time_to, + '', + 7, + 7, + true, + $disabled_in_execution ).ui_print_help_tip( __('The end time must be higher than the start time'), true @@ -946,9 +947,7 @@ if (empty($downtimes_agents)) { if (!$running) { $data[5] = ''; - if ($type_downtime != 'disable_agents_alerts' - && $type_downtime != 'disable_agents' - ) { + if ($type_downtime !== 'disable_agents') { $data[5] = ''.html_print_image('images/config.png', true, ['border' => '0', 'alt' => __('Delete'), 'class' => 'invert_filter']).''; } @@ -998,13 +997,13 @@ $table->data['module'][1] = " ".''.html_print_image( - 'images/cross.png', - true, - [ - 'border' => '0', - 'alt' => __('Delete'), - 'class' => 'invert_filter', - ] + 'images/cross.png', + true, + [ + 'border' => '0', + 'alt' => __('Delete'), + 'class' => 'invert_filter', + ] ).''." diff --git a/pandora_console/godmode/alerts/alert_actions.php b/pandora_console/godmode/alerts/alert_actions.php index 584e52f59b..de9d6e126d 100644 --- a/pandora_console/godmode/alerts/alert_actions.php +++ b/pandora_console/godmode/alerts/alert_actions.php @@ -235,7 +235,7 @@ $search_string = (string) get_parameter('search_string', ''); $group = (int) get_parameter('group', 0); $group_search = (int) get_parameter('group_search', 0); $id_command_search = (int) get_parameter('id_command_search', 0); -$url = 'index.php?sec='.$sec.'&sec2=godmode/alerts/alert_actions'; +$url = 'index.php?sec='.$sec.'&sec2=godmode/alerts/alert_actions&search_string='.$search_string.'&group_search='.$group_search.'&id_command_search='.$id_command_search; // Filter table. $table_filter = new stdClass(); diff --git a/pandora_console/godmode/alerts/alert_list.list.php b/pandora_console/godmode/alerts/alert_list.list.php index 8e20aeaab7..95ace7d345 100644 --- a/pandora_console/godmode/alerts/alert_list.list.php +++ b/pandora_console/godmode/alerts/alert_list.list.php @@ -1134,7 +1134,7 @@ function show_add_action(id_alert) { }, open: function() { $(`#add_action-div-${id_alert}`).css('overflow', 'hidden'); - $("#action_select, #action_select").select2({ + $("select[id^='action_select'], select[id^='action_select']").select2({ tags: true, dropdownParent: $("#add_action-div-" + id_alert) }); diff --git a/pandora_console/godmode/alerts/configure_alert_action.php b/pandora_console/godmode/alerts/configure_alert_action.php index 4d8478c99b..c8efca1f00 100644 --- a/pandora_console/godmode/alerts/configure_alert_action.php +++ b/pandora_console/godmode/alerts/configure_alert_action.php @@ -21,8 +21,6 @@ enterprise_include_once('meta/include/functions_alerts_meta.php'); check_login(); -enterprise_hook('open_meta_frame'); - if (! check_acl($config['id_user'], 0, 'LM')) { db_pandora_audit( 'ACL Violation', @@ -50,6 +48,8 @@ if (is_ajax()) { } } +enterprise_hook('open_meta_frame'); + if (defined('METACONSOLE')) { $sec = 'advanced'; } else { @@ -694,8 +694,19 @@ $(document).ready (function () { } } else { + var is_element_select = $("[name=field" + i + "_value]").is("select"); + $("[name=field" + i + "_value]").val(old_value); + if (is_element_select === true) { + $("[name=field" + i + "_value]").trigger('change'); + } + + $("[name=field" + i + "_recovery_value]").val(old_recovery_value); + + if (is_element_select === true) { + $("[name=field" + i + "_recovery_value]").trigger('change'); + } } } else { @@ -747,6 +758,7 @@ $(document).ready (function () { if ($('#field5_value').val() !== '') { ajax_get_integria_custom_fields($('#field5_value').val(), integria_custom_fields_values, integria_custom_fields_rvalues); + $('#field5_value').trigger('change'); } $('#field5_value').on('change', function() { diff --git a/pandora_console/godmode/audit_log.php b/pandora_console/godmode/audit_log.php new file mode 100644 index 0000000000..fbded7819e --- /dev/null +++ b/pandora_console/godmode/audit_log.php @@ -0,0 +1,71 @@ + '[AuditLog]'.$e->getMessage() ]); + exit; + } else { + echo '[AuditLog]'.$e->getMessage(); + } + + // Stop this execution, but continue 'globally'. + return; +} + +// AJAX controller. +if ((bool) is_ajax() === true) { + $method = get_parameter('method'); + + if (method_exists($controller, $method) === true) { + if ($controller->ajaxMethod($method) === true) { + $controller->{$method}(); + } else { + $controller->error('Unavailable method.'); + } + } else { + $controller->error('Method not found. ['.$method.']'); + } + + // Stop any execution. + exit; +} else { + // Run. + $controller->run(); +} diff --git a/pandora_console/godmode/gis_maps/configure_gis_map.php b/pandora_console/godmode/gis_maps/configure_gis_map.php index 4c921525e6..b8b3e62e49 100644 --- a/pandora_console/godmode/gis_maps/configure_gis_map.php +++ b/pandora_console/godmode/gis_maps/configure_gis_map.php @@ -463,21 +463,12 @@ foreach ($listConnectionTemp as $connectionTemp) { } $table->data[1][0] = __('Add Map connection').$iconError; -$table->data[1][1] = " - - - - ".gis_add_conection_maps_in_form($map_connection_list).' +)." < / a > < input type = 'hidden' name = 'map_connection_list' value = '' id = 'map_connection_list' / > < input type = 'hidden' name = 'layer_list' value = '' id = 'layer_list' / > < / td > < / tr > (".gis_add_conection_maps_in_form($map_connection_list).'
- ".html_print_select($listConnection, 'map_connection_list', '', '', '', '0', true)." - - ".html_print_image( +$table->data[1][1] = ".html_print_select($listConnection, 'map_connection_list', '', '', '', '0', true)." + < / td > < td > < a href = 'javascript: addConnectionMap();' > ".html_print_image( 'images/add.png', true, ['class' => 'invert_filter'] -)." - - -
'; $own_info = get_user_info($config['id_user']); @@ -539,6 +530,8 @@ $table->data[9][1] = html_print_input_text('map_default_altitude', $map_default_ html_print_table($table); +$user_groups = users_get_groups($config['user'], 'AR', false); + echo '

'.__('Layers').'

'; $table->width = '100%'; @@ -551,9 +544,9 @@ $table->data = []; $table->data[0][0] = '

'.__('List of layers').'

'; $table->data[0][1] = '
'.html_print_button(__('New layer'), 'new_layer', false, 'newLayer();', 'class="sub add "', true).'
'; -$table->data[1][0] = '
'; -$table->data[1][1] = '