Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog.d/bugfix/ZBX-181491
-rw-r--r--ui/host_discovery.php2
-rw-r--r--ui/include/views/configuration.host.discovery.list.php14
3 files changed, 10 insertions, 7 deletions
diff --git a/ChangeLog.d/bugfix/ZBX-18149 b/ChangeLog.d/bugfix/ZBX-18149
new file mode 100644
index 00000000000..049a662219a
--- /dev/null
+++ b/ChangeLog.d/bugfix/ZBX-18149
@@ -0,0 +1 @@
+..F....... [ZBX-18149] fixed discovered hosts showing links to host prototypes which should not possible (Ivo)
diff --git a/ui/host_discovery.php b/ui/host_discovery.php
index 83fb13431e0..94074b9025b 100644
--- a/ui/host_discovery.php
+++ b/ui/host_discovery.php
@@ -817,7 +817,7 @@ else {
// Select LLD rules.
$options = [
'output' => API_OUTPUT_EXTEND,
- 'selectHosts' => ['hostid', 'name', 'status'],
+ 'selectHosts' => ['hostid', 'name', 'status', 'flags'],
'selectItems' => API_OUTPUT_COUNT,
'selectGraphs' => API_OUTPUT_COUNT,
'selectTriggers' => API_OUTPUT_COUNT,
diff --git a/ui/include/views/configuration.host.discovery.list.php b/ui/include/views/configuration.host.discovery.list.php
index d9a8c7f9d00..c0c2f56bbce 100644
--- a/ui/include/views/configuration.host.discovery.list.php
+++ b/ui/include/views/configuration.host.discovery.list.php
@@ -263,12 +263,14 @@ foreach ($data['discoveries'] as $discovery) {
),
CViewHelper::showNum($discovery['graphs'])
],
- [
- new CLink(_('Host prototypes'),
- (new CUrl('host_prototypes.php'))->setArgument('parent_discoveryid', $discovery['itemid'])
- ),
- CViewHelper::showNum($discovery['hostPrototypes'])
- ],
+ ($discovery['hosts'][0]['flags'] == ZBX_FLAG_DISCOVERY_NORMAL)
+ ? [
+ new CLink(_('Host prototypes'),
+ (new CUrl('host_prototypes.php'))->setArgument('parent_discoveryid', $discovery['itemid'])
+ ),
+ CViewHelper::showNum($discovery['hostPrototypes'])
+ ]
+ : '',
(new CDiv(CHtml::encode($discovery['key_'])))->addClass(ZBX_STYLE_WORDWRAP),
$discovery['delay'],
item_type2str($discovery['type']),