From 1f7a68cacc39dfd6e18c2de94bf2b60f2d1cbdd8 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Thu, 7 Jan 2021 16:37:13 +0100 Subject: [PATCH 1/3] Added group_password to print_agent --- pandora_server/lib/PandoraFMS/PluginTools.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pandora_server/lib/PandoraFMS/PluginTools.pm b/pandora_server/lib/PandoraFMS/PluginTools.pm index ecffeef396..62ed06e010 100644 --- a/pandora_server/lib/PandoraFMS/PluginTools.pm +++ b/pandora_server/lib/PandoraFMS/PluginTools.pm @@ -504,10 +504,20 @@ sub print_agent { # print header $xml .= "{'group_password'})) { + $xml .= " group_password='".$config->{'group_password'}."' "; } $xml .= ">"; From 32d09a23535f742fb6500020d36211d085147398 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Thu, 7 Jan 2021 18:24:51 +0100 Subject: [PATCH 2/3] added name method alias of nombre to Group class --- pandora_console/include/lib/Group.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/pandora_console/include/lib/Group.php b/pandora_console/include/lib/Group.php index fc9615cfce..3bd6585344 100644 --- a/pandora_console/include/lib/Group.php +++ b/pandora_console/include/lib/Group.php @@ -105,6 +105,23 @@ class Group extends Entity } + /** + * Alias of 'nombre'. + * + * @param string|null $name Name of group. + * + * @return string|void Name assigned or void if set operation. + */ + public function name(?string $name=null) + { + if ($name === null) { + return $this->nombre(); + } + + return $this->nombre($name); + } + + /** * Retrieves a list of groups fitered. * From 96a8dbd0c8ed9b9dbe63c0f1b0f2c2976e9569e6 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Thu, 7 Jan 2021 18:25:59 +0100 Subject: [PATCH 3/3] added name method alias of nombre to Group class --- pandora_console/include/lib/Group.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/lib/Group.php b/pandora_console/include/lib/Group.php index 3bd6585344..a9c2ef6494 100644 --- a/pandora_console/include/lib/Group.php +++ b/pandora_console/include/lib/Group.php @@ -136,7 +136,7 @@ class Group extends Entity if (empty($filter['id_user']) === true) { // By default query current user groups. $filter['id_user'] = false; - } else if (!\users_is_admin()) { + } else if ((bool) \users_is_admin() === false) { // Override user queried if user is not an admin. $filter['id_user'] = false; } @@ -243,8 +243,9 @@ class Group extends Entity if (isset($config['centralized_management']) === true && $config['centralized_management'] > 0 ) { + $msg = 'cannot be modified in a centralized management environment'; throw new \Exception( - get_class($this).' error, cannot be modified while centralized management environment.' + get_class($this).' error, '.$msg ); }