Merge remote-tracking branch 'origin/develop' into ent-8161-deshabilitar-reglas-de-autoconfiguracion-en-nodos-a-demanda

This commit is contained in:
fbsanchez 2022-02-15 14:32:50 +01:00
commit 7c11a01b85
37 changed files with 121 additions and 125 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix package: pandorafms-agent-unix
Version: 7.0NG.759-220210 Version: 7.0NG.759-220215
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
pandora_version="7.0NG.759-220210" pandora_version="7.0NG.759-220215"
echo "Test if you has the tools for to make the packages." echo "Test if you has the tools for to make the packages."
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null

View File

@ -1015,7 +1015,7 @@ my $Sem = undef;
my $ThreadSem = undef; my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.759'; use constant AGENT_VERSION => '7.0NG.759';
use constant AGENT_BUILD => '220210'; use constant AGENT_BUILD => '220215';
# Agent log default file size maximum and instances # Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000; use constant DEFAULT_MAX_LOG_SIZE => 600000;

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 7.0NG.759 %define version 7.0NG.759
%define release 220210 %define release 220215
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 7.0NG.759 %define version 7.0NG.759
%define release 220210 %define release 220215
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -10,7 +10,7 @@
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG.759" PI_VERSION="7.0NG.759"
PI_BUILD="220210" PI_BUILD="220215"
OS_NAME=`uname -s` OS_NAME=`uname -s`
FORCE=0 FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{} {}
Version Version
{220210} {220215}
ViewReadme ViewReadme
{Yes} {Yes}

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils; using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1 #define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0NG.759 Build 220210") #define PANDORA_VERSION ("7.0NG.759 Build 220215")
string pandora_path; string pandora_path;
string pandora_dir; string pandora_dir;

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Artica ST" VALUE "LegalCopyright", "Artica ST"
VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent" VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(7.0NG.759(Build 220210))" VALUE "ProductVersion", "(7.0NG.759(Build 220215))"
VALUE "FileVersion", "1.0.0.0" VALUE "FileVersion", "1.0.0.0"
END END
END END

View File

@ -1,5 +1,5 @@
package: pandorafms-console package: pandorafms-console
Version: 7.0NG.759-220210 Version: 7.0NG.759-220215
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
pandora_version="7.0NG.759-220210" pandora_version="7.0NG.759-220215"
package_pear=0 package_pear=0
package_pandora=1 package_pandora=1

View File

@ -1120,7 +1120,7 @@ function resource_registration_extension_main()
} }
echo '<div class=notify>'; echo '<div class=notify>';
echo __('This extension makes registering resource templates easier.').' '.__('Here you can upload a resource template in .ptr format.').' '.__('Please refer to our documentation for more information on how to obtain and use %s resources.', get_product_name()).' '.'<br> <br>'.__('You can get more resurces in our <a href="http://pandorafms.com/Library/Library/">Public Resource Library</a>'); echo __('This extension makes registering resource templates easier.').' '.__('Here you can upload a resource template in .ptr format.').' '.__('Please refer to our documentation for more information on how to obtain and use %s resources.', get_product_name()).' '.'<br> <br>'.__('You can get more resurces in our <a href="https://pandorafms.com/Library/Library/">Public Resource Library</a>');
echo '</div>'; echo '</div>';
echo '<br /><br />'; echo '<br /><br />';

View File

@ -144,7 +144,7 @@ if ($prediction_available) {
$modules['predictionserver'] = __('Create a new prediction server module'); $modules['predictionserver'] = __('Create a new prediction server module');
} }
if (is_metaconsole() === true || $web_available === '1') { if (is_metaconsole() === true || $web_available >= '1') {
$modules['webserver'] = __('Create a new web Server module'); $modules['webserver'] = __('Create a new web Server module');
} }
@ -238,7 +238,7 @@ echo '</table>';
if (!$config['disable_help']) { if (!$config['disable_help']) {
echo '<div class="disable_help">'; echo '<div class="disable_help">';
echo '<strong>'; echo '<strong>';
echo "<a class='color-black-grey invert_filter' target='_blank' href='http://pandorafms.com/Library/Library/'>".__('Get more modules on Monitoring Library').'</a>'; echo "<a class='color-black-grey invert_filter' target='_blank' href='https://pandorafms.com/Library/Library/'>".__('Get more modules on Monitoring Library').'</a>';
echo '</strong>'; echo '</strong>';
echo '</div>'; echo '</div>';
} }

