diff --git a/pandora_agents/pc/pandora_agent.redhat.spec b/pandora_agents/pc/pandora_agent.redhat.spec index ae481e3403..ce60c8841f 100644 --- a/pandora_agents/pc/pandora_agent.redhat.spec +++ b/pandora_agents/pc/pandora_agent.redhat.spec @@ -1,6 +1,7 @@ # #Pandora FMS Linux Agent # +%global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 4.0 %define release 1 diff --git a/pandora_agents/pc/pandora_agent.spec b/pandora_agents/pc/pandora_agent.spec index 1bfc289d52..5ad481315a 100644 --- a/pandora_agents/pc/pandora_agent.spec +++ b/pandora_agents/pc/pandora_agent.spec @@ -1,6 +1,7 @@ # #Pandora FMS Linux Agent # +%global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 4.0.1 %define release 1 diff --git a/pandora_agents/shellscript/linux/pandora_agent.spec b/pandora_agents/shellscript/linux/pandora_agent.spec index 64b33bfecf..9c5e0296c6 100755 --- a/pandora_agents/shellscript/linux/pandora_agent.spec +++ b/pandora_agents/shellscript/linux/pandora_agent.spec @@ -1,6 +1,7 @@ # #Pandora FMS Linux Agent # +%global __os_install_post %{nil} %define name pandorafms_agent %define version 3.2 Summary: Pandora FMS Linux agent diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 5f29343d22..5a537cea8d 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.769-230217 +Version: 7.0NG.769-230221 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 07e42a8119..3bdb964eb0 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.769-230217" +pandora_version="7.0NG.769-230221" 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 33f9b75177..cd0fdd0989 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1023,7 +1023,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.769'; -use constant AGENT_BUILD => '230217'; +use constant AGENT_BUILD => '230221'; # 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 fa965af096..1a82c15221 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -1,9 +1,10 @@ # #Pandora FMS Linux Agent # +%global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.769 -%define release 230217 +%define release 230221 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 f1091e07d9..4015375532 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -1,9 +1,10 @@ # #Pandora FMS Linux Agent # +%global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.769 -%define release 230217 +%define release 230221 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 0955293f59..6d8458b318 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.769" -PI_BUILD="230217" +PI_BUILD="230221" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 9d180788d6..bd75795838 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{230217} +{230221} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index b6a69e5783..f38933f5b9 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.769 Build 230217") +#define PANDORA_VERSION ("7.0NG.769 Build 230221") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 61bf76a879..21f5675492 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.769(Build 230217))" + VALUE "ProductVersion", "(7.0NG.769(Build 230221))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 7eaf7524ea..919f840961 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.769-230217 +Version: 7.0NG.769-230221 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 d6e24860e3..524fd6c38c 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.769-230217" +pandora_version="7.0NG.769-230221" package_pear=0 package_pandora=1 diff --git a/pandora_console/general/login_page.php b/pandora_console/general/login_page.php index bb9fa19185..cd45f34f48 100755 --- a/pandora_console/general/login_page.php +++ b/pandora_console/general/login_page.php @@ -359,6 +359,10 @@ if ($config['enterprise_installed']) { } // CSRF validation. +if (isset($_SESSION['csrf_code']) === true) { + unset($_SESSION['csrf_code']); +} + html_print_csrf_hidden(); echo ''; diff --git a/pandora_console/godmode/users/user_list.php b/pandora_console/godmode/users/user_list.php index e5d15006fe..85e713bed0 100644 --- a/pandora_console/godmode/users/user_list.php +++ b/pandora_console/godmode/users/user_list.php @@ -402,6 +402,11 @@ if ($delete_user === true) { __('There was a problem deleting the profile') ); } else if ($disable_user !== false) { + // CSRF Validator. + if (html_print_csrf_error()) { + return; + } + // Disable_user. $id_user = get_parameter('id', 0); @@ -646,6 +651,8 @@ $limit = (int) $config['block_size']; $rowPair = true; $iterator = 0; $cont = 0; +// Creates csrf. +$csrf = html_print_csrf_hidden(true); foreach ($info as $user_id => $user_info) { if (empty($user_id) === true) { continue; @@ -815,6 +822,8 @@ foreach ($info as $user_id => $user_info) { $user_info['id_user'], true ); + // Same csrf for every disable button for submit. + $data[6] .= $csrf; $data[6] .= html_print_input_hidden( 'disable_user', $toDoAction, diff --git a/pandora_console/include/class/Diagnostics.class.php b/pandora_console/include/class/Diagnostics.class.php index b0f698252b..99e28e3983 100644 --- a/pandora_console/include/class/Diagnostics.class.php +++ b/pandora_console/include/class/Diagnostics.class.php @@ -104,6 +104,7 @@ class Diagnostics extends Wizard 'getChartAjax', 'formFeedback', 'createdScheduleFeedbackTask', + 'getSystemDate', ]; @@ -209,6 +210,7 @@ class Diagnostics extends Wizard 'getAttachmentFolder', 'getInfoTagenteDatos', 'getServerThreads', + 'getSystemDate', ]; if ($this->pdf === true) { @@ -278,6 +280,10 @@ class Diagnostics extends Wizard $title = __('SQL show engine innodb status'); break; + case 'getSystemDate': + $title = __('Date system'); + break; + default: // Not possible. $title = ''; @@ -516,6 +522,27 @@ class Diagnostics extends Wizard } + /** + * Date system + * + * @return string + */ + public function getSystemDate(): string + { + $result = [ + 'error' => false, + 'data' => [ + 'date' => [ + 'name' => __('System Date (Console)'), + 'value' => date('H:i:s Y-m-d'), + ], + ], + ]; + + return json_encode($result); + } + + /** * Database size stats. * diff --git a/pandora_console/include/class/SnmpConsole.class.php b/pandora_console/include/class/SnmpConsole.class.php index 9aae307bc5..96553d2ac4 100644 --- a/pandora_console/include/class/SnmpConsole.class.php +++ b/pandora_console/include/class/SnmpConsole.class.php @@ -413,73 +413,74 @@ class SnmpConsole extends HTML 'class' => 'flex-row', 'inputs' => [ [ - 'label' => __('Alert'), - 'type' => 'select', - 'id' => 'filter_alert', - 'name' => 'filter_alert', - 'class' => 'w200px', - 'fields' => $show_alerts, - 'return' => true, - 'selected' => $this->filter_alert, + 'label' => __('Alert'), + 'type' => 'select', + 'id' => 'filter_alert', + 'input_class' => 'filter_input_datatable', + 'name' => 'filter_alert', + 'fields' => $show_alerts, + 'return' => true, + 'selected' => $this->filter_alert, ], [ - 'label' => __('Severity'), - 'type' => 'select', - 'id' => 'filter_severity', - 'name' => 'filter_severity', - 'class' => 'w200px', - 'fields' => $severities, - 'return' => true, - 'selected' => $this->filter_severity, + 'label' => __('Severity'), + 'type' => 'select', + 'id' => 'filter_severity', + 'input_class' => 'filter_input_datatable', + 'name' => 'filter_severity', + 'fields' => $severities, + 'return' => true, + 'selected' => $this->filter_severity, ], [ - 'label' => __('Free search'), - 'type' => 'text', - 'class' => 'w400px', - 'id' => 'filter_free_search', - 'name' => 'filter_free_search', - 'value' => $this->filter_free_search, + 'label' => __('Free search'), + 'type' => 'text', + 'id' => 'filter_free_search', + 'input_class' => 'filter_input_datatable', + 'name' => 'filter_free_search', + 'value' => $this->filter_free_search, ], [ - 'label' => __('Status'), - 'type' => 'select', - 'id' => 'filter_status', - 'name' => 'filter_status', - 'class' => 'w200px', - 'fields' => $status_array, - 'return' => true, - 'selected' => $this->filter_status, + 'label' => __('Status'), + 'type' => 'select', + 'id' => 'filter_status', + 'input_class' => 'filter_input_datatable', + 'name' => 'filter_status', + 'fields' => $status_array, + 'return' => true, + 'selected' => $this->filter_status, ], [ - 'label' => __('Group by Enterprise String/IP'), - 'type' => 'select', - 'name' => 'filter_group_by', - 'selected' => $this->filter_group_by, - 'disabled' => false, - 'return' => true, - 'id' => 'filter_group_by', - 'fields' => [ + 'label' => __('Group by Enterprise String/IP'), + 'type' => 'select', + 'name' => 'filter_group_by', + 'selected' => $this->filter_group_by, + 'disabled' => false, + 'return' => true, + 'id' => 'filter_group_by', + 'input_class' => 'filter_input_datatable', + 'fields' => [ 0 => __('No'), 1 => __('Yes'), ], ], [ - 'label' => __('Max. hours old'), - 'type' => 'text', - 'class' => 'w200px', - 'id' => 'filter_hours_ago', - 'name' => 'filter_hours_ago', - 'value' => $this->filter_hours_ago, + 'label' => __('Max. hours old'), + 'type' => 'text', + 'id' => 'filter_hours_ago', + 'input_class' => 'filter_input_datatable', + 'name' => 'filter_hours_ago', + 'value' => $this->filter_hours_ago, ], [ - 'label' => __('Trap type'), - 'type' => 'select', - 'id' => 'filter_trap_type', - 'name' => 'filter_trap_type', - 'class' => 'w200px', - 'fields' => $trap_types, - 'return' => true, - 'selected' => $this->filter_trap_type, + 'label' => __('Trap type'), + 'type' => 'select', + 'id' => 'filter_trap_type', + 'input_class' => 'filter_input_datatable', + 'name' => 'filter_trap_type', + 'fields' => $trap_types, + 'return' => true, + 'selected' => $this->filter_trap_type, ], ], ], diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 6b8c7c25fa..af73bd3842 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC230217'; +$build_version = 'PC230221'; $pandora_version = 'v7.0NG.769'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/include/functions_menu.php b/pandora_console/include/functions_menu.php index 277eb8520c..2d474a9853 100644 --- a/pandora_console/include/functions_menu.php +++ b/pandora_console/include/functions_menu.php @@ -797,6 +797,7 @@ if (is_ajax()) { $db_fragmentation = json_decode($d->getTablesFragmentation()); $sys_info = json_decode($d->getSystemInfo()); $php_sys = json_decode($d->getPHPSetup()); + $system_date = json_decode($d->getSystemDate()); $fragmentation_status = ''; if ($db_fragmentation->data->tablesFragmentationStatus->status === 1) { @@ -1030,6 +1031,14 @@ if (is_ajax()) {
'.$sys_info->data->ipInfo->value.'
+'.$system_date->data->date->name.'
+'.$system_date->data->date->value.'
+