View File

@ -31,6 +31,7 @@
global $config; global $config;
global $statusProcessInDB; global $statusProcessInDB;
use PandoraFMS\Agent;
use PandoraFMS\User; use PandoraFMS\User;
check_login(); check_login();
@ -630,18 +631,7 @@ switch ($activeTab) {
'message' => $message, 'message' => $message,
]; ];
} else { } else {
// One item per module if (is_metaconsole() === true) {
if (empty($name_modules)) {
$statusProcessInDB = [
'flag' => true,
'message' => ui_print_error_message(
__('No modules selected'),
'',
true
),
];
} else {
if (defined('METACONSOLE')) {
$agents_ids = []; $agents_ids = [];
foreach ($id_agents as $id_agent_id) { foreach ($id_agents as $id_agent_id) {
$server_and_agent = explode('|', $id_agent_id); $server_and_agent = explode('|', $id_agent_id);
@ -661,13 +651,10 @@ switch ($activeTab) {
} else { } else {
$agents[0] = $id_agents; $agents[0] = $id_agents;
} }
}
foreach ($agents as $id_server => $id_agents) { foreach ($agents as $id_server => $id_agents) {
// Any module // Any module.
if ($name_modules[0] == '0') { if (empty($name_modules) === true || $name_modules[0] === '0') {
$message .= visual_map_process_wizard_add_agents( $message .= visual_map_process_wizard_add_agents(
$id_agents, $id_agents,
$image, $image,
@ -705,19 +692,14 @@ switch ($activeTab) {
} else { } else {
foreach ($name_modules as $mod) { foreach ($name_modules as $mod) {
foreach ($id_agents as $ag) { foreach ($id_agents as $ag) {
$id_module = agents_get_modules( $agent = new Agent($ag);
$ag, $id_module = $agent->searchModules(
['id_agente_modulo'], ['nombre' => $mod],
['nombre' => $mod] 1
); )->toArray()['id_agente_modulo'];
if (empty($id_module) === true) {
if (empty($id_module)) {
continue; continue;
} else {
$id_module = reset($id_module);
$id_module = $id_module['id_agente_modulo'];
} }
$id_modules[] = $id_module; $id_modules[] = $id_module;

View File

@ -533,7 +533,7 @@ echo '</div>';
echo '</form>'; echo '</form>';
// Trick for it have a traduct text for javascript. // Trick for it have a traduct text for javascript.
echo '<span id="any_text" class="invisible">'.__('Any').'</span>'; echo '<span id="any_text" class="invisible">'.__('None').'</span>';
echo '<span id="none_text" class="invisible">'.__('None').'</span>'; echo '<span id="none_text" class="invisible">'.__('None').'</span>';
echo '<span id="loading_text" class="invisible">'.__('Loading...').'</span>'; echo '<span id="loading_text" class="invisible">'.__('Loading...').'</span>';
?> ?>

View File

@ -101,7 +101,7 @@ $output .= '<p id="description_task">';
$output .= __($str); $output .= __($str);
$output .= '<br><br>'; $output .= '<br><br>';
$output .= __('You can get more plugins in our'); $output .= __('You can get more plugins in our');
$output .= '<a href="http://pandorafms.com/Library/Library/">'; $output .= '<a href="https://pandorafms.com/Library/Library/">';
$output .= ' '.__('Public Resource Library'); $output .= ' '.__('Public Resource Library');
$output .= '</a>'; $output .= '</a>';
$output .= '</p>'; $output .= '</p>';

View File

@ -63,7 +63,7 @@ if (is_ajax() === true) {
'searchAgent' => '', 'searchAgent' => '',
'statusAgent' => AGENT_STATUS_ALL, 'statusAgent' => AGENT_STATUS_ALL,
'searchModule' => '', 'searchModule' => '',
'statusModule' => -1, 'statusModule' => AGENT_MODULE_STATUS_ALL,
'groupID' => 0, 'groupID' => 0,
'tagID' => 0, 'tagID' => 0,
]; ];

View File

@ -929,7 +929,9 @@ class Tree
$agents_aux = []; $agents_aux = [];
foreach ($agents as $iterator => $agent) { foreach ($agents as $iterator => $agent) {
$this->processAgent($agents[$iterator], $server); $this->processAgent($agents[$iterator], $server);
if ($agents[$iterator]['counters']['total'] !== '0') { if ($agents[$iterator]['counters']['total'] !== '0'
|| (bool) $this->filter['show_not_init_agents'] === true
) {
$agents_aux[] = $agents[$iterator]; $agents_aux[] = $agents[$iterator];
} }
} }

View File

@ -20,7 +20,7 @@
/** /**
* Pandora build version and version * Pandora build version and version
*/ */
$build_version = 'PC220210'; $build_version = 'PC220215';
$pandora_version = 'v7.0NG.759'; $pandora_version = 'v7.0NG.759';
// Do not overwrite default timezone set if defined. // Do not overwrite default timezone set if defined.

View File

@ -1430,6 +1430,9 @@ function agents_get_group_agents(
/** /**
* @deprecated use \PandoraFMS\Agent::searchModules
*
*
* Get all the modules in an agent. If an empty list is passed it will select all * Get all the modules in an agent. If an empty list is passed it will select all
* *
* @param mixed Agent id to get modules. It can also be an array of agent id's, by default is null and this mean that use the ids of agents in user's groups. * @param mixed Agent id to get modules. It can also be an array of agent id's, by default is null and this mean that use the ids of agents in user's groups.

View File

@ -779,19 +779,19 @@ function events_get_all(
); );
} }
if (isset($filter['date_to']) if (isset($filter['date_to']) === true
&& !empty($filter['date_to']) && empty($filter['date_to']) === false
&& $filter['date_to'] != '0000-00-00' && $filter['date_to'] !== '0000-00-00'
) { ) {
$date_to = $filter['date_to']; $date_to = $filter['date_to'];
} }
if (isset($filter['time_to'])) { if (isset($filter['time_to']) === true) {
$time_to = (empty($filter['time_to']) === true) ? '23:59:59' : $filter['time_to']; $time_to = (empty($filter['time_to']) === true) ? '23:59:59' : $filter['time_to'];
} }
if (isset($date_to)) { if (isset($date_to) === true) {
if (!isset($time_to)) { if (isset($time_to) === false) {
$time_to = '23:59:59'; $time_to = '23:59:59';
} }
@ -802,8 +802,8 @@ function events_get_all(
); );
} }
if (!isset($from)) { if (isset($from) === false) {
if (isset($filter['event_view_hr']) && ($filter['event_view_hr'] > 0)) { if (isset($filter['event_view_hr']) === true && ($filter['event_view_hr'] > 0)) {
$sql_filters[] = sprintf( $sql_filters[] = sprintf(
' AND utimestamp > UNIX_TIMESTAMP(now() - INTERVAL %d HOUR) ', ' AND utimestamp > UNIX_TIMESTAMP(now() - INTERVAL %d HOUR) ',
$filter['event_view_hr'] $filter['event_view_hr']
@ -811,20 +811,20 @@ function events_get_all(
} }
} }
if (isset($filter['id_agent']) && $filter['id_agent'] > 0) { if (isset($filter['id_agent']) === true && $filter['id_agent'] > 0) {
$sql_filters[] = sprintf( $sql_filters[] = sprintf(
' AND te.id_agente = %d ', ' AND te.id_agente = %d ',
$filter['id_agent'] $filter['id_agent']
); );
} }
if (!empty($filter['event_type']) && $filter['event_type'] != 'all') { if (empty($filter['event_type']) === false && $filter['event_type'] !== 'all') {
if ($filter['event_type'] == 'warning' if ($filter['event_type'] === 'warning'
|| $filter['event_type'] == 'critical' || $filter['event_type'] === 'critical'
|| $filter['event_type'] == 'normal' || $filter['event_type'] === 'normal'
) { ) {
$sql_filters[] = ' AND event_type LIKE "%'.$filter['event_type'].'%"'; $sql_filters[] = ' AND event_type LIKE "%'.$filter['event_type'].'%"';
} else if ($filter['event_type'] == 'not_normal') { } else if ($filter['event_type'] === 'not_normal') {
$sql_filters[] = ' AND (event_type LIKE "%warning%" $sql_filters[] = ' AND (event_type LIKE "%warning%"
OR event_type LIKE "%critical%" OR event_type LIKE "%critical%"
OR event_type LIKE "%unknown%")'; OR event_type LIKE "%unknown%")';
@ -833,9 +833,9 @@ function events_get_all(
} }
} }
if (isset($filter['severity']) && $filter['severity'] > 0) { if (isset($filter['severity']) === true && $filter['severity'] > 0) {
if (is_array($filter['severity'])) { if (is_array($filter['severity']) === true) {
if (!in_array(-1, $filter['severity'])) { if (in_array(-1, $filter['severity']) === false) {
$not_normal = array_search(EVENT_CRIT_NOT_NORMAL, $filter['severity']); $not_normal = array_search(EVENT_CRIT_NOT_NORMAL, $filter['severity']);
if ($not_normal !== false) { if ($not_normal !== false) {
unset($filter['severity'][$not_normal]); unset($filter['severity'][$not_normal]);
@ -858,7 +858,7 @@ function events_get_all(
$filter['severity'][] = EVENT_CRIT_CRITICAL; $filter['severity'][] = EVENT_CRIT_CRITICAL;
} }
if (!empty($filter['severity'])) { if (empty($filter['severity']) === false) {
$filter['severity'] = implode(',', $filter['severity']); $filter['severity'] = implode(',', $filter['severity']);
$sql_filters[] = sprintf( $sql_filters[] = sprintf(
' AND criticity IN (%s)', ' AND criticity IN (%s)',
@ -1015,7 +1015,7 @@ function events_get_all(
$EW_groups = users_get_groups($config['id_user'], 'EW', true, true); $EW_groups = users_get_groups($config['id_user'], 'EW', true, true);
} }
if (!$user_is_admin && !users_can_manage_group_all('ER')) { if (!$user_is_admin && users_can_manage_group_all('ER') === false) {
// Get groups where user have ER grants. // Get groups where user have ER grants.
$sql_filters[] = sprintf( $sql_filters[] = sprintf(
' AND (te.id_grupo IN ( %s ) OR tasg.id_group IN (%s))', ' AND (te.id_grupo IN ( %s ) OR tasg.id_group IN (%s))',
@ -1038,14 +1038,14 @@ function events_get_all(
$tagente_table = 'tagente'; $tagente_table = 'tagente';
$tagente_field = 'id_agente'; $tagente_field = 'id_agente';
$conditionMetaconsole = ''; $conditionMetaconsole = '';
if (is_metaconsole() && $nodeConnected === false) { if ((is_metaconsole() === true) && ($nodeConnected === false)) {
$tagente_table = 'tmetaconsole_agent'; $tagente_table = 'tmetaconsole_agent';
$tagente_field = 'id_tagente'; $tagente_field = 'id_tagente';
$conditionMetaconsole = ' AND ta.id_tmetaconsole_setup = te.server_id '; $conditionMetaconsole = ' AND ta.id_tmetaconsole_setup = te.server_id ';
} }
// Agent alias. // Agent alias.
if (!empty($filter['agent_alias'])) { if (empty($filter['agent_alias']) === false) {
$agent_join_filters[] = sprintf( $agent_join_filters[] = sprintf(
' AND ta.alias = "%s" ', ' AND ta.alias = "%s" ',
$filter['agent_alias'] $filter['agent_alias']
@ -1053,7 +1053,7 @@ function events_get_all(
} }
// Free search. // Free search.
if (!empty($filter['search'])) { if (empty($filter['search']) === false) {
if (isset($config['dbconnection']->server_version) if (isset($config['dbconnection']->server_version)
&& $config['dbconnection']->server_version > 50600 && $config['dbconnection']->server_version > 50600
) { ) {
@ -1078,16 +1078,16 @@ function events_get_all(
} }
// Id extra. // Id extra.
if (!empty($filter['id_extra'])) { if (empty($filter['id_extra']) === false) {
$sql_filters[] = sprintf( $sql_filters[] = sprintf(
' AND lower(te.id_extra) like lower("%%%s%%") ', ' AND lower(te.id_extra) like lower("%%%s%%") ',
$filter['id_extra'] $filter['id_extra']
); );
} }
if (is_metaconsole() && $nodeConnected === false) { if ((is_metaconsole() === true) && ($nodeConnected === false)) {
// Id source event. // Id source event.
if (!empty($filter['id_source_event'])) { if (empty($filter['id_source_event']) === false) {
$sql_filters[] = sprintf( $sql_filters[] = sprintf(
' AND lower(te.id_source_event) like lower("%%%s%%") ', ' AND lower(te.id_source_event) like lower("%%%s%%") ',
$filter['id_source_event'] $filter['id_source_event']
@ -1096,7 +1096,7 @@ function events_get_all(
} }
// User comment. // User comment.
if (!empty($filter['user_comment'])) { if (empty($filter['user_comment']) === false) {
// For filter field. // For filter field.
$sql_filters[] = sprintf( $sql_filters[] = sprintf(
' AND lower(te.user_comment) like lower("%%%s%%") ', ' AND lower(te.user_comment) like lower("%%%s%%") ',
@ -1111,7 +1111,7 @@ function events_get_all(
} }
// Source. // Source.
if (!empty($filter['source'])) { if (empty($filter['source']) === false) {
$sql_filters[] = sprintf( $sql_filters[] = sprintf(
' AND lower(te.source) like lower("%%%s%%") ', ' AND lower(te.source) like lower("%%%s%%") ',
$filter['source'] $filter['source']
@ -1119,7 +1119,7 @@ function events_get_all(
} }
// Validated or in process by. // Validated or in process by.
if (!empty($filter['id_user_ack'])) { if (empty($filter['id_user_ack']) === false) {
$sql_filters[] = sprintf( $sql_filters[] = sprintf(
' AND te.id_usuario like lower("%%%s%%") ', ' AND te.id_usuario like lower("%%%s%%") ',
$filter['id_user_ack'] $filter['id_user_ack']
@ -1128,13 +1128,13 @@ function events_get_all(
$tag_names = []; $tag_names = [];
// With following tags. // With following tags.
if (!empty($filter['tag_with'])) { if (empty($filter['tag_with']) === false) {
$tag_with = base64_decode($filter['tag_with']); $tag_with = base64_decode($filter['tag_with']);
$tags = json_decode($tag_with, true); $tags = json_decode($tag_with, true);
if (is_array($tags) && !in_array('0', $tags)) { if (is_array($tags) === true && in_array('0', $tags) === false) {
if (!$user_is_admin) { if (!$user_is_admin) {
$getUserTags = tags_get_tags_for_module_search(); $getUserTags = tags_get_tags_for_module_search();
// Prevent false value for array_flip // Prevent false value for array_flip.
if ($getUserTags === false) { if ($getUserTags === false) {
$getUserTags = []; $getUserTags = [];
} }
@ -1152,7 +1152,7 @@ function events_get_all(
$_tmp = ''; $_tmp = '';
foreach ($tags as $id_tag) { foreach ($tags as $id_tag) {
if (!isset($tags_names[$id_tag])) { if (isset($tags_names[$id_tag]) === false) {
$tags_names[$id_tag] = tags_get_name($id_tag); $tags_names[$id_tag] = tags_get_name($id_tag);
} }
@ -1182,18 +1182,22 @@ function events_get_all(
$tags_names[$id_tag] $tags_names[$id_tag]
); );
if ($tags[0] === $id_tag) {
$_tmp .= ')) ';
} else {
$_tmp .= ') '; $_tmp .= ') ';
} }
}
$sql_filters[] = $_tmp.')'; $sql_filters[] = $_tmp;
} }
} }
// Without following tags. // Without following tags.
if (!empty($filter['tag_without'])) { if (empty($filter['tag_without']) === false) {
$tag_without = base64_decode($filter['tag_without']); $tag_without = base64_decode($filter['tag_without']);
$tags = json_decode($tag_without, true); $tags = json_decode($tag_without, true);
if (is_array($tags) && !in_array('0', $tags)) { if (is_array($tags) === true && in_array('0', $tags) === false) {
if (!$user_is_admin) { if (!$user_is_admin) {
$user_tags = array_flip(tags_get_tags_for_module_search()); $user_tags = array_flip(tags_get_tags_for_module_search());
if ($user_tags != null) { if ($user_tags != null) {
@ -1208,7 +1212,7 @@ function events_get_all(
} }
foreach ($tags as $id_tag) { foreach ($tags as $id_tag) {
if (!isset($tags_names[$id_tag])) { if (isset($tags_names[$id_tag]) === false) {
$tags_names[$id_tag] = tags_get_name($id_tag); $tags_names[$id_tag] = tags_get_name($id_tag);
} }

View File

@ -14,6 +14,7 @@ Variables from PHP:
- error_search - error_search
*/ */
const REMOTE_MODULE_LIBRARY_URI = "https://pandorafms.com/library/";
$(document).ready(function() { $(document).ready(function() {
// Save categories in sessionStorage to avoid making the request to the API many times. // Save categories in sessionStorage to avoid making the request to the API many times.
function set_local_categories() { function set_local_categories() {
@ -100,8 +101,7 @@ $(document).ready(function() {
// Get all categories from Module library. // Get all categories from Module library.
function get_all_categories() { function get_all_categories() {
$.ajax({ $.ajax({
url: url: REMOTE_MODULE_LIBRARY_URI + "wp-json/wp/v2/categories?per_page=100",
"https://pandorafms.com/library/wp-json/wp/v2/categories?per_page=100",
type: "GET", type: "GET",
cache: false, cache: false,
crossDomain: true, crossDomain: true,
@ -127,10 +127,9 @@ $(document).ready(function() {
var api_url = ""; var api_url = "";
if (selector == "search") { if (selector == "search") {
api_url = "https://pandorafms.com/library/wp-json/wp/v2/posts?search="; api_url = REMOTE_MODULE_LIBRARY_URI + "wp-json/wp/v2/posts?search=";
} else if (selector == "category") { } else if (selector == "category") {
api_url = api_url = REMOTE_MODULE_LIBRARY_URI + "wp-json/wp/v2/posts/?categories=";
"https://pandorafms.com/library/wp-json/wp/v2/posts/?categories=";
} }
$.ajax({ $.ajax({
@ -238,7 +237,7 @@ $(document).ready(function() {
/* Print main page */ /* Print main page */
function library_main() { function library_main() {
$.ajax({ $.ajax({
url: "https://pandorafms.com/library/wp-json/wp/v2/pages/121", url: REMOTE_MODULE_LIBRARY_URI + "wp-json/wp/v2/pages/121",
type: "GET", type: "GET",
cache: false, cache: false,
crossDomain: true, crossDomain: true,
@ -286,6 +285,8 @@ function library_main() {
clean_page.splice(0, 1); clean_page.splice(0, 1);
$.each(clean_page, function(i, v) { $.each(clean_page, function(i, v) {
// Clean et_pb_blurb WP tags.
v = v.replace(/([\[et_pb_blurb].*[\]](?=[A-z]))/g, "");
var main_category = $( var main_category = $(
"#library_main_content div.library_main_category:nth-child(" + i + ")" "#library_main_content div.library_main_category:nth-child(" + i + ")"
); );
@ -314,7 +315,7 @@ function library_main() {
// Get all data from one category. This is necessary to get the category name. // Get all data from one category. This is necessary to get the category name.
function get_category(id) { function get_category(id) {
$.ajax({ $.ajax({
url: "https://pandorafms.com/library/wp-json/wp/v2/categories/" + id, url: REMOTE_MODULE_LIBRARY_URI + "wp-json/wp/v2/categories/" + id,
type: "GET", type: "GET",
cache: false, cache: false,
contentType: "application/json", contentType: "application/json",

View File

@ -549,7 +549,8 @@ class Agent extends Entity
* @param array $filter Filters. * @param array $filter Filters.
* @param integer $limit Limit search results. * @param integer $limit Limit search results.
* *
* @return array Of PandoraFMS\Module Modules found. * @return array|Module Of PandoraFMS\Module Modules
* found or Module found is limit 1.
*/ */
public function searchModules(array $filter, int $limit=0) public function searchModules(array $filter, int $limit=0)
{ {
@ -577,7 +578,10 @@ class Agent extends Entity
} else { } else {
// Search in db. // Search in db.
$return = Module::search($filter, $limit); $return = Module::search($filter, $limit);
if (is_array($return) === false) {
if (is_array($return) === false
&& is_object($return) === false
) {
return []; return [];
} }

View File

@ -129,7 +129,7 @@
<div style='height: 10px'> <div style='height: 10px'>
<?php <?php
$version = '7.0NG.759'; $version = '7.0NG.759';
$build = '220210'; $build = '220215';
$banner = "v$version Build $build"; $banner = "v$version Build $build";
error_reporting(0); error_reporting(0);

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.759 %define version 7.0NG.759
%define release 220210 %define release 220215
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name httpd %define httpd_name httpd

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.759 %define version 7.0NG.759
%define release 220210 %define release 220215
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name httpd %define httpd_name httpd

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.759 %define version 7.0NG.759
%define release 220210 %define release 220215
%define httpd_name httpd %define httpd_name httpd
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name apache2 %define httpd_name apache2

View File

@ -1,5 +1,5 @@
package: pandorafms-server package: pandorafms-server
Version: 7.0NG.759-220210 Version: 7.0NG.759-220215
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
pandora_version="7.0NG.759-220210" pandora_version="7.0NG.759-220215"
package_cpan=0 package_cpan=0
package_pandora=1 package_pandora=1

View File

@ -46,7 +46,7 @@ our @EXPORT = qw(
# version: Defines actual version of Pandora Server for this module only # version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.759"; my $pandora_version = "7.0NG.759";
my $pandora_build = "220210"; my $pandora_build = "220215";
our $VERSION = $pandora_version." ".$pandora_build; our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash # Setup hash

View File

@ -34,7 +34,7 @@ our @ISA = qw(Exporter);
# version: Defines actual version of Pandora Server for this module only # version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.759"; my $pandora_version = "7.0NG.759";
my $pandora_build = "220210"; my $pandora_build = "220215";
our $VERSION = $pandora_version." ".$pandora_build; our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] ); our %EXPORT_TAGS = ( 'all' => [ qw() ] );

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_server %define name pandorafms_server
%define version 7.0NG.759 %define version 7.0NG.759
%define release 220210 %define release 220215
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_server %define name pandorafms_server
%define version 7.0NG.759 %define version 7.0NG.759
%define release 220210 %define release 220215
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}

View File

@ -9,7 +9,7 @@
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG.759" PI_VERSION="7.0NG.759"
PI_BUILD="220210" PI_BUILD="220215"
MODE=$1 MODE=$1
if [ $# -gt 1 ]; then if [ $# -gt 1 ]; then

View File

@ -35,7 +35,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB; use PandoraFMS::DB;
# version: define current version # version: define current version
my $version = "7.0NG.759 Build 220210"; my $version = "7.0NG.759 Build 220215";
# Pandora server configuration # Pandora server configuration
my %conf; my %conf;

View File

@ -36,7 +36,7 @@ use Encode::Locale;
Encode::Locale::decode_argv; Encode::Locale::decode_argv;
# version: define current version # version: define current version
my $version = "7.0NG.759 Build 220210"; my $version = "7.0NG.759 Build 220215";
# save program name for logging # save program name for logging
my $progname = basename($0); my $progname = basename($0);